Added Preview Pane - #23
Merged
Merged
Conversation
ColeHunt
added a commit
to ColeHunt/scriptum
that referenced
this pull request
Sep 19, 2026
…ane architecture Upstream (mathewdunne/CodeRunner) added a Preview pane - reads project Markdown/HTML reports beside the editor - bundled with a full rework of its own tab-switcher pane system. This fork replaced that tab-switcher with independent multi-toggle panes back in a267b27, so a literal merge would have resurrected the tab paradigm this fork deliberately moved away from. Ported instead: kept the actual Preview feature (backend routes, PreviewPane component, document-discovery hook, security-isolation tests) verbatim, and wired it into PaneVisibility.tsx/IDELayout.tsx/ Topbar.tsx as a fifth independent pane (scope/choreo/elastic/preview), not a tab. Dropped entirely (upstream-specific, doesn't apply here): - SimPaneSwitcher.tsx/usePaneVisibility.ts/LayoutMenu.tsx - upstream's tab-switcher + collapse-menu rework. This fork's own PaneToggleRow/ PaneVisibility.tsx already solve the same problem differently. - deploy-files.ts and its routes/metrics - "PathPlanner (deploy files)" endpoints for a tool this fork removed in the Choreo migration (f69b50a). Confirmed zero other references before excluding it. - better-auth dependency - only used by upstream's own main.ts, which this fork replaced with Legion SSO; not referenced by anything ported. - docs/decisions/042-collapsible-workspace-panes.md - describes the not-adopted tab/collapse UI; would misrepresent this fork's actual design if kept. Also collided with this fork's own existing 042 (Choreo integration) and 041 (Elastic Dashboard) - project-preview.md renumbered 041 -> 050, all cross-references updated. Real bug found and fixed along the way: preview.ts/preview-token.ts referenced storage.config.sessionSecret, which doesn't exist here - upstream's version is literally their better-auth library's own secret. Reusing this fork's ssoSecret would have been wrong (it's Legion's externally-shared secret, and can be null in demo mode). Added a proper dedicated previewTokenSecret to ControlConfig instead: always present (unlike ssoSecret), sourced from PREVIEW_TOKEN_SECRET with a documented local-dev fallback. Also fixed: e2e specs still using getByRole("tab", ...) locators against elements that don't exist in this fork's button-based toggle model (would have hung/failed on .click()) - repointed to getByRole("button", ...) in workflow.spec.ts and preview-isolation.spec.ts. Trimmed pane-layout.spec.ts's two new collapse/PathPlanner-specific tests (untestable here - the UI they exercise doesn't exist). Found and fixed a real duplicate data-pane="preview" attribute (both the IDELayout wrapper and PreviewPane's own root had it, which would break Playwright strict-mode locators) by keeping it only on the wrapper, matching how scope/choreo/elastic already work. Kept from upstream despite not being core to Preview: the DriverStation `visible` prop fix (releases stuck keyboard capture when the panel is hidden - a real bug, applies to this fork's own DS toggle too, though left unwired pending a cleaner way to thread PaneVisibility context into WorkspacePage's pre-render JSX construction) and a resize-handle styling polish (unrelated, harmless, kept). Verified: full typecheck clean across all 4 tsconfig projects, 506 control-plane tests pass, 165 web tests pass (24 files, including new PaneVisibility/IDELayout coverage for the preview pane), biome clean. E2E/Playwright specs adapted by static review only (not executed - no browser harness in this environment); flagged for a real run before relying on them. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a preview pane (alongside advantagescope and pathplanner in the right pane) with the ability to render READMEs, build reports, and any other .md or .html file in the project directory.
Added the ability to fully collapse any of the 3 panes, with layout settings under the user icon in the top right.
Closes #18 and #19