Skip to content

feat(editor): add optional vertical tab layout - #1647

Merged
debba merged 2 commits into
TabularisDB:mainfrom
GoodGaming2511:feat/vertical-editor-tabs
Nov 23, 2026
Merged

debba merged 2 commits into
TabularisDB:mainfrom
GoodGaming2511:feat/vertical-editor-tabs

Conversation

@GoodGaming2511

@GoodGaming2511 GoodGaming2511 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1646

Change

Adds an Appearance setting, Editor tabs → Tab layout: Horizontal | Vertical.

  • Horizontal (default) is the existing tab bar, unchanged.
  • Vertical shows the open tabs as a list in a 14rem (224px) column on the left of the editor, directly to the right of the explorer. Long names are truncated at about the same width as horizontal tabs, and the tooltip shows the full name. The new console / open SQL file / visual query / notebook buttons sit in a row at the top of the column.

Everything the horizontal bar does works in both layouts: switching, closing (including middle-click), renaming, pinning, the context menu, loading and transaction indicators, the connection accent tint, and drag-to-reorder (the drop indicator, gap detection and edge auto-scroll now follow the active axis).

Implementation notes

  • To keep the diff small in Editor.tsx, the editor root gets relative plus left padding in vertical mode and the tab bar is positioned into that padding, rather than restructuring the page layout.
  • The four action buttons are wrapped in a display: contents container in horizontal mode, so that layout is unchanged.
  • In split view each pane renders its own Editor, so each pane gets its own tab column.
  • New tabLayout setting in SettingsContext.ts and the Rust AppConfig (plus its merge list), normalised by resolveTabLayout (unknown values fall back to horizontal).
  • Strings added to every locale. The non-English translations are AI-assisted, so native-speaker corrections are welcome.

Testing

  • An Editor render test for vertical mode (the tab column, and drag-to-reorder picking the gap from the vertical axis), unit tests for resolveTabLayout, an AppearanceTab test for the layout switch, and the persistence round-trip test extended with tabLayout.
  • pnpm lint, tsc -b, pnpm test (all pass), the Rust persistence test and cargo check --no-default-features.
  • Manually checked in pnpm tauri dev.

🤖 Generated with Claude Code


See it in action
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features
    • Added a setting to choose horizontal or vertical editor tabs. Vertical tabs appear along the left side, with controls above them.
    • Your tab layout preference is saved and restored, and drag-and-drop tab reordering works in either layout.
    • Setting labels and options are available in 14 languages.

Adds an Appearance setting, Tab layout (Horizontal | Vertical). Vertical
shows the editor's open tabs as a list down the left of the editor, to the
right of the explorer, with full names. Horizontal stays the default.

Switching, closing, renaming, pinning, the context menu, loading and
transaction indicators, the connection accent color and drag-to-reorder
all work in both layouts. Translated into every locale.

Refs TabularisDB#1646

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@kilo-code-bot

kilo-code-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

I read the incremental diff only. I did not run the tests or the app. The changes since the last review are a small Tailwind class addition in Editor.tsx that removes the first child's left border in vertical-tabs mode, plus a new test file.

Files Reviewed (2 files)
  • packages/web-ui/src/pages/Editor.tsx
  • packages/web-ui/tests/pages/EditorVerticalTabs.test.tsx
Previous Review Summary (commit a573cc7)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit a573cc7)

Status: No Issues Found | Recommendation: Merge

I read the diff only. I did not run the tests or the app.

Files Reviewed (22 files)
  • packages/web-ui/src/pages/Editor.tsx
  • packages/web-ui/src/components/settings/AppearanceTab.tsx
  • packages/web-ui/src/contexts/SettingsContext.ts
  • packages/web-ui/src/utils/tabLayout.ts
  • packages/web-ui/src/i18n/locales/*.json (13 locales)
  • packages/web-ui/tests/components/settings/AppearanceTab.test.tsx
  • packages/web-ui/tests/utils/tabLayout.test.ts
  • src-tauri/src/application/persistence.rs
  • src-tauri/src/application/persistence_tests.rs
  • src-tauri/src/config.rs

Reviewed by claude-sonnet-5.5 · Input: 3.6K · Output: 1.5K · Cached: 178.9K

Review guidance: REVIEW.md from base branch main

debba
debba previously approved these changes Nov 23, 2026

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, vertical tabs come up from time to time and it's nice to have them as an option! What I liked most is that drag-to-reorder really works on both axes: tabGapOffset, the before/after check, the edge auto-scroll and the drop indicator all switch on verticalTabs, and the useCallback deps were updated with them. The default path is handled carefully too: in horizontal mode the classes match main, the action buttons sit in a display: contents wrapper, the existing Editor tab tests pass unchanged, and resolveTabLayout turns any unknown stored value into horizontal.

Approving. I'll test it in the app before merging. A few things for a follow-up:

  1. The "full tab names" point in the description is a bit optimistic: the vertical column is w-56 (224px), and horizontal tabs already grow to max-w-[220px], so long names get cut at roughly the same width (the title tooltip still has the full name). A wider or resizable column would deliver that, otherwise I'd just tweak the description.
  2. In split view each pane renders its own Editor, so each one gets its own 224px column. With three panes that might get tight. I'll check it, but keep it in mind.
  3. There's no render test for vertical mode, only the resolver and the settings switch are covered. A small Editor test with tabLayout: 'vertical' would protect the axis switch in drag and drop.
  4. Cosmetic: in vertical mode the first action button keeps its border-l at the column edge.

Also a heads-up: this PR and #1645 add their settings at the same spots (AppearanceTab.tsx, SettingsContext.ts, config.rs, persistence.rs and the locales), so the second one to land will need a rebase.

… border

Add an Editor render test for tabLayout 'vertical': the tab column, and
drag-to-reorder picking the gap from the vertical axis (the same drag
lands on a different gap horizontally). In vertical mode the first action
button no longer draws a left border at the column edge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Editor Tab Layout

Layer / File(s) Summary
Define and persist the layout preference
packages/web-ui/src/contexts/SettingsContext.ts, packages/web-ui/src/utils/tabLayout.ts, packages/web-ui/src/components/settings/AppearanceTab.tsx, packages/web-ui/src/i18n/locales/*.json, src-tauri/src/config.rs, src-tauri/src/application/persistence.rs, src-tauri/src/application/persistence_tests.rs, packages/web-ui/tests/components/settings/AppearanceTab.test.tsx, packages/web-ui/tests/utils/tabLayout.test.ts
The settings and configuration add a horizontal-default tab-layout preference. The Appearance tab exposes horizontal and vertical choices with localized labels. Tests cover displayed and resolved values, and configuration tests include saving and reloading the vertical preference.
Render the vertical tab list
packages/web-ui/src/pages/Editor.tsx, packages/web-ui/tests/pages/EditorVerticalTabs.test.tsx
The editor uses the selected orientation to render the tab strip. Vertical mode places the list in a left-side column, changes tab styling and scrolling, and places creation controls above the list.
Handle vertical tab dragging
packages/web-ui/src/pages/Editor.tsx, packages/web-ui/tests/pages/EditorVerticalTabs.test.tsx
Drag calculations, insertion indicators, and edge auto-scrolling use the vertical axis in vertical mode. Tests check reorder indexes for vertical and horizontal layouts.

Suggested reviewers: wajrock, newtthewolf, lejyfps

Change: Feature

Merge Risk: Minimal · up to 2efb1

This adds an opt-in vertical editor tab layout; the horizontal layout stays the default. The persisted setting and drag behavior are covered by tests, and no merge-blocking risk is identified.

Security architecture risk: Minimal · up to 2efb1

The new preference changes where tabs appear and how they are reordered. Horizontal remains the default, and the change does not grant new access or change what existing editor actions can do.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A caller already able to save application settings can change the layout seen by other sessions when they load the same runtime configuration. This field is not session-local and does not change which connections or data a session can access.

Trust Boundaries and Controls

  • observed — Drop handling takes tab identity from the editor's own drag-start state, not from the incoming drag payload. The pointer coordinate selects a gap within the pinned or unpinned group, and drop or drag end clears transient drag state.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution timed out
Clippy (1.99.1) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d01da7f3-b95d-4915-a1a3-7c4d92562a24
Commits

Reviewing files that changed from the base of the PR and between a676f5a and 2efb156.

Files selected for processing: 23

  • packages/web-ui/src/components/settings/AppearanceTab.tsx
  • packages/web-ui/src/contexts/SettingsContext.ts
  • packages/web-ui/src/i18n/locales/de.json
  • packages/web-ui/src/i18n/locales/en.json
  • packages/web-ui/src/i18n/locales/es.json
  • packages/web-ui/src/i18n/locales/fr.json
  • packages/web-ui/src/i18n/locales/it.json
  • packages/web-ui/src/i18n/locales/ja.json
  • packages/web-ui/src/i18n/locales/ko.json
  • packages/web-ui/src/i18n/locales/pt-BR.json
  • packages/web-ui/src/i18n/locales/ru.json
  • packages/web-ui/src/i18n/locales/tl.json
  • packages/web-ui/src/i18n/locales/vi.json
  • packages/web-ui/src/i18n/locales/zh-TW.json
  • packages/web-ui/src/i18n/locales/zh.json
  • packages/web-ui/src/pages/Editor.tsx
  • packages/web-ui/src/utils/tabLayout.ts
  • packages/web-ui/tests/components/settings/AppearanceTab.test.tsx
  • packages/web-ui/tests/pages/EditorVerticalTabs.test.tsx
  • packages/web-ui/tests/utils/tabLayout.test.ts
  • src-tauri/src/application/persistence.rs
  • src-tauri/src/application/persistence_tests.rs
  • src-tauri/src/config.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@GoodGaming2511

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Follow-ups in 2efb156:

  1. Description corrected: names truncate at about the same width as horizontal tabs, and the tooltip has the full name. I kept the column at 224px for now. A resizable column could be a separate follow-up if people want one.
  2. Split view: noted in the description. Each pane gets its own column.
  3. Added tests/pages/EditorVerticalTabs.test.tsx. It covers the vertical column and a drag that picks a different gap vertically than horizontally. I checked that it fails when the drag-over is switched back to clientX.
  4. The first action button no longer draws its border-l at the column edge in vertical mode.

@debba

debba commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Tested this in the app with about a dozen tabs, a few with very long names. Names truncate and the full name is in the tooltip. Dragging up and down reorders on the right side of the target, and the column scrolls at the edge. Split view gives each pane its own column, and the setting survives a server restart. Horizontal tabs look the same as before. Merging, thanks!

@debba
debba merged commit 1c3e120 into TabularisDB:main Nov 23, 2026
6 checks passed
debba pushed a commit that referenced this pull request Nov 24, 2026
…classes

#1647 added Tailwind classes that the plugin guest stylesheet includes, so
the build:plugin-guest check failed on main and every open PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Optional vertical tab list for editor tabs (setting to switch horizontal/vertical)

2 participants