Skip to content

fix(file): stabilize closable tab width to avoid layout jitter - #14013

Merged
lan-yonghui merged 1 commit into
dev-v2from
pr@dev-v2@file-tabs-jitter
Oct 9, 2026
Merged

lan-yonghui merged 1 commit into
dev-v2from
pr@dev-v2@file-tabs-jitter

Conversation

@wanghe-fit2cloud

Copy link
Copy Markdown
Member

What this PR does / why we need it?

Clicking the tabs at the top of File Management made the whole page jitter slightly. Element Plus card tabs animate the close icon width between active and inactive tabs (width: 0 → 14px), so every tab switch/hover reflows the tab bar.

Summary of your change

  • Keep the close icon slot reserved (14px) for closable tabs and toggle it with opacity/pointer-events instead of animating the width
  • Pin the item padding so active/hover do not change the tab width
  • Keep focus-within and touch-device (hover: none) support, matching the existing implementation in the terminal tabs (views/terminal/terminal/index.vue)

No behavior change besides the tab bar no longer reflowing; prettier and eslint pass.

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

The closable card tabs animated the close icon width between active and inactive tabs, so each tab switch reflowed the tab bar and caused the page to jitter. Reserve the close icon slot and toggle it with opacity instead, matching the terminal tab implementation.
@lan-yonghui
lan-yonghui merged commit f22df4b into dev-v2 Oct 9, 2026
3 checks passed
@lan-yonghui
lan-yonghui deleted the pr@dev-v2@file-tabs-jitter branch October 9, 2026 09:16
xiaomeinvG pushed a commit that referenced this pull request Oct 9, 2026
The closable card tabs animated the close icon width between active and inactive tabs, so each tab switch reflowed the tab bar and caused the page to jitter. Reserve the close icon slot and toggle it with opacity instead, matching the terminal tab implementation.
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