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) {