Skip to content

ATL-900: CommsView team-chat blocks, and ToolCallCard / TurnRow opt-in props - #19

Merged
uzayer merged 2 commits into
mainfrom
ds-900-comms
Nov 4, 2026
Merged

uzayer merged 2 commits into
mainfrom
ds-900-comms

Conversation

@uzayer

@uzayer uzayer commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

ATL-900. Team chat gets one view model in the package, built the same way the session view was. Desktop's current comms components are the reference.

Part 1: CommsView (src/components/comms/, exported from the root entry, which needs no optional peer)

  • comms-view.ts: types only. CommsConversationKind, CommsConversationRowView, CommsAuthor (a person, or a badged integration with via), CommsReaction, CommsReplyRef (loaded / deleted / missing), CommsSendState, CommsMessageView, CommsCallMarker, CommsTranscriptRow. People are the session view's PersonRef. The docblock maps each wire field to the model for adapter authors.
  • comms-view-helpers.ts: COMMS_GROUP_WINDOW_MS, transcriptRows, reactionChips, conversationTitle (web's rule; desktop's "A & B / +N" is retired), unreadBadge, formatClock (cached, 1,024 FIFO, optional hourCycle) and formatDayLabel(at, now).
  • CommsConversationRow, CommsMessageRow (memoised), CommsDayDivider, CommsUnreadLine and CommsComposerShell, with CommsMessageRowLabels / DEFAULT_COMMS_MESSAGE_ROW_LABELS.
  • A rounded-composer utility (23px): desktop's composer corner, now in the package.

Part 2: opt-in props on the session blocks

  • ToolCallCard: open / onOpenChange, data-tool-call-id on the root, onCopy on each whole text payload (the check shows for 1,200ms, and only when onCopy resolves true), and labels (ToolCallCardLabels, DEFAULT_TOOL_CALL_CARD_LABELS).
  • TurnRow: renderItemFooter, openToolCallIds / onOpenToolCallIdsChange, thinkingLabel, thinkingBody, onOpenAttachment, and onCopyPayload, which passes through to each card.

Where desktop overrode the issue text (desktop is the source of truth):

  • The badge is desktop's keycap for both tones, not a destructive fill. The tone is on data-tone.
  • The offline presence dot uses subtle. The message avatar is lg (32px, desktop draws 30) and the gutter is w-9.
  • The mine chip is border-success/60 bg-success/15.
  • The strings are desktop's: "sending…", "failed to send", "Pin for everyone" / "Unpin for everyone", and "App".
  • Pinned shows the icon only, labelled "Pinned".
  • The toolbar buttons are 24px (IconButton sm).
  • An integration's default face is a muted rounded square with the webhook glyph. The issue asked for an initial; desktop draws the glyph. Desktop's id hue would need a ratchet-allow, so it stays out.
  • The composer is desktop's single glass-rim bar: the tools sit inline, the reply strip tucks behind the bar, and the bar widens from 84% to 89.5% in use. The issue described the standards mock's card, well and strip below.

Other deviations, flagged:

  • reactionChips takes { userId, emoji } rows, not wire user_id.
  • labels gains unknownAuthor, jumpToMessage, via(name), postedBy(name) and reactors(reaction). The last one carries the names desktop shows in the chip tooltip.
  • ToolCallCardLabels.truncated(part) and binary(part, size?) take part so the existing "Output truncated" and "Binary output" strings stay unchanged.
  • conversationTitle keeps "Former member" whole in a group title ("Former member, Lin"), where web's rule would print "Former".
  • A truncated payload gets no Copy, because only its head is held.
  • The thinking label still defaults to desktop's "Thinking…" / "Thought process", and thinkingBody defaults to "text", which is the current rendering.
  • Story files follow the repo's convention (stories/components/comms/, fixtures in stories/components/comms/fixtures.ts), not comms/fixtures/. There is no package-boundary.test.ts. router-agnostic.test.ts covers this, and both acceptance greps are clean.
  • Unread line and day-divider stories are blocks-comms-messagerow--unread-line-label, since one file holds one title.

Left out:

  • An a11y addon (none is installed). Plays don't run in CI; I ran them in headless Chromium.
  • SessionTimeline forwarding of the new TurnRow props: that file is outside this issue's list.
  • Touch tap-to-reveal for the toolbar, which belongs to ATL-892.
  • The composer's formatting row and mention picker, which are the app's.
  • Desktop's per-id avatar hues.

Upgrade note (there is no unreleased section in the README, so this is for the release batch): Team chat blocks are new on the root: CommsConversationRow, CommsMessageRow, CommsDayDivider, CommsUnreadLine, CommsComposerShell, the CommsView types and their helpers, plus a rounded-composer utility. ToolCallCard adds open / onOpenChange, onCopy, labels and data-tool-call-id. TurnRow adds renderItemFooter, openToolCallIds / onOpenToolCallIdsChange, thinkingLabel, thinkingBody, onOpenAttachment and onCopyPayload. TurnRow's commentSlot is now also called for thinking items ({ kind: "message", id }), beside the disclosure.

Evidence

  • bun run typecheck, format:check, theme:check, test (42 files, 386 tests), build, test:consumer, build-storybook and storybook:smoke: all green.
  • Every story id the issue lists exists in index.json. The plays ran in headless Chromium against the built Storybook with no play exceptions and no console errors, across DisabledRow, Deleted, IntegrationVia, ToolbarOnFocus, AuthorNameSlot, CustomLabels, Transcript, Replying, CustomSend, CustomSendLabel, ControlledOpenToolCall, PlainThinking, OpenableAttachments and CopyPayloads.
  • 128 screenshots are in shots/ATL-900/:
    • every Blocks/Comms/* story and each new session story, in Atlas dark and light;
    • MessageRow/Transcript, ConversationRow/List and ComposerShell/Replying in atlas, dracula and rose-pine, dark and light, desktop and phone.
    • The presence dot, the keycaps and the tinted mine chip all read in Light.
  • grep -nE "translate|scale-|rotate|transform" src/components/comms/*.tsx and the contracts/tauri/router/mock grep both return nothing.

Merge Danger

  • The one behaviour change with the new props unset: TurnRow now calls commentSlot for thinking items, which the issue asks for. The thinking disclosure also sits in one extra flex wrapper. session-timeline.test.tsx's anchor expectation gains message:e2. Any consumer that passes commentSlot gets a comment control beside each thought.
  • ToolCallCard always carries data-tool-call-id. This is additive.
  • rounded-composer is a new utility name. Desktop defines the same one in globals.css, so delete desktop's copy on adoption. It is the same value, so nothing breaks in between.
  • CommsMessageRow is memoised by identity. Callers must keep can, labels, reactionEmoji, the slots and the callbacks stable, or every row re-renders.
  • The desktop restyle of comms (ATL-888) is running in parallel. This branch matches desktop's comms as of 4066b885 on uzayermasud/atl-426-design-system.
  • No version bump and no tag.

…rnRow opt-in props

Part 1, the team-chat view model in the package:
- comms-view.ts: CommsConversationRowView, CommsAuthor (person or badged
  integration), CommsReaction, CommsReplyRef, CommsSendState,
  CommsMessageView, CommsCallMarker, CommsTranscriptRow, with the wire
  field mapping for adapter authors. People are the session view's PersonRef.
- comms-view-helpers.ts: transcriptRows, reactionChips, conversationTitle
  (web's rule), unreadBadge, formatClock (cached, 1,024 FIFO), formatDayLabel.
- CommsConversationRow, CommsMessageRow (memo; toolbar mounts on hover, focus
  or an open menu; colour and opacity only), CommsDayDivider, CommsUnreadLine,
  CommsComposerShell (desktop's glass-rim bar with the tucked reply strip).
- rounded-composer utility (23px), desktop's composer corner.

Part 2, opt-in props:
- ToolCallCard: controlled open/onOpenChange, data-tool-call-id, onCopy per
  whole text payload, labels (ToolCallCardLabels, DEFAULT_TOOL_CALL_CARD_LABELS).
- TurnRow: renderItemFooter, openToolCallIds/onOpenToolCallIdsChange,
  thinkingLabel, thinkingBody, onOpenAttachment, onCopyPayload; commentSlot
  now also anchors thinking items.
…pen" for screen readers

axe's label-content-name-mismatch: an aria-label of "Open <name>" dropped the
size the chip shows, so the accessible name no longer contained the visible text.
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