refactor(app): split the workspace header menu per form factor
Wide layouts make tabs from the tab strip's + menu, so the header menu listing new agent / new terminal / new browser duplicated it. Compact has no tab strip, so those actions have to live in the header there. One menu with an isMobile prop could not express that: the prop only sized the trigger, and the item list was shared. Two components now, with the workspace actions (import, copy path, copy branch name, show setup) in one component both render from the same callbacks so they cannot drift.
This commit is contained in:
@@ -26,6 +26,15 @@ when you have actually looked at it on a phone.
|
||||
`ContextMenu` is the exception: it defaults to `compactMode="sheet"` and enables native long press.
|
||||
Disable mobile triggering explicitly on draggable rows, where long press belongs to drag instead.
|
||||
|
||||
## When the items differ per form factor
|
||||
|
||||
A menu whose contents depend on what else is on screen gets one component per surface, not one
|
||||
component with `isMobile` branches inside it. The workspace header menu is the example
|
||||
(`packages/app/src/screens/workspace/workspace-header-menu.tsx`): compact has no tab strip, so it
|
||||
carries new-tab actions, while wide leaves those to the strip's `+` menu and lists workspace
|
||||
actions only. Items both surfaces share live in one component that each menu renders, from the same
|
||||
callbacks, so the two can't drift.
|
||||
|
||||
## Selecting an item on iOS
|
||||
|
||||
An item that closes the menu runs its action after a fixed grace period on iOS, not immediately:
|
||||
|
||||
Reference in New Issue
Block a user