Skip to content

Add React metadata slots above and below timeline messages - #4701

Closed
ymichael wants to merge 4 commits into
mainfrom
bb/a5-react-message-metadata-slot-thr_ru7pk3b7tf
Closed

ymichael wants to merge 4 commits into
mainfrom
bb/a5-react-message-metadata-slot-thr_ru7pk3b7tf

Conversation

@ymichael

@ymichael ymichael commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Plugins could add message actions and inline directives, but had no React slot for metadata beside a conversation message. Putting metadata inside the body also couples it to streaming text updates.

What changed

Adds app.slots.experimental_messageMetadata({ id, placement?, component }) above or below realized user and assistant messages in the main timeline and embedded ThreadChat. Components receive stable identity, creation time, role, nullable turn identity, and user initiator. Returning null filters messages. BB supplies deterministic ordering, plugin context, and independent error/suspense boundaries; windowed-out rows unmount. Creation time uses the message start timestamp so streaming deltas do not rerender unchanged metadata.

A5 only: no action-role/placement filters or omitted surfaces. Adds SDK collector/harness support, Plugin Guide card/anchors, authoring inventory, and experimental audit entry. SDK is 0.6.26, above current main's 0.6.25. No daemon wire changes or new CLI commands; fixture plugins use existing build/install commands.

How you verified

  • pnpm exec turbo run typecheck lint test --filter=@bb/app --filter=@get-bb/plugin-sdk --filter=bb-plugin-plugin-api-docs --concurrency=2 passes after rebasing onto current main: 5,475 app tests plus the SDK and Guide suites. The streaming regression fails with the previous update-timestamp mapping and passes with the start timestamp.
  • Server typecheck passes. All 22 authoring-contract tests pass; a normal retry of the seven filesystem/package-related test files passes all 140 tests after using an isolated npm cache and normal filesystem access.
  • Built isolated BB UI → server → daemon → real Codex: measured main and Side Chat streaming; metadata stays stable while text grows, and accepted user metadata updates when its turn ID arrives. Installed fixture exercises above/below order, null filtering, independently throwing contribution containment, and React state. Actual scrolling in both main and embedded ThreadChat verifies mount/unmount and remount, with no mounted metadata outside realized rows.
  • Disabling contributions produces identical message text, geometry, and action labels to the built main base. Ordinary main and embedded actions/selection remain usable, including embedded selection targeting its own composer. Final built Guide card opens correctly.

Configured review fixture. The fixture intentionally includes a throwing contribution. CI is rerunning on the rebased head.

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/a4-move-side-chat-s-special-cases-out-of-core-thr_5tzkxrtnns branch from 98ebb58 to 4e9a17f Compare October 2, 2026 18:13
@ymichael
ymichael force-pushed the bb/a5-react-message-metadata-slot-thr_ru7pk3b7tf branch from 9f37f14 to f5b980f Compare October 2, 2026 18:16
@ymichael
ymichael force-pushed the bb/a4-move-side-chat-s-special-cases-out-of-core-thr_5tzkxrtnns branch from 4e9a17f to 8d9cab3 Compare October 5, 2026 19:16
@ymichael
ymichael force-pushed the bb/a5-react-message-metadata-slot-thr_ru7pk3b7tf branch from f5b980f to 25f7a76 Compare October 5, 2026 19:22
@ymichael
ymichael force-pushed the bb/a4-move-side-chat-s-special-cases-out-of-core-thr_5tzkxrtnns branch 2 times, most recently from 9738d53 to 9a21b6b Compare October 5, 2026 23:08
Base automatically changed from bb/a4-move-side-chat-s-special-cases-out-of-core-thr_5tzkxrtnns to main October 5, 2026 23:31
@ymichael
ymichael force-pushed the bb/a5-react-message-metadata-slot-thr_ru7pk3b7tf branch 2 times, most recently from 961dd7b to 8e4c472 Compare October 6, 2026 00:22
@ymichael
ymichael force-pushed the bb/a5-react-message-metadata-slot-thr_ru7pk3b7tf branch from 8e4c472 to 0422f5b Compare October 6, 2026 23:25
@SawyerHood

Copy link
Copy Markdown
Collaborator

This is an automated message. We have closed this pull request because it has been open for more than two weeks.

@SawyerHood SawyerHood closed this Oct 17, 2026
ymichael added a commit that referenced this pull request Oct 29, 2026
…ugin slot (#6519)

## Human comments

## What was wrong

A message's send time was visible only in the footer of its `⋯` menu, so
checking when a message was sent took two clicks per message (#5745).
Plugins had no supported way to put metadata beside messages either.
Marketplace plugins (Message Timestamps, Message Date & Time, Tok Speed,
Turn TPS) find timeline rows with DOM selectors and MutationObservers,
and they break when bb's markup changes: Message Timestamps' action-row
selector no longer matches, so it falls back to rendering above the
bubble.

## What changed

- Revives #4701 as `app.slots.experimental_messageMetadata({ id,
placement?, component })` (Plugin SDK 0.6.98), with two placements:
- `"above"` (default): over the message, aligned to its side (13px inset
on user bubbles to match the action row, the prose inset on assistant
messages).
- `"actionRow"`: in the message's action row. It shows and hides exactly
like the actions, sits before them on user messages and after `⋯` on
assistant messages, and extends into the space beside the message
instead of narrowing them, so a short message keeps the same inline
actions.
- The component receives `{ message }`: `id`, `threadId`, `role`,
`createdAt`, `turnId`, and `initiator` on user messages. It never gets
message text, so streaming does not re-render metadata. Plugin
contributions get plugin context, CSS, and their own error and Suspense
boundaries.
  - A placement whose contributions all return null takes no space.
- #4701's `below` placement is dropped: in the marketplace only Turn TPS
decorates below a message, and its data is per turn.
- Core uses the slot for the #5745 fix. `core-message-metadata.tsx`
registers the inline time through `definePluginApp` (the same pattern as
the core Info tab) with `placement: "actionRow"`, and it renders through
the same `MessageMetadata` host as plugin contributions. The label is
`formatShortMessageTime` ("4:29 PM" today, "Oct 27, 4:29 PM" before),
with the full date in its tooltip.
- Device policy belongs to the component. The core time returns null on
coarse-pointer devices, so touch keeps the time only in the `⋯` drawer
footer, as #5745 asks.
- Time formatting moves to `message-time.tsx` and is shared by the
inline time, the menu footer, and generated (agent/automation) messages.
- Docs: `docs/api_to_audit.md` entry, plugin authoring references, and a
Plugin Guide card, fixture, and wireframe. No server, daemon, or wire
changes.

## How you verified

- `pnpm exec turbo run typecheck lint test --filter=@bb/app
--filter=@get-bb/plugin-sdk --filter=bb-plugin-plugin-api-docs`: all
pass (644 app test files), plus the server's
`plugin-authoring-docs.test.ts`.
- New test in `ThreadTimelineRows.row-isolation.test.tsx`: the message
time renders as a `<time>` in the action row without opening the menu,
before the actions on user messages and after `⋯` on assistant messages.
It fails when the core registration is removed.
- The SDK harness covers placement validation; row tests cover the
`above` and `actionRow` placements and that metadata does not re-render
while assistant text streams.
- Visual QA in a temporary Ladle story rendering real
`ThreadTimelineRows`, at 1100px desktop and a 390px phone with emulated
touch:
- the time is hidden at rest, appears on hover, and stays visible while
the menu is open;
- short messages show the full date beside the bubble without changing
the inline actions;
- on touch the core time is hidden, while a plugin's own `actionRow`
item still shows;
  - checked in light and dark, with multiple plugins per placement.

Fixes #5745

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants