Skip to content

feat: allow inactive tabs to shrink when space is limited - #482

Merged
feigeCode merged 1 commit into
feigeCode:mainfrom
keenser:tab-shrink
Oct 29, 2026
Merged

feigeCode merged 1 commit into
feigeCode:mainfrom
keenser:tab-shrink

Conversation

@keenser

@keenser keenser commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Description

When the tab bar runs out of horizontal space, it currently just keeps every tab at a fixed width and scrolls. This makes the content of inactive tabs unnecessarily cut off and forces scrolling even when there is plenty of screen space to show more tabs at once.

This PR lets inactive tabs shrink down to TAB_MIN_WIDTH (flex-shrink) so more tabs fit on screen before the bar starts to scroll — similar to SecureCRT behavior. The active tab and the tab currently being renamed always keep their full width so the user is never forced to work with a cramped active tab.

Key changes in crates/core/src/tab_container.rs:

Added tab_keeps_full_width(is_active, is_renaming) helper deciding whether a tab may shrink.
Replaced the unconditional .flex_shrink_0() on each tab with conditional .flex_shrink_0()/.flex_shrink_1() based on keep_full_width.
Added a unit test covering the shrink logic and the resulting flex classes.

Screenshot

Before After
image image

How to Test

Open a window with many tabs until the tab bar overflows, then verify:

  • Inactive tabs shrink to TAB_MIN_WIDTH before the bar starts scrolling.
  • The active tab keeps its full width.
  • A tab being renamed keeps full (readable) width while the rename input is open.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

Implement flex shrinking for inactive tabs to prevent tab bar overflow,
similar to SecureCRT behavior. Active and renaming tabs always keep
full width.
@feigeCode
feigeCode merged commit f0c2518 into feigeCode:main Oct 29, 2026
8 checks passed
feigeCode added a commit that referenced this pull request Oct 31, 2026
冲突解决:main/src/home/home_tabs.rs 保留三产品拆分布局,快捷键复制改走
TabContainer::duplicate_active_tab(等价 #483:与标签菜单共用复制路径,终端保留当前工作目录,
并对任何可复制标签生效),复制出的终端标签在 main/src/home_tab/lifecycle.rs 补回
OpenSftp / SaveAsConnection 订阅;随之删除不再被使用的 ShellExtras::duplicate_terminal_tab 契约。

origin/main 上的 #482 / #483 / #484 其余改动(标签收缩、Esc 只在编辑器上下文生效、
terminal 测试隔离)均无冲突合入。

顺带修 main/src/home/home_tabs.rs 里 notify_unsupported 的属性与文档注释空行(clippy 告警)。
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.

2 participants