Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 887be0f779
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <WorkspaceCommandButton | ||
| command={WorkspaceCommand.ClosePreview()} | ||
| type="button" | ||
| className={uiStyles.button} | ||
| onClick={() => dispatch(projectActions.closePreview({ projectId }))} | ||
| > | ||
| {closePreviewBinding.description} | ||
| </ShortcutButton> | ||
| /> |
There was a problem hiding this comment.
Avoid workspace-only button in shared preview layout
ProjectPreviewLayout is used by both workspace and branches pages, but this new close button now depends on WorkspaceCommandRuntimeContext via WorkspaceCommandButton. The branches page (routes/project/$id/branches/route.tsx) does not provide that context, so if fullscreen preview is open when this layout renders there, assert(use(WorkspaceCommandRuntimeContext)) throws and crashes the page. This shared layout should keep a context-free close action (or receive a handler via props) instead of hard-binding to workspace runtime.
Useful? React with 👍 / 👎.
| <header className={styles.topBar}> | ||
| <ProjectSelect /> | ||
| {projectMatch && <TopBarActions />} | ||
| {projectMatch && <div className={styles.topBarActions} ref={actionsRef} />} | ||
| </header> |
There was a problem hiding this comment.
Keep preview controls mounted for all project routes
This replaces root-level preview toggles with an empty portal mount, but only the workspace route now fills that portal (PositionedTopBarActions in workspace/route.tsx). Other project routes like branches still use ProjectPreviewLayout and shared layout state, so they lose any UI to toggle preview/fullscreen. A concrete regression is navigating to branches with preview hidden in state: there is no control there to reopen it until returning to workspace.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR introduces a command-based abstraction for the Lite workspace, centralizing shortcut handling and wiring UI controls (buttons/menu items) through a shared WorkspaceCommand runtime.
Changes:
- Add
WorkspaceCommandtagged-enum +useRunWorkspaceCommandto execute commands from shortcuts and UI elements. - Refactor workspace shortcuts to emit commands (instead of bespoke action unions) and provide scope metadata (
label,allowWhenTyping). - Replace prior “ShortcutButton” patterns with a generalized
CommandButton, plus workspace-specific command button/menu item components; add a top-bar actions portal.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/lite/ui/src/ui.module.css | Adds styling for displaying shortcut key hints. |
| apps/lite/ui/src/shortcuts.ts | Simplifies shortcut binding generics; removes old helper types/label builder. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceShortcuts.ts | Refactors workspace shortcut scopes to produce/dispatch WorkspaceCommands. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommands.ts | New command model + executor hook for workspace actions/mutations. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommandRuntime.tsx | New context to share { runCommand, scope } across workspace UI. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommandMenuItem.tsx | New menu-item renderer that runs a workspace command and shows shortcut keys. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommandButton.tsx | New button wrapper that runs a workspace command and forwards shortcut keys to tooltips/aria-labels. |
| apps/lite/ui/src/routes/project/$id/workspace/route.tsx | Wires command runtime into workspace route; converts many UI actions to commands; adds top-bar actions + shortcut bar label handling. |
| apps/lite/ui/src/routes/project/$id/workspace/OperationTooltip.tsx | Switches operation-mode controls to command buttons. |
| apps/lite/ui/src/routes/project/$id/workspace/OperationTargets.tsx | Simplifies operation target controls to a boolean “controls present” flag. |
| apps/lite/ui/src/routes/project/$id/workspace/OperationSource.ts | Exports operationSourceIdentityKey for command identity keys. |
| apps/lite/ui/src/routes/project/$id/TopBarActions.tsx | Adds portal context/component for rendering route-provided top-bar actions. |
| apps/lite/ui/src/routes/project/$id/ShortcutsBar.tsx | Updates shortcut bar typings/label handling to match new scope model. |
| apps/lite/ui/src/routes/project/$id/ProjectPreviewLayout.tsx | Replaces close-preview control with a workspace command button. |
| apps/lite/ui/src/routes/__root.tsx | Reworks top bar to host a portal target instead of owning workspace preview buttons. |
| apps/lite/ui/src/CommandButton.tsx | Replaces old shortcut-button behavior with a generic command button + tooltip/aria-label formatting. |
apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommandMenuItem.tsx
Show resolved
Hide resolved
| > | ||
| <Dialog.Portal> | ||
| <Dialog.Popup aria-label="Preview" className={sharedStyles.previewDialogPopup}> | ||
| <div className={sharedStyles.previewDialogBody}> | ||
| <ShortcutButton | ||
| binding={closePreviewBinding} | ||
| <WorkspaceCommandButton | ||
| command={WorkspaceCommand.ClosePreview()} | ||
| type="button" | ||
| className={uiStyles.button} | ||
| onClick={() => dispatch(projectActions.closePreview({ projectId }))} | ||
| > | ||
| {closePreviewBinding.description} | ||
| </ShortcutButton> | ||
| /> |
There was a problem hiding this comment.
ProjectPreviewLayout is used by other routes (e.g. /project/$id/branches), but it now renders WorkspaceCommandButton, which hard-requires WorkspaceCommandRuntimeContext. Those routes don’t provide that context, so opening the fullscreen preview dialog will crash. Either keep this close-preview control wired directly to dispatch(projectActions.closePreview({ projectId })), or ensure a runtime provider is mounted for all ProjectPreviewLayout usages.
No description provided.