phase3-2: multi-tab preview (re-opened after base branch deletion)#76
Merged
baochipham942-eng merged 4 commits intomainfrom Apr 23, 2026
Merged
phase3-2: multi-tab preview (re-opened after base branch deletion)#76baochipham942-eng merged 4 commits intomainfrom
baochipham942-eng merged 4 commits intomainfrom
Conversation
Introduces PreviewTab in appStore with per-tab content/savedContent/ mode/lastActivatedAt/isLoaded. Replaces previewFilePath with previewTabs + activePreviewTabId. openPreview becomes a dedup-and- activate action, so clicking the same artifact twice focuses the existing tab instead of re-opening. PreviewPanel now reads editor state from the active tab (content, saved content, mode) and writes back via store actions (updatePreviewTabContent, updatePreviewTabMode, markPreviewTabLoaded, markPreviewTabSaved). Transient UI state (isLoading/isSaving/error/ isMaximized/isExporting) stays in the component. No visible UI change yet: the tab bar arrives in the next commit. But content state is now preserved across future tab switches because it lives in the store rather than component-local useState. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds PreviewTabs.tsx rendering one row per open file above the panel header. Clicking a tab activates it, X or middle-click closes it, and the dirty indicator (amber dot) surfaces unsaved edits. closePreviewTab in the store already picks the next most-recently-activated tab as successor and hides the panel when the last tab closes. With commit d043d2f's per-tab content state, tab switching now preserves edit buffers — switching away from a markdown tab with unsaved changes and coming back keeps the draft intact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Opening a 9th file now evicts the least-recently-activated tab. lastActivatedAt switches from Date.now() to a monotonic counter so rapid same-tick activations don't collide in MRU ordering. Adds 7 unit tests covering dedup-by-path, LRU eviction, MRU successor on close, panel hide on last-close, and the load/save content lifecycle (markPreviewTabLoaded / markPreviewTabSaved). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
QuickFileActions and FileResultDisplay both gated the "Open preview" button behind an isHtml-only check, so clicking a.md / c.ts / d.csv fell through to the OS default app. PreviewPanel already renders markdown and csv/tsv via dedicated panes (Phase 2), so the UI was the bottleneck. Introduces src/renderer/utils/previewable.ts as the single source of truth for "what PreviewPanel can render cleanly" (md/mdx/markdown, csv/tsv, html/htm, txt). ToolCallDisplay's two file-action surfaces now use isPreviewable() instead of the narrow isHtml check. ts/tsx/jsx/json/yaml are intentionally out of scope — they need the CodeMirror editor from Phase 3.3 to be usefully rendered. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Replaces #72 (auto-closed when its base branch `phase3-multi-preview` was deleted after #71 merged).
Content identical to #72 — Phase 3.2 multi-tab preview panel: tab-aware appStore model, PreviewTabs UI, LRU eviction at MAX=8, and extending in-app preview to md/csv/tsv/txt.
See #72 for original description. All commits preserved.