From e816951504b0b97a46564896a9a9aec759c7c4d9 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 2 Nov 2026 22:04:52 +0100 Subject: [PATCH 1/3] CONTRACT: fix(ui-react): make the live conversation entry discoverable from the paperclip (#3045) (#3319) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CONTRACT: feat(ui-kit): name the composer's attach menu and show the name as a pointer tooltip (#3045) The kit Composer gains an additive attachLabel prop, defaulting to "Attach — photo, camera, files". An actionable attach trigger paints the same string as an aria-hidden tooltip: shown after 400ms of hover and at once on keyboard focus, dismissed by Escape or opening the menu, hoverable, anchored above the field, and never rendered under (hover: none). Dismissal lives on the trigger's attribute so the composer keeps one render per keystroke. The package-api contract component and the API report record the prop. Refs #3045 Co-Authored-By: Claude Opus 5.5 * fix(ui-react): name live conversation from the paperclip and the attach sheet (#3045) When live conversation is available, ComposerView names the attach trigger "Attach — live conversation, photo, camera, files" and the phone sheet's subtitle starts with "Live conversation". The keyless entry scene proves the name, tooltip timing, keyboard focus and Escape, viewport-safe placement and the unavailable state at 1280 and 320 in both themes; the rail pointer projects prove touch renders no tooltip and the live row still opens only the first-entry disclosure. Refs #3045 Co-Authored-By: Claude Opus 5.5 * docs(design-kit): record the D37 attach-naming clarification (#3045) Refs #3045 Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .changeset/attach-names-live-conversation.md | 5 + api-report/ui-kit.txt | 1 + docs/decisions/design-kit/navigation.md | 16 +++ docs/integration-contract/package-api.md | 12 ++ packages/ui-kit/src/chrome/Composer.tsx | 87 +++++++++++++- packages/ui-kit/src/tokens.css | 62 ++++++++++ .../stories/chrome/Composer.stories.tsx | 4 +- .../ui-kit/tests/composer-attach-tip.test.tsx | 45 ++++++++ packages/ui-kit/vitest.config.ts | 2 +- .../src/components/chat/composer-view.tsx | 9 +- .../tests/browser/attach-tooltip.pointer.tsx | 109 ++++++++++++++++++ .../browser/conversation-controls.offline.tsx | 92 ++++++++++++++- .../tests/render/render-smoke.test.tsx | 27 ++++- 13 files changed, 458 insertions(+), 13 deletions(-) create mode 100644 .changeset/attach-names-live-conversation.md create mode 100644 packages/ui-kit/tests/composer-attach-tip.test.tsx create mode 100644 packages/ui-react/tests/browser/attach-tooltip.pointer.tsx diff --git a/.changeset/attach-names-live-conversation.md b/.changeset/attach-names-live-conversation.md new file mode 100644 index 0000000000..9c68a3a955 --- /dev/null +++ b/.changeset/attach-names-live-conversation.md @@ -0,0 +1,5 @@ +--- +"@schlessera/brain-ui-kit": minor +"@schlessera/brain-ui-react": patch +--- +The composer's paperclip now says what its menu offers. The kit `Composer` gains an optional `attachLabel` prop for the attach trigger's accessible name, which defaults to "Attach — photo, camera, files". A pointer sees the same name as a tooltip after 400ms of hover, or at once on keyboard focus. Escape or opening the menu dismisses it, and touch screens never show it. When live conversation is available, the app names it in the trigger ("Attach — live conversation, photo, camera, files") and in the phone attach sheet's subtitle. diff --git a/api-report/ui-kit.txt b/api-report/ui-kit.txt index 7b44c69f3e..e352a97382 100644 --- a/api-report/ui-kit.txt +++ b/api-report/ui-kit.txt @@ -833,6 +833,7 @@ signatures (every public export and the types it is made of) onSend?: (value: string) => void; onStop?: () => void; onAttach?: () => void; + attachLabel?: string; onMic?: () => void; mic?: boolean; micLabel?: string; diff --git a/docs/decisions/design-kit/navigation.md b/docs/decisions/design-kit/navigation.md index b3a99ecf24..4a7755bf33 100644 --- a/docs/decisions/design-kit/navigation.md +++ b/docs/decisions/design-kit/navigation.md @@ -38,6 +38,22 @@ The fifth drop answered the eleven questions the maintainer forwarded its reason rather than omitted. The query is a real input. 4. **The composer is kit-owned.** The app's `ComposerView` retires; the app keeps only the attach sheet, the provider list and the handlers. + + > **2026-11-02 — Clarified by #3045 (maintainer ruling of 2026-10-29).** + > The attach trigger's name and pointer tooltip list the menu's current + > actions; live conversation is reached through it. The name always starts + > with "Attach" and, when live conversation is available, reads + > "Attach — live conversation, photo, camera, files"; otherwise + > "Attach — photo, camera, files". The kit `Composer` takes that name as + > its additive `attachLabel` prop and paints it as a tooltip after 400ms + > of hover and at once on keyboard focus, dismissed by Escape or by opening + > the menu, and never under `(hover: none)`. On touch the attach sheet's + > subtitle names the same actions, and instructions say "Tap the paperclip + > (Attach), then Live conversation." A dictating composer's trigger stays + > inert, with no name and no tooltip. This clarifies §4 and the reviewed + > composer detail (capture is a menu behind attach); it adds no separate + > entry, no persistent desktop label and no touch long-press, and the kit + > and the menu keep their ownership. 5. **No snooze on a blocking approval**; "Always allow" has no key. 6. **Focus after the last decision in a list goes to the `EmptyState` heading that replaces the section, with the `InlineToast` receipt above it**; the diff --git a/docs/integration-contract/package-api.md b/docs/integration-contract/package-api.md index c1d09ed1d0..f02f9a2caf 100644 --- a/docs/integration-contract/package-api.md +++ b/docs/integration-contract/package-api.md @@ -4237,3 +4237,15 @@ packet audio. Unsupported codec/container forms, including audio/mp4, retain conservative elapsed-wall timestamps for the rest of that recording. Old stored wall timestamps remain readable without migration. No field, stop reason or state is added. This semantic change ships in a minor before 1.0. + + + +## Composer attach label (additive, 0.45.0, #3045) + +`ComposerProps` in `@schlessera/brain-ui-kit` gains optional +`attachLabel?: string`, the attach trigger's accessible name. Omitted or empty, +it is "Attach — photo, camera, files" (previously the fixed +"Attach — photo, camera, file"). An actionable trigger also paints that name as +an `aria-hidden` pointer tooltip; an inert trigger, including a dictating +composer's, has neither. Existing props and defaults are otherwise unchanged, +and no wire schema changes. `api-report/` records the added prop. diff --git a/packages/ui-kit/src/chrome/Composer.tsx b/packages/ui-kit/src/chrome/Composer.tsx index 621f2554dc..2d2b81f0db 100644 --- a/packages/ui-kit/src/chrome/Composer.tsx +++ b/packages/ui-kit/src/chrome/Composer.tsx @@ -126,8 +126,15 @@ export interface ComposerProps { onSend?: (value: string) => void; /** The stop disc while `streaming`, and `esc` inside the field. */ onStop?: () => void; - /** Opens the app's own capture menu (photo, camera, file). */ + /** Opens the app's own capture menu (photo, camera, files). */ onAttach?: () => void; + /** + * The attach trigger's accessible name, and the pointer tooltip that shows + * it: the actions the app's menu currently offers, in menu order. Starts + * with "Attach" so an instruction naming the control still matches it. + * Defaults to "Attach — photo, camera, files". + */ + attachLabel?: string; /** Opens capture, or stops it while `dictating`. */ onMic?: () => void; /** @@ -141,6 +148,9 @@ export interface ComposerProps { maxRows?: number; } +/** The attach trigger's default name: the capture menu with no live conversation in it. */ +const ATTACH_LABEL = "Attach — photo, camera, files"; + export type ComposerState = "ready" | "streaming" | "reconnecting" | "offline" | "dictating"; export interface ComposerRecall { @@ -218,6 +228,8 @@ export function Composer(p: ComposerProps) { } const field: CSSProperties = { + // The attach tooltip anchors to the field, so it clears a grown field. + position: "relative", flex: 1, minWidth: 0, display: "flex", @@ -302,7 +314,7 @@ export function Composer(p: ComposerProps) {
{showAttach ? ( - + ) : null}