Skip to content

fix(web): move command palette list a page at a time with PageUp/PageDown - #6155

Closed
Falkesand wants to merge 1 commit into
pingdotgg:mainfrom
Falkesand:fix/palette-page-keys
Closed

Falkesand wants to merge 1 commit into
pingdotgg:mainfrom
Falkesand:fix/palette-page-keys

Conversation

@Falkesand

@Falkesand Falkesand commented Aug 11, 2026 •

Copy link
Copy Markdown

What Changed

  • PageUp and PageDown now move the highlighted row in command palette lists by one screenful instead of doing nothing.
  • Only vertical single-column lists are handled. A grid (cols > 1) or a horizontal list keeps the key's default behaviour, so no key is swallowed where a straight-line jump would land in an unrelated column.
  • The step is measured from the laid-out positions of the rows rather than by summing row heights, so group headings, separators, margins and gaps all count towards a screenful.
  • The highlight stops on the first and last row instead of wrapping around.

The behaviour is added by a patch on @base-ui/react, registered the same way as the other patches in patches/. Base UI owns the list navigation and has no case for the page keys, and its public API exposes no way to set the highlighted index: onItemHighlighted only reports changes, and actionsRef carries just unmount. Both the ESM and CommonJS builds that ship in the package are patched, so every bundle gets the same behaviour.

Why

The folder list in the "New project" dialog is the clearest case. It lists every directory in the current path, so it is routinely longer than the popup, and the only way through it was one arrow press per row. The other dialogs built on the same palette (file picker, project content search, favicon picker) had the same gap.

Home and End already work, so the page keys were the only missing step size.

Reported as #6159.

UI Changes

No visual change; this is keyboard behaviour only.

Measured on the "New project" folder list with 31 folders, a 330px list viewport and 32px rows, so one page is 10 rows:

Key Highlighted row
ArrowDown 0
PageDown 10 -> 20 -> 30
PageDown at the end stays on 30
PageUp 20 -> 10 -> 0
PageUp at the start stays on 0

The highlighted row was scrolled into view at every step. Checked on Windows in the dev build, both with real key presses and with dispatched key events.

Measured again on a two-group list (Actions and Projects, nine rows, one 28px heading between the groups, same 330px viewport) to check that headings count: summing row heights gives a step of nine rows, measuring positions gives eight. The eighth row is the one the heading pushes off screen.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI changes are not applicable - no visual change, keyboard behaviour only
  • I included a video for animation/interaction changes - not included; the behaviour is described with measured row indices above

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10352019-fe09-478d-8fef-35db3c823e3e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 11, 2026
Comment thread patches/@base-ui__react@1.5.0.patch Outdated
Comment thread patches/@base-ui__react@1.5.0.patch
…Down

Pressing PageUp or PageDown in a command palette list did nothing, so the
folder list of the "New project" dialog could only be walked one arrow press
at a time.

The list navigation comes from Base UI, which has no case for the page keys,
and its public API exposes no way to set the highlighted index. The behaviour
is added by a patch on the dependency: in a vertical single-column list, the
highlight moves to the item one screenful away, measured from the laid-out
positions of the items so headings and gaps count, and stops at the first and
last item instead of wrapping. A grid or a horizontal list keeps the key's
default behaviour.
@Falkesand
Falkesand force-pushed the fix/palette-page-keys branch from e0724a1 to c20d07d Compare August 11, 2026 12:16
@macroscopeapp

macroscopeapp Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new keyboard navigation behavior (PageUp/PageDown) to the command palette via a patch to @base-ui/react. As a runtime behavior change from a first-time contributor that patches a third-party dependency, it warrants human review to verify the implementation approach and ensure no unintended side effects.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg

t3dotgg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

This implements PageUp and PageDown by carrying a 236-line local Base UI patch in both ESM and CommonJS files. The optional navigation change does not justify maintaining that dependency patch.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotgg t3dotgg closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants