Skip to content

Themes: live rows, so a theme can tell a line that just arrived - #319

Merged
rdrake merged 4 commits into
developfrom
claude/project-thread-tpmrtz
Nov 21, 2026
Merged

rdrake merged 4 commits into
developfrom
claude/project-thread-tpmrtz

Conversation

@rdrake

@rdrake rdrake commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

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:

html:not([data-reduce-motion]) #chat .msg[data-live] { animation: my-arrive 0.35s ease-out; }
  • Never marked: history, catch-up, placed lines, notices rerouted into the open window, edits, pending copies, our own lines, a line while a past view is open, a join while status messages are hidden, or anything while the page is hidden (liveKindOf plus the gates in socket-events/msg.ts).
  • mention comes from the message's own highlight, not the row's .highlight class, which also follows the highlightMessages setting and a jump's focus.
  • The attribute is held for three seconds (LIVE_HOLD_MS), then dropped, so a later redraw of the row does not replay the effect.
  • No animation in style.css. Whether rows move is the theme's choice; a period theme may want them still.

How it is set

msg.ts notes the id in a non-reactive map as the line is inserted (client/js/liveRows.ts). Message.vue takes 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

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:
    • a message and a mention are marked;
    • a line arriving above a pending copy of ours is marked;
    • a line read later in its own channel is not marked;
    • switching back to a channel marks no row;
    • the row drops data-live after three seconds;
    • reduced motion still sets the attribute;
    • style.css animates nothing.
  • pnpm test passes (lint, typecheck, mocha).
  • Two review rounds; their findings are fixed here.

Not done

  • The scenario does not yet cover a join or the motion toggle mid-animation.

@rdrake
rdrake force-pushed the claude/project-thread-tpmrtz branch 2 times, most recently from aeffa35 to 39e00a9 Compare November 21, 2026 01:58
@rdrake
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
rdrake force-pushed the claude/project-thread-tpmrtz branch from 2beaa8c to 58f8c2a Compare November 21, 2026 03:25
@rdrake
rdrake merged commit f4a50e2 into develop Nov 21, 2026
11 checks passed
@rdrake
rdrake deleted the claude/project-thread-tpmrtz branch November 21, 2026 03:31

This branch was previously deployed

1 inactive deployment
github-pages — 58f8c2aa Deployed Nov 21, 2026 by rdrake via deploy #1390
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