Skip to content

refactor(session-ui): place timeline entries from facts - #65025

Merged
jlongster merged 2 commits into
devfrom
timeline-place
Nov 20, 2026
Merged

jlongster merged 2 commits into
devfrom
timeline-place

Conversation

@jlongster

@jlongster jlongster commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #

Builds on #65012, which is now merged into dev. This PR's base is dev.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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:

  • Current timeline: renderable, the detail path of groupContent/contentGroupType/toolGroupType, notice placement, and the row's default-open logic.
  • New timeline: contentShows, contentGroup, contentOpens, noticePlacement, diffOpens and hidesActivity are removed from rules.ts. A background shell's report now finds the call that launched it through facts.
  • categoryOf is the only category map. timelineCategory and ToolRule.category are 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. place keeps both behaviours behind a timeline option, 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Base automatically changed from timeline-facts to dev November 20, 2026 17:42
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

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jlongster
jlongster merged commit fe8def6 into dev Nov 20, 2026
12 checks passed
@jlongster
jlongster deleted the timeline-place branch November 20, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant