fix(e2e): seed a real project so the sidebar rename spec stops racing - #2022
Merged
Conversation
The 'project rename owns Enter' spec blocked four PRs tonight with a
30s click timeout that came and went between runs. Root cause: the
long-sidebar fixture never seeds a project — real project rows only
exist after the app ASYNCHRONOUSLY self-registers the workspace, a
race the test sometimes lost. When it lost, only the 未归属项目
pseudo-group existed, whose row legitimately has no 项目操作 trigger,
so the click waited out its timeout.
Fixture (the deterministic fix):
- seed-helpers exports LONG_SIDEBAR_PROJECT_{ID,NAME} and header()
learns a projectId passthrough; the three newest long-sidebar
sessions link to the project.
- The fixture writes projects.json (schemaVersion 1, one record whose
location is the live workspace root, so the catalog presents it as
available) alongside the 60-session seed. The seed is shared by
seven scenarios; grouping is by-time by default, so none of their
surfaces change.
Spec hardening:
- The project locator anchors on the seeded 示例项目 name instead of
`.first()` (which could land on the pseudo-group).
- The menu opens via focus + Enter — the suite's established
menu-trigger idiom (plan-reminders' openFocusedMenu) — instead of
pointer hit-testing a trigger nested inside SideNavItem's composite
button.
- The rename textbox is sidebar-scoped: entering rename swaps the row
content for the input, so a name-filtered row locator cannot match
while editing (hasText does not read input values).
Verified: sidebar spec 7/7 across five consecutive runs (and ~2x
faster — no more timeout retries); full local e2e suite green modulo
two known parallel-load flakes that pass 8/8 standalone both with and
without this change; fixture unit tests 73/73; typecheck / format /
checks green.
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
project rename owns Enterspec blocked four PRs tonight with an intermittent 30s click timeout. Root cause: the long-sidebar fixture never seeds a project — real project rows only appear after the app asynchronously self-registers the workspace, a race the test sometimes lost. On a loss only the 未归属项目 pseudo-group exists, whose row legitimately has no 项目操作 trigger.Deterministic fix (fixture): seed
projects.json(one record, location = live workspace root so the catalog presents it available) alongside the 60-session seed, and link the three newest sessions via a newprojectIdpassthrough inheader(). The seed is shared by seven scenarios; default grouping is by-time, so none of their surfaces change.Spec hardening: anchor on the seeded 示例项目 row (not
.first()); open the menu via focus+Enter (the suite's ownopenFocusedMenuidiom — the trigger nests inside SideNavItem's composite button, where pointer hit-testing is timing-sensitive); sidebar-scope the rename textbox (entering rename swaps row content for the input, so a name-filtered row locator can't match mid-edit).Verification: sidebar spec 7/7 × 5 consecutive runs (~2× faster — no timeout retries) · full local e2e green modulo two known parallel-load flakes that pass 8/8 standalone with and without this change · fixture unit tests 73/73 · typecheck/format/checks ✅
Self-reviewed per the standing instruction.