Repository navigation
feat(tabs): Tab Position setting with left, right and bottom docks - #963
Open
ryanhoggpm wants to merge 4 commits into
Open
ryanhoggpm wants to merge 4 commits into
ryanhoggpm wants to merge 4 commits into
Conversation
Adds a Tab Position setting (Top, Left Column, Right Column). With a column, the open documents are listed down one side of the window under the title bar, reusing TabList and Tab so the context menu, middle-click close and drag-to-reorder behave the same. The title bar shows the window title instead of the strip, the column is resizable, and the window tag colour runs along its inner edge. The default stays Top, so nothing changes for existing installs.
Tab Position gains Bottom: the same horizontal strip, docked along the bottom edge of the window instead of the title bar. TabColumn becomes TabDock, which handles the bottom strip and the side columns. Only a strip inside the title bar is a window drag region.
This reverts commit e1ab278.
- external-change-bar sits inside .content-area, so it spans the document instead of covering the column's first rows. - .content-area beside the column is absolute, not fixed: with no z-index it opens no stacking context, so the home page's context menu stacks above the column and title bar again. - the column resizer is a focusable separator with the outline handle's keys and its range in aria-valuemin/max. - settings.tabPlacement is the one answer the title bar and the column read.
Collaborator
|
Pushed two commits. I reverted the bottom position: #884 asks for a vertical list, and the bottom strip sat under toasts. In the column layouts the external-change bar covered the first tabs and the home page context menu landed under the column, because a fixed |
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.
What this is
A Tab Position setting (Settings > Appearance) with four values: Top, Bottom, Left Column and Right Column. Top is the default, so nothing changes for anyone who doesn't touch it.
Refs #884. The issue asks for a file sidebar; the comment there that it's "unlikely to be added" (pointing at #149) suggests the narrower version this PR implements: "an option to view the currently open files in the sidebar, basically a vertical list of tabs. The horizontal tab bar is difficult to navigate when many files are open."
Mechanism
There is no second tab implementation.
TabDock.sveltewraps the sameTabListandTabthe title bar uses, so the context menu, middle-click close, move to window / new window, duplicate-name folder suffixes and the window tag all come along unchanged.TabListtakes anorientationprop; the vertical case switches drag-to-reorder from the X axis to the Y axis and scrolls the active tab into view withoffsetTopinstead ofoffsetLeft. The nearest-slot math moved intoutils/tabReorder.tsso both orientations run the same function.The document is not re-laid out piece by piece. While a dock is shown,
MarkdownViewerwraps its content in a.content-areathat isposition: fixedand inset by the dock's width or height. The absolutely positioned.layout-container, the outline overlay and the home page then measure from the dock's edge without knowing about it. With Top selected,.content-areais an unstyled block, so the default layout is the same DOM and CSS as before.showTabsstill decides whether tabs are shown at all, so zen mode hides the dock through the same switch it already uses for the strip. Only a strip inside the title bar keepsdata-tauri-drag-region; the dock does not drag the window.The window tag line runs along the dock's inner edge (the column's side, or the bottom strip's top), drawn once for the whole dock, following the comment on
.tab-area.tagged::after.Scope
i18nCoverage.test.tsreports but doesn't fail on.Tests
settingsPersistence.spec.ts:editor.tabPositionround-trips all four values; unknown values (center,LEFT, empty) load astop;editor.tabColumnWidthis clamped toTAB_COLUMN_WIDTH_RANGEon load and on resize, and garbage loads as the default. A source-shape assertion pins the<select>options to exactly the valuesisTabPositionaccepts, since that's the one place the two lists can drift.tabReorder.test.ts: nearest slot along each axis, non-tab children skipped, and the drag threshold measured only along the layout axis.Verification
The two vitest failures are 5s timeouts in
diagramThemeRefresh.spec.tsandplatformSource.spec.ts. Both also time out on unmodifiedmasteron this machine (along withmonacoChordOwnership,monacoAltGraphandviewerKeymap), and both pass when run on their own.Manual run with
npm run tauri devon Ubuntu 24.04 under WSLg: all four positions; drag-reorder in the column and the bottom strip; column resize; outline pinned on the same side as the column and on the opposite side; zen mode on and off; the + button and tab context menu in each dock; edit-mode status bar sits above the bottom strip; settings survive a restart.Not verified: Windows and macOS at runtime, including the macOS traffic-light title bar with a dock shown.