Skip to content

test(app): cover the sidebar, titlebar and session-row menu PRs - #186

Merged
quickbeard merged 2 commits into
mainfrom
sidebar-menu-tests
Aug 11, 2026
Merged

quickbeard merged 2 commits into
mainfrom
sidebar-menu-tests

Conversation

@quickbeard

@quickbeard quickbeard commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Important

Merge after #185. Two of these tests assert the behavior #185 fixes, and fail on main without it. Verified both ways, not assumed: on #185's branch the three specs pass 20/20; on main without it, a sidebar row offers the same four actions and marks the row whose session is already open both fail.

#173, #175 and #179 shipped with no tests. #181 and #183 already carried their own — a Playwright spec each, plus updated unit suites for #181 — so this fills the gap left by the other three.

Unit

In test-browser/ rather than beside the source: home-model reaches kobalte through the directory picker, so it throws Client-only API called on the server side under the default test condition.

E2E

History of the two defects

The first revision of this PR worked around two bugs found while writing these tests — a conditional second click on the ⋮ trigger, and a reload before asserting data-selected. #185 fixes both, so the second commit here removes both detours and the comments describing them.

The hover in openRowMenu stays, and is not a workaround: the trigger is pointer-events-none until its row is hovered, and Playwright hit-tests before it moves the mouse.

Verification

Against #185's branch: 623 unit, 45 browser-condition unit, and 20/20 of these e2e specs. tsgo -b and the e2e project both typecheck.

No DIVERGENCES.md rows: every new file is fork-only, and home-model.tsx is fork-only too (added by #173). No CHANGELOG.md entry: tests change no documented behavior.

🤖 Generated with Claude Code

Quickbeard and others added 2 commits August 11, 2026 12:23
#173, #175 and #179 shipped with no tests; #181 and #183 already carried
their own, so this fills the gap left by the other three.

Unit (test-browser, since home-model reaches kobalte through the directory
picker and will not import under the server condition):

- buildHomeSessionRecords: directory filtering, pathKey normalisation so a
  Windows path and a trailing slash are one directory, sort by last update
  with a created-time fallback, dedupe keeping the fresher copy, sandbox and
  projectID resolution, and dropping a session no project claims.
- descendantIDs: the subtree a delete evicts, including cycle safety. Exported
  for this, alongside buildHomeSessionRecords which was already exported.
- session-share-request: the row-to-timeline share handoff consumes once, and
  a request meant for another session is not swallowed.

E2E:

- sidebar-persistence: the column survives opening a session, orders recents
  newest first, opens the session a row names, and View all and New session
  both work from inside a session.
- sidebar-toggle-search: the titlebar toggle hides and restores the column,
  survives a reload and a route change, and Search lands on the recents list
  with its field focused and the ?focus=search param cleared.
- session-actions-menu: the four actions on both lists, Share hidden when the
  server disables sharing, rename in place without opening the session,
  cancel sending nothing, and delete asking first.

Two defects turned up while writing these, both left unfixed and documented
where they bite:

- Clicking a Recents row opens the session but never marks the row as open;
  the marker only appears once the tab list is read back on a fresh mount.
  Arriving by URL marks it immediately, so the state is right and the click
  path fails to re-run the memo.
- The first activation of a row's actions menu is swallowed. Four clicks give
  closed, open, closed, open, and focus + Enter is swallowed the same way, so
  a user's first click on the dots lands on nothing too.

623 unit, 45 browser-condition unit and all 110 e2e regression tests pass;
tsgo -b and the e2e project both typecheck.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both specs carried a detour around a defect, each with a comment explaining
why. #185 fixes both, so the detours are now dead weight and the comments are
wrong.

- session-actions-menu: openRowMenu clicked a second time when the first was
  swallowed. One click now, and the helper no longer needs the page.
- sidebar-persistence: "marks the row whose session is already open" reloaded
  before asserting data-selected. It asserts on the click that opened the
  session.

The hover in openRowMenu stays. That one is not a workaround: the trigger is
pointer-events-none until its row is hovered, and Playwright hit-tests before
it moves the mouse.

Checked both ways rather than assumed. On #185's branch the three specs pass
20/20; on main without it, both edited tests fail — the menu never reports
aria-expanded=true, and no row is ever marked selected. So this must merge
after #185.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit ca3c6db into main Aug 11, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the sidebar-menu-tests branch August 11, 2026 05:30
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.

1 participant