Skip to content

fix(desktop): preserve workbar tab scrollbar behavior - #5204

Open
colaforniaw wants to merge 1 commit into
apache:mainfrom
colaforniaw:fix/workbar-tab-scrollbar-cleanup
Open

fix(desktop): preserve workbar tab scrollbar behavior#5204
colaforniaw wants to merge 1 commit into
apache:mainfrom
colaforniaw:fix/workbar-tab-scrollbar-cleanup

Conversation

@colaforniaw

@colaforniaw colaforniaw commented Sep 11, 2026

Copy link
Copy Markdown

Summary

The app's global scrollbar default was a * rule in layer(components). A universal selector is an element-level declaration, so it competes by cascade layer — and components out-ranks astryx-components. That silently overrode the scrollbar-width: none Astryx's TabList sets on its overflow strip, re-showing a persistent bar under the Session Workbar tabs and nudging them off vertical center (a classic bar takes layout height).

Keep the universal scrollbar default, because scrollbar-width is not inherited and nested app scrollports must remain thin, but move the standard properties and the existing WebKit capsule recipe into the existing @layer base block in maka-tokens.css. The later Astryx and product component layers can then own exceptions on their elements: the TabList strip's none wins while ordinary nested scrollports retain the app-wide thin default. Keeping the WebKit rules preserves the established capsule thumb, transparent gutter, and hover treatment; this PR changes their cascade layer, not the app's scrollbar visual baseline.

Refs #2538

82be2cfc94b13d30ca1f173cebd7d2e3

Verification

  • npm run lint, npm run format:check, npm --workspace @maka/desktop run typecheck, npm --workspace @maka/desktop run check:architecture, and npm run check:asf-headers pass.
  • The Storybook build and targeted workbar smoke pass. The story asserts both sides of the ownership contract: the TabList overflow strip resolves to scrollbar-width: none, while an ordinary nested review scrollport resolves to thin.
  • Moving the universal rule back into layer(components) makes the TabList assertion fail (expected 'thin' to be 'none'), so the original regression cannot return silently.
  • product-shell-official-appshell--tail-prefetches-history-until-the-band-is-full fails in the same full-smoke run on this branch and on the base commit (pre-existing, unrelated).

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka — root-caused the regression, wrote the fix and the story assertion, and drafted this description.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/S Under 100 readable lines label Sep 11, 2026
@colaforniaw
colaforniaw marked this pull request as draft September 11, 2026 17:08
@colaforniaw
colaforniaw force-pushed the fix/workbar-tab-scrollbar-cleanup branch 2 times, most recently from 435b5ef to 6b783ba Compare September 11, 2026 17:13
@colaforniaw
colaforniaw marked this pull request as ready for review September 11, 2026 17:24
@colaforniaw
colaforniaw force-pushed the fix/workbar-tab-scrollbar-cleanup branch 2 times, most recently from 673d5be to 8ba258b Compare September 11, 2026 18:09

@me2seeks me2seeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR 5204 Review

结论

CHANGES_REQUESTED
层机制修复本身正确且最小:把 universal scrollbar-width/scrollbar-colorlayer(components)base.cssstyles.css:35layer(components) 导入)移入 @layer basemaka-tokens.css:1228cascade-layers.css:65 声明 base < astryx-components < components),Astryx TabList 的 scrollbar-width: none 因此重新胜出;story 测试同时断言两侧(strip=none、review panel=thin),契约完整。

发现

[P2] 同一 diff 里还删掉了整套 webkit 胶囊滚动条样式(33 行),但 PR 描述完全未提,这是全 app 的视觉变化

  • 文件: apps/desktop/src/renderer/styles/base.css(删除的 *::-webkit-scrollbar* 5 条规则)
  • 问题:删除的注释写明"Both reference systems converged on the same recipe: a slim pill inset in a transparent gutter"——即胶囊 thumb 是有意的设计基线。而 Desktop 渲染器是 Electron(Chromium),所有平台用户的滚动条都会从自定义胶囊回退到 UA 默认细条(scrollbar-color 在 Chromium 下仍着色,但 2px 内缩胶囊 + hover 加深消失)。这不是修 bug 所必需:TabList 复现条的问题是 scrollbar-width 的层冲突,把 webkit 规则一并移入 @layer base 就能同时保住两者;当前是"移了 width/color、删了 webkit",新旧行为不一致。
  • 建议(二选一,请在 PR 中说明决策):
    1. 恢复 5 条 webkit 规则,与 scrollbar-width/scrollbar-color 一起放进 @layer base(保设计基线,改动同样最小);或
    2. 确认胶囊样式是有意退役——那请更新 PR 描述(当前只说"move it into @layer base"和"remove the old :root workaround",未提 webkit 规则删除),并确认 Storybook 视觉基线已更新。

[P3] 描述里"remove the old :root workaround so the default has one owner"指向的规则在本 diff 和当前树上都不存在

  • 文件: PR 描述 / apps/desktop/src/renderer/styles/base.css
  • 问题:全仓库 grep 不到任何 :root + scrollbar 的规则(diff 前后都没有)。这句话可能是相对更早 base 写的过时描述,或在描述另一个已被合入的改动。
  • 建议:把这句改成实际发生的事(若 P2 选方案 2,正好并入 webkit 退役的说明)。

验证

  • 层序cascade-layers.css:65 @layer reset, theme, base, astryx-components, astryx-tokens, components; → base 低于 astryx-components/components,新默认让位成立。
  • 例外规则全部保赢prompt-rail.css:66(none)、workhub.css:253/257composer.css:540terminal.css:48runtime-host.css:75 都在 layer(components) 或无层(无层恒胜层),不会被 base 默认覆盖。
  • 修复面base.cssstyles.css:35layer(components) 导入,正是原 bug 中 out-rank astryx-components 的来源;移入 base 后该冲突消除。
  • story 测试playwithin/waitFor/expect 均来自已导入的 storybook/test(:22);断言 strip 的 scrollbarWidth === 'none' 与 review panel 的 'thin',双向覆盖。
  • 无残留:renderer 下唯一幸存的 webkit 规则是 prompt-rail.css:67width: 0,与本 PR 无关且保赢)。

@colaforniaw
colaforniaw force-pushed the fix/workbar-tab-scrollbar-cleanup branch from 8ba258b to a5be1da Compare September 12, 2026 02:15
@colaforniaw

Copy link
Copy Markdown
Author

Addressed:

  • Restored the WebKit capsule scrollbar styles.
  • Moved them with the standard scrollbar rules into @layer base.
  • Updated the PR description and removed the outdated :root wording.

Lint, format, typecheck, Storybook build, and the targeted smoke all pass. The story still verifies strip=none and review panel=thin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants