Add split view to the Explorer (two panes side by side) - #517
Open
jaysuk wants to merge 2 commits into
Open
Conversation
Lets a pane be split into two independent tab strips with a draggable
divider, so two files (or a file and a directory listing) can be open
side by side - e.g. reference one macro while editing another.
Implementation keeps the existing flat `tabs` array and URL/drag/close
logic largely intact by annotating each tab with which pane (group) it
belongs to, rather than restructuring tabs into per-pane arrays:
- groups: [{ id, activeTabId }], capped at exactly two fixed ids so
there's nothing to grow or clean up
- setActiveTab() replaces direct activeTab.value writes and tracks
which pane last had focus (focusedGroupId), which the URL sync,
scroll-restore watcher, and new-tab placement all key off
- moveTabToGroup()/splitRight()/closeSplit() handle pane transitions,
reusing closeTab's fallback-tab selection logic
- Per-pane thumbnail fetchers (useGcodeThumbnails is single-flight)
so two panes browsing different /gcodes directories don't cancel
each other's fetch
- The non-focused pane collapses via CSS on narrow viewports rather
than unmounting, since MonacoEditor.dispose() has no unsaved-content
flush path
- Browser back/forward ordinal resolution is scoped to the focused
pane's own tabs so it can never reveal into or steal focus from the
other, non-focused pane
Divider drag mirrors the existing nav-drawer resize handle in
layouts/builtin.vue; the split ratio persists via a new
cacheStore.explorerSplitRatio field the same way menuWidth does.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two side-by-side tab strips need more room than the md threshold (840px) gives them on a typical tablet-width window; lg leaves the split controls and pane collapse gated on a genuinely wide viewport. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
|
recheck |
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
Adds a split view to the Explorer page: a pane can be split into two independent tab strips with a draggable divider between them, so two files (or a file and a directory listing) can be open side by side - e.g. reference one macro while editing another, or compare two config files.
cacheStore.explorerSplitRatio), mirroring the existing nav-drawer resize handle.lgbreakpoint the non-focused pane is hidden (not unmounted) and the split controls are hidden, so it degrades to the current single-pane behaviour on narrower viewports without losing state. (Originally gated onmd; raised tolgsince two side-by-side tab strips need more room than a typical tablet-width window gives them.)Implementation notes
tabsarray and its URL-sync/drag/close logic largely intact by annotating each tab with agroupId(which pane it's in), rather than restructuring into per-pane arrays.groupsis capped at exactly two fixed ids, so there's nothing to grow or clean up.setActiveTab()replaces directactiveTab.valuewrites and tracks which pane last had focus (focusedGroupId); the URL sync, scroll-restore watcher, and new-tab placement all key off it.moveTabToGroup()/splitRight()/closeSplit()handle pane transitions, reusing the existingcloseTabfallback-tab-selection logic so closing/moving the active tab in a pane always lands on a sensible sibling.useGcodeThumbnails()is single-flight internally, so it's now instantiated once per pane rather than once for the whole page - otherwise two panes browsing different/gcodesdirectories would cancel each other's fetch and share one progress bar.v-if, sinceMonacoEditor's unmount has no unsaved-content flush path - unmounting a dirty editor would silently lose the edits.Testing
vue-tsc --noEmitandnpm run buildboth pass, including after themd->lgbreakpoint change.md->lgchange; the collapse behaviour itself is unchanged, just the threshold it fires at, but it hasn't been re-run specifically againstlg./gcodesdirectories in split panes, and the dirty-editor-survives-a-resize case.🤖 Generated with Claude Code