Skip to content

fix(app): open the sessions behind a pull request row - #1350

Merged
iamtoruk merged 4 commits into
mainfrom
fix/pr-row-drill-through-1338
Sep 13, 2026
Merged

iamtoruk merged 4 commits into
mainfrom
fix/pr-row-drill-through-1338

Conversation

@iamtoruk

@iamtoruk iamtoruk commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Supersedes #1338 by @ozymandiashh, rebased onto main. Only the changelog needed a conflict resolution; his four commits are intact.

What it fixes: the "view sessions" plumbing from #1316 was wired through the pull request table but nothing called it, so PR rows were the one aggregate with no way into the sessions behind them. An expanded row now has a "View sessions for this pull request" button that lands in Sessions with the PR chip applied. Two smaller fixes ride along: pagination depth resets in the same nav commit as a sort or filter change instead of via an effect the controlled prop ignored, and filter chips are keyed by identity rather than by a label that truncates.

Verified on this machine by driving the branch build over CDP against real data: the button on the #1341 row lands in Sessions with the PR chip and one session, $10.57 of $16.57 attributed, row still expanded. Lifetime view with 9,005 sessions: 120 rows, 240 after Show more, back to 120 after a re-sort. 105 app tests pass, tsc clean.

The Pull requests section imported the PR selection builder and threaded
the drill-through callback through four component levels, but the row's
only handler was expand/collapse, so neither was ever invoked: every
other aggregate (day, model, category, project) reached the filtered
session list and the one report that names shipped work did not.

An expanded row now carries its own "View sessions for this pull request"
control above the work breakdown, matching the project entry in Spend. It
selects the PR by URL — the aggregation key of the by-PR report — and,
being a control of its own rather than the row, never toggles the
expansion it sits in. Rows with no per-turn detail get it too, and the
section renders no affordance at all when there is no destination wired.
The list reset its visible-row count to the first page whenever the
selection, the sort, the search or the data changed — but it wrote the
internal fallback state, and the app passes visibleCount as a controlled
prop so it can restore the depth from the nav history. The reset was
therefore dead: after Show more, changing the sort or removing a chip
left the reader 240 rows deep in a list that had just been reordered.

The owner now resets it in the same commit as the change it owns, so a
sort or selection change is one history entry rather than two, and no
reset can fire during a Back/Forward restore and discard the depth that
was just restored. The effect keeps serving the uncontrolled wiring and
says so.
Chips were keyed by the string they display, which truncates a session
id to 12 characters and a project path to its last segment. Two sessions
whose ids share a prefix, or two projects with the same basename on the
same branch, produced one React key for two chips: React warned about
the duplicate and could reconcile or remove the wrong one.

filterChipKey returns the composite identity each dimension is already
normalized and removed by (provider + session id, project + branch), so
chips that read alike stay distinct to React while the display label is
left as short as it was.
@iamtoruk
iamtoruk merged commit 68ce480 into main Sep 13, 2026
14 checks passed
@iamtoruk
iamtoruk deleted the fix/pr-row-drill-through-1338 branch September 13, 2026 13:57
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.

2 participants