Skip to content

Add functionality to enable/disable#346

Merged
fukawi2 merged 2 commits into
mainfrom
phs/addEnableDisable
May 19, 2026
Merged

Add functionality to enable/disable#346
fukawi2 merged 2 commits into
mainfrom
phs/addEnableDisable

Conversation

@fukawi2

@fukawi2 fukawi2 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Adds two new user preferences for toggling existing K2 features on or off. Both default to on so existing users see no behaviour change.

  • Auto-clicking GitHub's "Load more" buttons on issue/PR pages.
  • The "Open All" buttons on dashboard panel headers.

The auto-load-more toggle lives in the issue/PR sidebar under the existing "Show/Hide Timestamps" toggle, and the Open All toggle lives on the K2 dashboard inside Legend.

Implementation notes:

  • New preference helpers get/setAutoLoadMoreComments and get/setShowOpenAllButtons in Preferences.js, both treating an unset value as true.
  • autoLoadMoreComments.js was refactored into start / stop / initAutoLoadMoreComments. The init subscribes to Onyx PREFERENCES, so flipping the toggle starts/stops the MutationObserver live without a page reload.
  • The shared Title component (used by every dashboard panel) now subscribes to Onyx itself and gates the Open All button on showOpenAllButtons, so no consumer needed to change.
    • pr.js refreshSidebar was slightly restructured to support multiple toggle wrappers — the previous early-return-after-timestamp-wrapper flow couldn't accommodate a second sibling wrapper.
image image

@fukawi2 fukawi2 requested a review from iwiznia May 19, 2026 01:50
@fukawi2 fukawi2 self-assigned this May 19, 2026
@iwiznia

iwiznia commented May 19, 2026

Copy link
Copy Markdown
Contributor

If you have tested that both features work when enabled and do not work when disabled, feel free to merge.

@fukawi2

fukawi2 commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

I have tested it works both ways, and switching between them works as expected.

@fukawi2 fukawi2 merged commit 27f642b into main May 19, 2026
6 checks passed
@fukawi2 fukawi2 deleted the phs/addEnableDisable branch May 19, 2026 11:04
@os-botify

os-botify Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

🚀 Released in version 1.5.42 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants