Skip to content

fix: #5581 preserve tab bar visibility when opening tabs - #5907

Merged
Jocs merged 2 commits into
developfrom
fix/5581-preserve-tabbar-visibility
Oct 27, 2026
Merged

Jocs merged 2 commits into
developfrom
fix/5581-preserve-tabbar-visibility

Conversation

@Jocs

@Jocs Jocs commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Closes #5581

Summary

Hiding the tab bar was undone when opening a second regular file after closing tabs down to one or zero. The open path forced showTabBar to true whenever one tab already existed, overwriting the user's choice and checking the View menu item again.

Remove automatic tab bar activation when opening files, creating untitled tabs, and opening or revealing project folders. Keep the existing visibility boolean and session persistence; users control visibility through Toggle Tabbar. Update UI test fixtures that exercise visible tabs to explicitly enable the tab bar.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added: close down to zero/one tabs and reopen files, create a tab through the File menu, open a folder, manually show the bar again, and verify menu checkbox consistency.
  • Manually tested on: automated Electron tests on macOS; no manual platform testing.
  • pnpm run lint (0 errors; 187 existing warnings)
  • pnpm run typecheck
  • pnpm run build:unpack
  • Targeted Vitest suites: project-open-clears-selection, listen-for-main, project-multi-root-store (12 tests)
  • Playwright suites: issue-5581-tabbar-visibility, layout-toggles, issue-2395-preview-tabs, tabs (23 tests)
  • Additional Playwright suites: document-outline, toc-scroll, sidebar-auto-reveal-528 (16 tests)

Notes for reviewers

No additional preference or state is introduced. Since automatic activation is removed, a hidden tab bar also stays hidden when the user opens multiple files for the first time. The existing View toggle remains available to show it.

Screenshots (automated Electron run on macOS)

After opening two files, hiding the tab bar, closing the second file, and reopening it, both files remain open and the bar stays hidden:

Two files remain open after reopening, with the tab bar still hidden

Turning Toggle Tabbar on explicitly shows the same two tabs:

The same two tabs are visible after manually enabling Toggle Tabbar

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5907:

Run: https://github.com/marktext/marktext/actions/runs/40464140639

Artifact Size Link
marktext-linux-x64 669.7 MB Download
marktext-macos-x64 314.3 MB Download
marktext-windows-x64 299.7 MB Download
marktext-macos-arm64 301.0 MB Download
marktext-linux-arm64 523.6 MB Download
marktext-windows-arm64 291.5 MB Download

@Jocs
Jocs merged commit 61e51b3 into develop Oct 27, 2026
13 checks passed
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.

[Bug] "Toggle Tabbar" state resets to on after opening more than one file

1 participant