Repository navigation
Conversation
## Problem CI lint fails: `refined-github/no-optional-chaining` rejects the three `$optional(...)?.click()` calls in `expandAll`/`collapseAll`. ## Solution Switch to `$()` (which throws if not found) and drop `$optional`. The queried elements are guaranteed by their parent selectors: - `.js-diff-load` is matched via the `:has(.js-diff-load)` filter. - `button.js-details-target` is the chevron always present on `.js-file`. If GitHub ever changes that markup, throwing is the correct signal.
## Problem The Collapse/Expand BtnGroup sat on the baseline while the surrounding diffbar items render centered, so the new buttons looked offset. ## Solution Add Primer's `flex-self-center` utility to the BtnGroup wrapper so it aligns with the other toolbar items.
## Problem CI's `validateReadme` test fails: `AssertionError: Should have a screenshot (png/gif) in the readme`. The readme entry was added without one because the buttons hadn't been built yet. ## Solution Wrap the entry's description in a markdown link pointing to a user-attachments PNG of the rendered toolbar, and update the matching `screenshot` field in the auto-generated `features-meta.json` snapshot so vitest doesn't flag it on the next run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9346.
Adds two buttons — "Collapse all" and "Expand all" — to the PR Files toolbar, alongside the existing diff/file-filter controls. Same effect the modifier-click affordance in
toggle-everything-with-altalready provides, just discoverable: no key combo to remember, no hidden hint..js-file.Details--on.js-diff-load(so GitHub-hidden large diffs actually load, not just reveal an empty header), then expands any remaining still-collapsed filesSelectors are snapshotted before each pass so the in-flight DOM swap of "Load diff" → diff body doesn't make the second pass re-collapse what was just opened.
Test URLs
Screenshot