Repository navigation
test(app): cover the sidebar, titlebar and session-row menu PRs - #186
Merged
Merged
Conversation
#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
force-pushed
the
sidebar-menu-tests
branch
from
August 11, 2026 05:26
d631aba to
820c140
Compare
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.
Important
Merge after #185. Two of these tests assert the behavior #185 fixes, and fail on
mainwithout it. Verified both ways, not assumed: on #185's branch the three specs pass 20/20; onmainwithout it,a sidebar row offers the same four actionsandmarks the row whose session is already openboth 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-modelreaches kobalte through the directory picker, so it throwsClient-only API called on the server sideunder the default test condition.buildHomeSessionRecords(feat(app): make the sidebar persistent and give it a Recents section #173) — directory filtering;pathKeynormalisation, 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; resolution through a project sandbox and throughprojectID; and dropping a session no project claims, which would otherwise render a row with no avatar and nowhere to go.descendantIDs(feat(app): add a session actions menu to both session lists #179) — the subtree a delete evicts, including that it terminates on a parent cycle. Exported for this, alongsidebuildHomeSessionRecords, which was already exported with no other consumer.session-share-request(feat(app): add a session actions menu to both session lists #179) — the row-to-timeline share handoff: consumed once, and a request meant for another session is not swallowed by a background tab mounting first.E2E
sidebar-persistence(feat(app): make the sidebar persistent and give it a Recents section #173) — the column survives opening a session, which is the whole point of moving it out ofhome.tsx; recents ordered newest first; a row opens the session it names in its own tab; the clicked row is marked as the open one; View all and New session both work from inside a session.sidebar-toggle-search(feat(app): add a sidebar collapse toggle and a Search button to the titlebar #175) — the titlebar toggle hides and restores the column and tracksaria-pressed, survives a reload and a route change, and Search lands on the recents list with its field focused and?focus=searchcleared so it does not re-fire on every later visit to/.session-actions-menu(feat(app): add a session actions menu to both session lists #179) — the trigger is faded until its row is hovered; the four actions on both lists; Share hidden when the server disables sharing; rename in place without opening the session; cancelling sending nothing; and delete asking first and doing nothing when declined.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
openRowMenustays, and is not a workaround: the trigger ispointer-events-noneuntil 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 -band the e2e project both typecheck.No
DIVERGENCES.mdrows: every new file is fork-only, andhome-model.tsxis fork-only too (added by #173). NoCHANGELOG.mdentry: tests change no documented behavior.🤖 Generated with Claude Code