Skip to content

test(desktop): unbreak main after #4694 (E2E budget, workbar story) - #4895

Merged
Astro-Han merged 2 commits into
mainfrom
fix/e2e-budget-session-workbar
Sep 6, 2026
Merged

test(desktop): unbreak main after #4694 (E2E budget, workbar story)#4895
Astro-Han merged 2 commits into
mainfrom
fix/e2e-budget-session-workbar

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

check:e2e-budget fails on main: session-workbar.spec.ts: budget records 5 test(s), the file has 6. #4694 added right workbar visibility belongs to each Session and survives reload to that spec without updating apps/desktop/e2e-budget.json; its CI ran on a base that predated #4877's budget check, so the mismatch only appeared after merge (reported on #4894).

The test belongs in the Electron tier: the per-Session collapse bit has to survive a renderer reload, which the budget policy lists explicitly. This records it and names the mechanism. Tier is now 31 tests in 16 files.

Second break from the same merge: #4694 replaced WorkbarLayoutState.rightCollapsed with activeSessionId + collapsedBySession, and #4877 landed stories/app-shell.stories.tsx building the old shape, so tsc -p tsconfig.storybook.json fails on main. The story now builds the new state and reads the collapse bit through isSessionWorkbarCollapsed, as the controller does. #4829's current head carries the same two edits; whichever merges second resolves a same-text conflict.

Refs #4694, #4761, #4877

Verification

  • node apps/desktop/scripts/check-e2e-budget.mjs: E2E budget holds: 31 tests in 16 files.
  • tsc -p tsconfig.storybook.json --noEmit: no errors in stories/app-shell.stories.tsx (the three pre-existing packages/ui Astryx prop errors are local-only and unrelated).
  • biome check on the story: clean.
  • Not run: the E2E suite and Storybook (no code under test changed; the story's play is unchanged).

AI use

Select exactly one:

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

Tool(s) and scope: Claude Code drafted the budget entry text and this description.

Checklist

  • Tests cover the change and fail without it (the budget check itself fails on main and passes here)
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

#4694 added 'right workbar visibility belongs to each Session and survives
reload' to session-workbar.spec.ts without updating e2e-budget.json, so
check:e2e-budget fails on main (5 recorded, 6 present). Its CI ran on a
base that predated #4877's budget check.

The test needs Electron: the per-Session collapse bit has to survive a
renderer reload, which the budget policy lists explicitly. Record it and
name the mechanism.

Generated-by: Claude Code
@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Sep 6, 2026
#4694 replaced WorkbarLayoutState.rightCollapsed with activeSessionId +
collapsedBySession; #4877 landed a story that builds the old shape. Both
were green on their own bases, so main's typecheck fails on
stories/app-shell.stories.tsx. Build the story on the new state and read
the collapse bit through isSessionWorkbarCollapsed, as the controller does.

Generated-by: Claude Code
@Astro-Han Astro-Han changed the title test(desktop): record the sixth session-workbar E2E in the budget test(desktop): unbreak main after #4694 (E2E budget, workbar story) Sep 6, 2026
@Astro-Han
Astro-Han marked this pull request as ready for review September 6, 2026 06:13
@github-actions github-actions Bot added effort/S Under 100 readable lines and removed effort/XS Under 10 readable lines labels Sep 6, 2026

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving at exact head 47a19b6e. Both breaks are real, the fixes are minimal, and I checked the numbers rather than taking them from the description.

  • session-workbar.spec.ts contains 6 test( calls; the budget now records 6. The file totals 31 tests in 16 files, matching the summary.
  • The story now builds activeSessionId + collapsedBySession and reads the collapse bit through isSessionWorkbarCollapsedthe same accessor the production controller uses (use-workbar-layout-state.ts, alongside workbar-layout.ts), not a story-local shortcut. That matters here: the point of hosting this contract in a story is that the story exercises the production rule, so reading the bit the way the app reads it is what keeps the move honest.

Recording the test rather than deleting it is the right call — per-Session collapse surviving a renderer reload is renderer-reload persistence, which the budget policy already names as Electron-owned.

One thing worth stating plainly, since it is easy to read this as the guard being a nuisance: the guard worked. #4694's CI ran on a base that predated the budget check, so the drift could only surface after merge — which is precisely the case a post-merge structural check exists to catch, and it named the exact number to type. The failure mode it prevents is a tier that quietly grows back.

The note that #4829's head carries the same two edits and whichever lands second resolves a same-text conflict is useful; worth keeping an eye on so the second one is not resolved by discarding the budget update.

简体中文

在 exact head 47a19b6e 上批准。两处断裂都是真的,修法最小,而且数字我是核过的而不是采信描述。

  • session-workbar.spec.ts 实有 6test(,预算现在记 6;全量为 31 tests in 16 files,与摘要一致。
  • story 现在构造 activeSessionId + collapsedBySession,并通过 isSessionWorkbarCollapsed 读取折叠位 —— 这正是生产控制器所用的同一个 accessor(use-workbar-layout-state.ts,以及 workbar-layout.ts),不是 story 自己的捷径。这一点在这里很要紧:把契约放进 story 的意义就在于 story 要触发生产规则,所以「按应用读它的方式去读」才让这次搬移是诚实的。

把测试记进预算而不是删掉它,是正确的选择 —— 「每个 Session 的折叠位熬过一次渲染器重载」属于渲染器重载持久化,而预算政策本就把它列为 Electron 拥有的机制。

有一点值得直说,因为这件事很容易被读成守卫在添乱:守卫起作用了。 #4694 的 CI 跑在预算检查落地之前的基线上,所以这次漂移只可能在合并之后才浮现 —— 而这正是一个合并后结构检查存在的意义,并且它直接报出了该填的那个数字。它防住的失败形态,是那一层悄悄长回来。

关于 #4829 的当前 head 带有同样两处编辑、后合并者需要解决同文本冲突这一点,提示得有用;值得留意别在解决冲突时把预算更新丢掉。


Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.

@Astro-Han
Astro-Han merged commit e226ac5 into main Sep 6, 2026
2 checks passed
@Astro-Han
Astro-Han deleted the fix/e2e-budget-session-workbar branch September 6, 2026 06:49
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.

4 participants