Skip to content

fix(timeline): the upper row holds the room between two rows (opencode#66014) - #1160

Merged
Hona merged 1 commit into
devfrom
row-shift/up-223-gap-below
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
row-shift/up-223-gap-below

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Port of official anomalyco/opencode#66014 ("keep the New timeline's rows still when older history loads").

Fault: rows a reader is looking at move down when an older page of history lands above them. Each row took the room over it from the row before it, so the first loaded row grew on top when its predecessor arrived.

Change: the upper row of two holds the room between them, under what it shows, as official's timelineGaps (packages/session-ui/src/timeline-next/spacing.ts) and the rule "Rows that load above the reader" (packages/app/AGENTS.md).

flowchart LR
  subgraph before
    A1["reply"] --- B1["room (top of prompt)<br/>prompt"]
  end
  subgraph after
    A2["reply<br/>room (bottom of reply)"] --- B2["prompt"]
  end
Loading
  • rhythm::space_at still decides the room (small, medium, large, less what a row's text leaves inside its box). It now writes it to the row above (RowSpec::under), in whole points, and the lower row keeps none.
  • The room a row was built with under a row the rhythm does not know (a divider, Changed files, a prompt's pictures) goes to the row above too.
  • A prompt has one top in place of tight and reply: 4 in a run, 8 under its pictures or at the session's start, else 16. The row above holds it in every case but the session's start.
  • A first row with history still to load above takes no room over it (Projection::new): the row that lands above it brings the room.
  • Where two spans of a projection meet, the upper span's last row takes the room the lower span's first row was built with.

Run (headless, 1280x800, scale 1, on this PR's CI build and on dev's): a session of 123 messages, 80 loaded; the reader wheels to the top of the loaded history; the older page is held 3 s, then lands.

dev: page held dev: page landed this PR: page held this PR: page landed
first loaded row (a reply) y 101, h 74 y 101, h 80 y 101, h 51 y 101, h 51
the three rows under it y 175, 241, 321 y 181, 247, 327 y 152, 247, 298 y 152, 247, 298
  • On dev every row under the first one moves down 6 px when the page lands. Here no row moves.
  • Row heights differ between the two builds because the room changed owner (a prompt now holds the 30 under it).
  • At rest the picture is the same: 14 fixture sessions (prompts, replies, tool groups, failures, Markdown, tables, a turn gap, subagents) drawn by the base build and by this PR's build differ in 0 pixels.
    Second fault, same picture: a prompt that was first of the newest page stayed 8 lower than the others after the page above it landed. Its span was projected as the session's start before the history state was known, and never again. The first span now projects again when "older messages remain" changes, and a span that stood first and no longer does gets a new stamp.

Differences from official

  • Official gives a turn's first row a turn gap row. Here the last row of the turn above holds that room. The picture at rest and the reader's rows are the same; the room arrives with the turn above, not with the turn below.
  • Not covered: a divider (a switch notice, a compaction) keeps the room over its own line (16, 6 or 0 by what is above it). A divider that is the first loaded row can still move by that much when the row before it lands.

Stuck group headers (official's second part): an open tool group's header sticks here too. Collapsing from it holds the pressed header (Tx::keep_on_screen) and does not measure a stuck distance, so official's 6 px correction has no counterpart. A group's row has no room over its header after this change.

…e#66014)

Rows a reader was looking at moved down when an older page of history landed above them: each row took the room over it from the row before it, so the first loaded row grew on top when its predecessor arrived. The row above now holds that room under what it shows, as official's timelineGaps does, and a first row with history still to load above takes none.
@Hona
Hona marked this pull request as ready for review November 25, 2026 08:56
@Hona
Hona merged commit 50fefd9 into dev Nov 25, 2026
7 checks passed
@Hona
Hona deleted the row-shift/up-223-gap-below branch November 25, 2026 08:56
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.

1 participant