Repository navigation
Themes: live rows, so a theme can tell a line that just arrived - #319
Merged
Merged
Conversation
rdrake
force-pushed
the
claude/project-thread-tpmrtz
branch
2 times, most recently
from
November 21, 2026 01:58
aeffa35 to
39e00a9
Compare
rdrake
marked this pull request as ready for review
November 21, 2026 01:58
Someone else's live message, mention or join in the open conversation is drawn with data-live="message|mention|join" on its row, for a theme's CSS. The note is held outside the store and taken once, by the row's first mount within a second of the line's arrival, so a list drawn again (another conversation and back, a past view closed, a status-message setting changed) replays nothing, and a pending copy of our own line below it does not hide it. Replaces the chat-cue draft (#318): no attribute on <html>, no forced layout or timer per line, no :last-child targeting, and no animation in style.css (a theme opts in). The ps/Keeki hearts become a user-stylesheet example in themes.md.
…rrival lasts No note for a line buffered behind a past view or a join under hidden status messages, which "Jump to present" or the setting would draw within LIVE_MS. A row drops data-live once LIVE_MS has passed and its animations have finished (at most LIVE_HOLD_MAX_MS), so turning Reduce Motion off or loading a stylesheet later animates no old row. The scenario opens the other channel inside LIVE_MS, checks the attribute is dropped, and reads the animation off the row it just marked; the docs example uses inset-block-end.
… joins' notes data-live stays LIVE_HOLD_MS (3 s) after the row mounts, whatever else animates in the row, instead of waiting on every animation in it. A join folded into a condensed group has its note taken by the group, so a regrouping within LIVE_MS does not mark the row it then draws.
rdrake
force-pushed
the
claude/project-thread-tpmrtz
branch
from
November 21, 2026 03:25
2beaa8c to
58f8c2a
Compare
This branch was previously deployed
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.
Replaces #318 (chat cues). Same goal, letting a theme react to what happens in the open conversation, with a different mechanism after review.
The hook
When someone else's message, mention or join arrives live in the open conversation, its row is drawn with
data-live="message|mention|join". A theme, or the user's own stylesheet, keys an entry effect on it:liveKindOfplus the gates insocket-events/msg.ts).mentioncomes from the message's own highlight, not the row's.highlightclass, which also follows the highlightMessages setting and a jump's focus.LIVE_HOLD_MS), then dropped, so a later redraw of the row does not replay the effect.style.css. Whether rows move is the theme's choice; a period theme may want them still.How it is set
msg.tsnotes the id in a non-reactive map as the line is inserted (client/js/liveRows.ts).Message.vuetakes the note once, as the row mounts, and only within 1 s of arrival. Only the chat list's rows can take it (in-chat), not search results. A condensed group takes its joins' notes, so they are not left to a later row.Why not a flag on the message: rows are keyed by id, but the whole list is drawn again on a conversation switch, a past view closing, or a status-message setting change. A stored flag would replay every live row's animation each time.
What changed from #318
<html>and no forced layout read. In a headless-Chrome probe with 1,500 rows, Themes: chat cues, so a theme can react to what happens in the open channel #318's toggle cost 2–17 ms per line; a per-row attribute costs about the same as no cue.:last-childtargeting. In Themes: chat cues, so a theme can react to what happens in the open channel #318, a line arriving while our own copy was still pending got no cue, and a past view or hidden status messages re-animated an old row.style.cssinto a user-stylesheet example inthemes.md§ Live rows, since they matched nicks in every theme.Testing
test/tests/liveRows.ts: classification, take-once, the 1 s window, pruning.tools/scenarios/live-rows.mjs, run against the tiny ircd with no real ircd. It passes:data-liveafter three seconds;style.cssanimates nothing.pnpm testpasses (lint, typecheck, mocha).Not done