Skip to content

[codex] Fix workspace preview layout#39

Closed
ASIWU wants to merge 1 commit into
guifrom
codex/preview-bugfix
Closed

[codex] Fix workspace preview layout#39
ASIWU wants to merge 1 commit into
guifrom
codex/preview-bugfix

Conversation

@ASIWU

@ASIWU ASIWU commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the workspace preview panel layout so embedded preview shells can render without duplicate chrome, keep scrollable content bounded, and lazy-load the molecular viewer without pulling the full renderer into the default outlet path.

Scope

This PR only touches renderer workspace-preview files and the local 3dmol type shim needed by the preview fix. It intentionally excludes the research memory/project-extension runtime changes.

Validation

  • npx vitest run src/renderer/src/workspace-preview src/renderer/src/components/WorkspaceFilePreviewPanelBridge.test.tsx
  • npm run typecheck
  • npm run build

Split Audit

  • No files overlap with codex/research-memory.
  • Ignored build outputs were not committed or pushed.

@ASIWU
ASIWU marked this pull request as ready for review July 9, 2026 12:51
Copilot AI review requested due to automatic review settings July 9, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the renderer-side workspace preview layout to better support embedded previews by removing duplicate chrome, tightening overflow/scroll behavior, and deferring molecular viewer loading so the heavier renderer code path isn’t pulled into the default outlet.

Changes:

  • Added showHeader / showInspector controls to preview chrome and shell so embedded previews can suppress duplicate UI.
  • Updated preview viewer layouts to use bounded flex/overflow patterns (and adjusted tests accordingly).
  • Lazy-loaded the molecular viewer route in the plugin outlet and added a local 3dmol type shim to support the molecular preview path.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/renderer/src/workspace-preview/WorkspacePreviewPluginOutlet.tsx Adds a lazy-load route for the molecular viewer and a loader/error UI for the outlet.
src/renderer/src/workspace-preview/WorkspacePreviewPanelShell.tsx Plumbs showHeader/showInspector into the chrome and constrains shell body overflow.
src/renderer/src/workspace-preview/WorkspacePreviewChrome.tsx Makes header/inspector optional and adjusts container/body layout for bounded scrolling.
src/renderer/src/workspace-preview/TextWorkspaceViewer.tsx Adds optional header rendering and fixes flex/overflow so the editor stays bounded.
src/renderer/src/workspace-preview/TextWorkspaceViewer.test.ts Adds coverage for embedded “no header” rendering and new layout classes.
src/renderer/src/workspace-preview/plugin-outlet.test.tsx Updates molecular outlet marker expectations to the new loader state element.
src/renderer/src/workspace-preview/MarkdownWorkspaceViewer.tsx Prevents nested scroll issues, embeds text viewer without header, and bounds grid overflow.
src/renderer/src/workspace-preview/MarkdownWorkspaceViewer.test.ts Updates assertions for new bounded overflow behavior and embedded text header removal.
src/renderer/src/workspace-preview/chrome.test.ts Updates assertions to reflect new overflow/layout class usage.
src/renderer/src/types/3dmol.d.ts Introduces a minimal module declaration to satisfy TypeScript for import('3dmol').
src/renderer/src/components/WorkspaceFilePreviewPanelBridge.tsx Embeds the preview shell with header/inspector disabled and tightens overflow/no-drag behavior.
src/renderer/src/components/WorkspaceFilePreviewPanelBridge.test.tsx Updates mock/expectations for new shell props and class composition.
src/renderer/src/components/Workbench.tsx Adjusts right panel container padding when the file preview panel is shown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gaozhangyang

Copy link
Copy Markdown
Contributor

Closing as superseded by the current gui workspace-preview architecture. We are carrying forward only the small, still-relevant pieces separately: bounded inner overflow for Markdown/Text viewers and a ds-no-drag boundary on the file-preview bridge. The legacy header/inspector controls, 3Dmol shim, Workbench inset, wheel interception, and old molecular lazy-loader implementation are not being merged.

@gaozhangyang
gaozhangyang deleted the codex/preview-bugfix branch July 14, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants