feat(ui): add command palette to admin dashboard#16798
Merged
Merged
Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
Memoize the cmd+K handler so the global keydown listener no longer re-subscribes every render, key the scroll-into-view effect on the active option id, clamp the active index during render instead of in an effect, and replace per-row indexOf with a memoized lookup map.
…nput divider Drop the navigate/close footer hints (keep open + create), close the palette when the backdrop around the panel is clicked, and replace the input's blue rounded focus outline with a straight muted bottom hairline.
The global :focus-visible rule applies a border-radius to the focused input, which rounded the ends of the new bottom hairline. Reset border-radius alongside the outline so the divider stays straight.
Mute the bottom hairline to 50% of --color-border via color-mix so it derives from the theme token and still flips for dark mode.
…s active The active-option auto-scroll called scrollIntoView on the option element, which aligned the option's top edge to the scroll container and clipped the group label sitting directly above it — so headers like "Favorites" vanished after scrolling down then back up. When the active option is the first in its group, scroll its group label into view instead so the header stays visible.
Opening the palette (or actions menu) under a stationary cursor fired a synthetic mouseenter that hijacked the keyboard's default selection. Use onMouseMove instead, which only fires on actual pointer movement.
Make the Enter/Select hint the leftmost footer action (was after Create new
on collection rows) and give it a primary treatment, strong weight and
full-strength text/key color, so the default action stands out.
Ported from 2d9c6ab; adapted to this branch's footer (no row-actions menu)
and named runAction intent ('navigate'/'create').
jacobsfletch
reviewed
Jun 1, 2026
jacobsfletch
reviewed
Jun 1, 2026
Member
Author
|
In the future, the |
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.
Overview
Initial functionality for Command Palette via cmd+k.
cmd/ctrl+Kopens itEnternavigates to collection/globalcmd+Entercreates new document for a collectionescor clicking outside closesEnter, and create a new document withcmd+Enter.CleanShot.2026-06-01.at.09.58.55.mp4
Video shows cmd+k trigger, collection filtering, Enter to navigate, and cmd+Enter to create
Key Changes
admin.group !== falseplus read permission) into a newisNavEntityVisibleutility inpackages/ui. Both the sidebar nav (groupNavItems) and the palette (buildActions) call it, so the two surfaces decide visibility from one definition instead of duplicated inline checks.Design Decisions
Enteris the primary action (open list / open global);cmd+Entercreates a new document, hinted inline on the active row and only when the user has create permission. Globals have no create action.useAuth().permissions. The palette and the sidebar nav share one visibility predicate (isNavEntityVisible), so the lists can't drift apart. The create shortcut is gated on create permission.RootProvider) lets the palette respectadmin.hidden/visibleEntities, so hidden entities never surface.packages/ui.Accepted limitations for this phase:
cmd/ctrl+Kdoes not open the palette while a drawer or modal is already open. This is a currentuseHotkeyedit-depth limitation, not specific to this feature.Overall Flow
sequenceDiagram participant User participant Hotkey as useHotkey participant Palette as CommandPalette participant Build as buildActions participant Filter as filterActions (fuzzyMatch) participant Router User->>Hotkey: cmd/ctrl+K Hotkey->>Palette: open Palette->>Build: config + permissions + visibleEntities Build-->>Palette: grouped actions (visibility via isNavEntityVisible) User->>Palette: type query Palette->>Filter: groups + query Filter-->>Palette: ranked actions with match indices User->>Palette: ArrowUp/Down, then Enter (or Cmd+Enter) Palette->>Router: push(formatAdminURL(...)) Palette->>Palette: closeFuture Changes
Not in scope for this PR but will be fast follows if this is merged in: