-
Notifications
You must be signed in to change notification settings - Fork 11
[codex] improve mobile workspace UX #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,7 @@ import { type ComponentType, type LazyExoticComponent, lazy, Suspense } from "re | |||||||||||||
| import { ContextMenu, ContextMenuTrigger } from "#/components/ui/context-menu"; | ||||||||||||||
| import { Spinner } from "#/components/ui/spinner"; | ||||||||||||||
| import { WorkspaceItemActionsContextMenuContent } from "#/features/workspaces/components/WorkspaceItemActionsMenu"; | ||||||||||||||
| import { useWorkspaceViewCapabilities } from "#/features/workspaces/components/workspace-view-policy"; | ||||||||||||||
| import { getWorkspaceItemDisplay } from "#/features/workspaces/model/item-display"; | ||||||||||||||
| import type { WorkspaceItem } from "#/features/workspaces/model/types"; | ||||||||||||||
| import { | ||||||||||||||
|
|
@@ -44,20 +45,26 @@ export default function WorkspaceFileViewer({ | |||||||||||||
| }: WorkspaceFileViewerProps) { | ||||||||||||||
| const descriptor = resolveWorkspaceFileTypeFromItem(item); | ||||||||||||||
| const Viewer = descriptor ? workspaceFileViewers[descriptor.assetKind] : null; | ||||||||||||||
| const viewCapabilities = useWorkspaceViewCapabilities(); | ||||||||||||||
| const viewerContent = Viewer ? ( | ||||||||||||||
| <Suspense fallback={<WorkspaceFileViewerSkeleton />}> | ||||||||||||||
| <Viewer item={item} toolbarSlotId={toolbarSlotId} workspaceId={workspaceId} /> | ||||||||||||||
| </Suspense> | ||||||||||||||
| ) : ( | ||||||||||||||
| <div className="flex h-full items-center justify-center bg-background"> | ||||||||||||||
| <WorkspaceUnsupportedFilePlaceholder item={item} /> | ||||||||||||||
| </div> | ||||||||||||||
| ); | ||||||||||||||
|
|
||||||||||||||
| if (!viewCapabilities.contextMenus) { | ||||||||||||||
| return <div className="h-full min-h-0 overflow-hidden">{viewerContent}</div>; | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+59
to
+61
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| return ( | ||||||||||||||
| <div className="h-full min-h-0"> | ||||||||||||||
| <ContextMenu> | ||||||||||||||
| <ContextMenuTrigger render={<section className="h-full min-h-0 overflow-hidden" />}> | ||||||||||||||
| {Viewer ? ( | ||||||||||||||
| <Suspense fallback={<WorkspaceFileViewerSkeleton />}> | ||||||||||||||
| <Viewer item={item} toolbarSlotId={toolbarSlotId} workspaceId={workspaceId} /> | ||||||||||||||
| </Suspense> | ||||||||||||||
| ) : ( | ||||||||||||||
| <div className="flex h-full items-center justify-center bg-background"> | ||||||||||||||
| <WorkspaceUnsupportedFilePlaceholder item={item} /> | ||||||||||||||
| </div> | ||||||||||||||
| )} | ||||||||||||||
| {viewerContent} | ||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||
| </ContextMenuTrigger> | ||||||||||||||
| <WorkspaceItemActionsContextMenuContent | ||||||||||||||
| item={item} | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.