one-click-diff-options - Restore d w shortcut in PRs#9262
Conversation
| function isHidingWhitespace(): boolean { | ||
| // The selector is the native button | ||
| return new URL(location.href).searchParams.get('w') === '1' | ||
| || elementExists('button[name="w"][value="0"]:not([hidden])'); |
There was a problem hiding this comment.
GitHub no longer preserves the setting across loads. If the page doesn't have ?w=1 then whitespace changes are visible.
There's a minor "issue" where if you are on pull/123/changes?w=1 and click the "Files changed" tab, GitHub will remove the URL parameter. The page is not reloaded, so it doesn't really affect us since isHidingWhitespace already ran
| ); | ||
| } | ||
|
|
||
| function attachPrButtons(dropdown: HTMLDetailsElement): void { |
There was a problem hiding this comment.
the native popup is now fast enough
As someone who often switches between unified and split views, I disagree
There was a problem hiding this comment.
Keyboard shortcut time?
There was a problem hiding this comment.
Here is my unfinished commit that restores the feature: SunsetTechuila@21ebe55
There was a problem hiding this comment.
That's the problem with having open/unfinished work for months, it blocks others from working on issues
There was a problem hiding this comment.
Since it has substantial changes and we can drop the GHE version, I'd say I can merge this PR (since it does restore d w) and then you can take your time restoring the buttons cleanly on the new PR view
| const anchor = nativeDiffButtons.parentElement!; | ||
|
|
||
| // `usesFloats` is necessary to ensure the order and spacing as seen in #5958 | ||
| const usesFloats = anchor?.classList.contains('float-right'); |
There was a problem hiding this comment.
usesFloats is now always true, so I dropped the condition
There was a problem hiding this comment.
2022 me: "Can be dropped in 3 months" without leaving a comment 😅
one-click-diff-options - Restore shortcut in PRsone-click-diff-options - Restore d w shortcut in PRs



one-click-diff-optionsbroken #9232Test URLs
Shortcut only:
Button:
Tab
No tab
Disable style (unchanged)