[codex] Fix workspace preview layout#39
Conversation
There was a problem hiding this comment.
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/showInspectorcontrols 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
3dmoltype 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.
|
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. |
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.tsxnpm run typechecknpm run buildSplit Audit
codex/research-memory.