Repository navigation
fix(app): open the sessions behind a pull request row - #1350
Merged
Merged
Conversation
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.
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.
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.