refactor(panel): drop Preview/Code tab; preview-first chrome#5
Open
kleopasevan wants to merge 2 commits intomainfrom
Open
refactor(panel): drop Preview/Code tab; preview-first chrome#5kleopasevan wants to merge 2 commits intomainfrom
kleopasevan wants to merge 2 commits intomainfrom
Conversation
- removes the dual-tab affordance at the top of the artifact panel; preview is now the primary view for every artifact type - adds a single Edit pencil to the panel header (gated on onUpdateArtifact, hidden for text/document which keeps its renderer-internal pencil) - adds a discrete bottom-corner Source toggle for non-code, non-document types — matches the document-script-renderer pattern (Code/preview button at the bottom, not a top tab) - application/code drops the redundant Source toggle since its preview is already syntax-highlighted code - text/document keeps its existing controls (script: floating modal pencil; AST: read-only legacy banner) - removes tab state, the tab-bar JSX, and the useEffect that exited edit on tab switch
- "Spreadsheet · json" → "Spreadsheet"; "Slides · json" → "Slides"; etc. - language suffix is preserved only for application/code, where TS / Python / Rust is the actual differentiator - applies to two callsites: panel header pill and the artifacts-list entries in chat-workspace's right rail
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.
Summary
Brings the artifact panel in line with the slides + document-script renderers: preview is the primary view, no top tab pair, source-of-truth controls live at the panel edges instead of consuming a chrome row.
Before
After
onUpdateArtifact; hidden fortext/documentwhich keeps its internal modal-pencil; hidden during edit)document-script-renderer's Code/Preview toggle.application/codeno longer shows the Source toggle (preview already IS the highlighted code)text/documentkeeps its existing flow (script: floating pencil →EditDocumentModal; AST: legacy banner, read-only)Why
The Preview/Code tab pair was confusing for non-developers and inconsistent with the rest of the artifact stack. Slides and document-script never used tabs. This refactor adopts the established pattern: preview is the answer to the user's question, the source view is one click away but stays out of the way.
Test plan
artifact-panel.tsxtests/unit/features tests/unit/spreadsheet tests/unit/renderers