🐛 fix(tabs): 修复短连接标签占用固定间距

- 将连接标签由固定 flex 基准改为按内容宽度收缩
- 保留 92px 最大宽度以避免长连接名称撑开标签
- 增加短连接名称间距回归测试
This commit is contained in:
Syngnat
2026-07-13 17:28:33 +08:00
parent 509962a773
commit ef0845a9c5
2 changed files with 9 additions and 1 deletions

View File

@@ -310,6 +310,13 @@ describe('TabManager hover info', () => {
expect(source).not.toContain('gn-v2-main-tabs-rich');
});
it('keeps short secondary connection labels content-sized', () => {
const css = readFileSync(new URL('../v2-theme.css', import.meta.url), 'utf8');
expect(css).toMatch(/\.gn-v2-tab-label-part-connection \{[^}]*flex: 0 1 auto;[^}]*max-width: 92px;/s);
expect(css).not.toMatch(/\.gn-v2-tab-label-part-connection \{[^}]*flex: 0 1 92px;/s);
});
it('wires hover card tab-switch and drag-blocking handlers with selectable text styles', () => {
const source = readFileSync(new URL('./TabManager.tsx', import.meta.url), 'utf8');

View File

@@ -3626,7 +3626,8 @@ body[data-ui-version="v2"] .gn-v2-tab-label-part-object {
}
body[data-ui-version="v2"] .gn-v2-tab-label-part-connection {
flex: 0 1 92px;
flex: 0 1 auto;
max-width: 92px;
color: var(--gn-fg-2);
font-family: var(--gn-font-mono);
font-weight: 700;