Repository navigation
refactor(session-ui): place timeline entries from facts - #65025
Conversation
4c0213c to
77c0c86
Compare
User decisions: - Place timeline entries from message facts, not from rendered groups - Behaviour matches production - Both timelines use it
…y delta User decisions: - Fix all review findings on timeline placement from facts - Behaviour matches production
77c0c86 to
12952c8
Compare
There was a problem hiding this comment.
Looks sound. I checked the refactor against the pre-refactor code (3b7a193): I recorded the PR's row snapshots there, with the old open-state logic for each timeline. Both timelines' snapshots, including the open/closed marks, came out identical to the ones committed here. Tests pass for session-ui's timeline and timeline-next, and tsc passes for session-ui and app.
Public API: unchanged. Only exports inside session-ui moved (timelineCategory, timelineNoticePlacement, rules.ts helpers, summarizeShells), and nothing outside the package used them.
One thing worth fixing: the two new placement-reactivity tests are skipped under the package's test script and in CI, so the last commit's "no rebuild on every delta" fix isn't protected (see inline).
| const detail = timelinePresets.find((item) => item.id === "detailed")!.value | ||
|
|
||
| // Solid's server build does not track, so this runs with `bun test --conditions=browser`. | ||
| describe.skipIf(isServer)("current timeline placement reactivity", () => { |
There was a problem hiding this comment.
This test and its New timeline twin only run with bun test --conditions=browser. Neither the package's test script nor CI passes that flag, so under bun test src both are skipped. That leaves the "no rebuild on every delta" fix unprotected. Could they run by default instead, e.g. through a browser-conditions preload or a dedicated script that CI calls? If not, it may be simpler to drop them.
There was a problem hiding this comment.
This push is a rebase onto dev with the two commits unchanged (checked with git range-diff), so there is nothing new to review. Tests and tsc still pass on the new head. The earlier snapshot check still holds: both timelines' rows, open/closed marks included, match the pre-refactor code exactly. Public API: unchanged. The open thread on the placement-reactivity tests still stands: they are still skipped without --conditions=browser.
Issue for this PR
Closes #
Builds on #65012, which is now merged into
dev. This PR's base isdev.Type of change
What does this PR do?
Adds
timeline/place.ts. Using the Timeline detail setting, it decides each fact's category, whether it stands alone, joins a group or hides, and whether it starts open. Both timelines now ask it instead of making their own grouping decisions:renderable, the detail path ofgroupContent/contentGroupType/toolGroupType, notice placement, and the row's default-open logic.contentShows,contentGroup,contentOpens,noticePlacement,diffOpensandhidesActivityare removed fromrules.ts. A background shell's report now finds the call that launched it through facts.categoryOfis the only category map.timelineCategoryandToolRule.categoryare gone.The two timelines place a few things differently today. For example, the current one keeps v1 tool names as they were and still shows failures in hidden categories.
placekeeps both behaviours behind atimelineoption, so nothing changes.How did you verify your code works?
Added row snapshots for both timelines, covering every preset plus edit, commentary and shell/tools toggles. The fixture turns cover edits, reads, searches, thoughts, foreground, background and failed shells, a subagent, notices, commentary, errors and v1 tool names. The snapshots were recorded from v2.3.2's original code, match dev, and pass unchanged after the refactor. Also ran tsc in session-ui and app, the session-ui timeline tests and the app's timeline tests.
Screenshots / recordings
No visual change.
Checklist