Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
d35a9fd to
619fd5e
Compare
Collaborator
Author
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.


#3129 inspired me to add a couple more features to the quick actions menu, which in turn inspired a big refactor to avoid problems with possible duplicate entries. I also added a bunch of e2e tests that we probably should have had before.
New features
ctrl+n/ctrl+pkeyboard navigation (in addition to arrow keys)2026-03-17-quick-actions-breadcrumbs.mp4
Refactor
The old store held a flat list of
QuickActionItem.console/app/ui/lib/ActionMenu.tsx
Lines 22 to 28 in 751a80e
valuethere is the text label displayed in the UI and (problematically) is also meant to uniquely identify the item. When calling pages (e.g., the project layout and the instance list page) calleduseQuickActionswith a list of items,useQuickActionscalledaddActions, which deduped the list of items based onvalue. The problem is that items with the samevaluein different groups could collide — removing by value would remove items you didn't meant to remove. We had aninvariantcall making sure the values were unique, but this is actually pretty bad in hindsight because it's probably possible for a user to name something to create a duplicate. (In practice we probably avoided this because all user-settable names are lower-case and all our nav items have upper case letters.)In any case, the new breadcrumbs feature added a new source of items that could potentially be a duplicate with something else in the list. That is what prompted me to get rid of the deduping mechanism altogether. The new store is a
Map<string, QuickActionItem[]>keyed by an ID for each calling page, so registration is justmap.set(id, items)and cleanup ismap.delete(id). Deduping is unnecessary because each source component owns its own slot. In theory each source is responsible for deduping its items, but the way the item lists are constructed, this is never really a problem. And if a duplicate sneaks in, it doesn't actually matter.Finally, since I was already messing everything up, I changed
QuickActionItemto take both link and callback items, like we do for menu items. They're almost all links — only a few modal-opening actions are not.