Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions packages/app-bundle/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"packages/app/src/design-polish.css": "abe7515fe2ffdc090a51302f910d4b0873fb741f1534bd5196ddecc71fc7b714",
"packages/app/src/desktop-menu.ts": "350e0e9f2e4294bfe1b1f357b3cd2ea0908b14d20ca1e79fda2305db1958fb24",
"packages/app/src/entry.tsx": "080b3c11cdd61dfaf4bea8132970a1a300b77b0e8fc53065e42d5ccd75eaed01",
"packages/app/src/index.css": "727656c5e7ff7d7c7ff4fc95a3ec7c9148a34f1f974a58a297285e870519be5d",
"packages/app/src/index.css": "2192acffe9ea087a56833e8d9a473dfaa648ff634583a49ce5d0491cbdf4362d",
"packages/app/src/theme-preload.test.ts": "d9e4e96dd39a3491493637682611bedf6ddf4b6e4dbdddcb60bf006211b137a1",
"packages/app/test-browser/empty-workspace-landing.test.ts": "83d19ecf5da37c234dbde1a004432865204d7f412a335c4e470a07e73d9bcda4",
"packages/app/test-browser/keybind-migration.test.ts": "192418880d432ff62d15fd80f6250ece6233e43d0dbe11d5a4fbb5f4d9e45a06",
Expand Down Expand Up @@ -155,7 +155,7 @@
"packages/app/src/components/profile-popover.tsx": "eff742e90544455f13234a9351bb1b82189663cba2cd3172bdcea1a8a37284e8",
"packages/app/src/components/prompt-input-clipboard-structure.test.ts": "946b718c2164da394602f26e4d9919d752da0d0b9bee714f345ba16c274542da",
"packages/app/src/components/prompt-input-resize-structure.test.ts": "38244b103702afc4b45cd40176f338c2a632d64b8ee9a719ee2073b6d7aaf062",
"packages/app/src/components/prompt-input-v2.tsx": "f0b637e46737e3c7345957a0167c878c8e9870a15bb850057665a4444ea91fe8",
"packages/app/src/components/prompt-input-v2.tsx": "915d563eb74e6aa40959f04f14b20d007f1a4a50ddc787e6d210641a857e25a4",
"packages/app/src/components/prompt-input.tsx": "e3bfbadfd0a049aa2351bb6ef413708a56e66881fdcc052d43a6cd82563c6c03",
"packages/app/src/components/prompt-project-selector.tsx": "0157c954b938bce2b5aca9a82f4a72338e361f4c9027e55a7fd5a14a1654d294",
"packages/app/src/components/question-inbox.tsx": "5ce03a30b7110092ddffccf3bf38e6c1b1a79624f378c819be7019725c96478a",
Expand Down Expand Up @@ -772,9 +772,10 @@
"packages/app/src/components/prompt-input/attachments.ts": "c3c28df0d2f18378d39e17147a4c64e8ea01d63b97c39e1874ed9445ca671bb1",
"packages/app/src/components/prompt-input/clipboard-bridge.test.ts": "15f76dca1a25d024128718e4099220b79ca029263410aab55502cf9caf9b2914",
"packages/app/src/components/prompt-input/clipboard-bridge.ts": "4b5a1edf59d4c85268d6ff72aa9f9d66f82d4fdb887121fb978c09caf4c5be65",
"packages/app/src/components/prompt-input/composer-row-responsive.test.ts": "eec6dffe42b47e87320740af9d7d91c83d94e37bceededeb2dd0c2ea14d534e1",
"packages/app/src/components/prompt-input/context-items.tsx": "027b02e394ccd14849052bf3fcacdae1e090c71d164fa8955addfe3f7abf1758",
"packages/app/src/components/prompt-input/harness-control.test.tsx": "b8b9bfe984843d22aeb398d978c6a79ac114face03e0911ef3a67aa172dd6509",
"packages/app/src/components/prompt-input/harness-control.tsx": "6f3825cb6b312e6b1d85b7af0da99976cbb15082822a92e869f956f5ec2e91fd",
"packages/app/src/components/prompt-input/harness-control.tsx": "4e5a5731a62e35e167a99f3f8ecf556baf9f0dce9979a1dc502a084d07625f18",
"packages/app/src/components/prompt-input/harness.test.ts": "35739529b06829dd9fa169209c54ae668e0fc06d6968b00cfce638a221ce1361",
"packages/app/src/components/prompt-input/harness.ts": "2a9406b14da9de68a172e61b6ddb4e49442a90f770b1b88669761f2ec201f9ab",
"packages/app/src/components/prompt-input/image-attachments.tsx": "aa451ed6aa61a68ba0e8dacd8c45137f84c62566797a5242b75a89487ef0e9bf",
Expand Down Expand Up @@ -1068,7 +1069,7 @@
"packages/sdk/js/src/v2/gen/sdk.gen.ts": "6610638b4fb71bac498da98d232ef9adcd4b011b63e5e81a63fc6dc20d311b17",
"packages/sdk/js/src/v2/gen/types.gen.ts": "20dfc17423861bd51c197fe6a2fcb6efbd7ad11853b28e0bb79844115256e729",
"packages/session-ui/src/v2/components/prompt-input/attachments.ts": "ff66078f2edc9a67a4df0d7dfd76a49be5eab27ac332b303f3412721ef7268ea",
"packages/session-ui/src/v2/components/prompt-input/index.tsx": "f3e79853a30c71b7c7ec99ca7c092695ce59b03233c8cf0f6e094fcf00498c60",
"packages/session-ui/src/v2/components/prompt-input/index.tsx": "4fb03e92a90f631714eade4bf205aac8449f299c22adb2a9db3b6da17abe9070",
"packages/session-ui/src/v2/components/prompt-input/resize-handle.test.ts": "1bd88c8e864d5d240f8b00f9e3bf4a265c79282c0073b7711d797ff7d7e81d6e",
"packages/session-ui/src/v2/components/prompt-input/resize-handle.tsx": "61362de659c8000539bdb20bd710b86967e85df6cf5b4ecfb2fa3bae46cb4e0a",
"packages/session-ui/src/v2/components/prompt-input/resize.test.ts": "c049ad1cd60e5ac4ec779dd37ab4b2c8a6244b5b6cbbc59240d1c43a449cfabd",
Expand Down Expand Up @@ -1104,10 +1105,10 @@
"packages/ui/src/v2/components/text-shimmer-v2.tsx"
],
"exceptions": [],
"extracted_at": "2026-11-08T15:21:50.674Z",
"extracted_at": "2026-11-24T14:35:47.678Z",
"per_package": {
"packages/app": {
"A": 314,
"A": 315,
"M": 166,
"D": 0
},
Expand Down Expand Up @@ -1153,7 +1154,7 @@
}
},
"counts": {
"overlay_total": 1082,
"overlay_total": 1083,
"deletions": 7,
"server_coupled": 0
},
Expand Down Expand Up @@ -1922,6 +1923,7 @@
"packages/app/src/components/prompt-input/attachments.ts": "M",
"packages/app/src/components/prompt-input/clipboard-bridge.test.ts": "A",
"packages/app/src/components/prompt-input/clipboard-bridge.ts": "A",
"packages/app/src/components/prompt-input/composer-row-responsive.test.ts": "A",
"packages/app/src/components/prompt-input/context-items.tsx": "M",
"packages/app/src/components/prompt-input/harness-control.test.tsx": "A",
"packages/app/src/components/prompt-input/harness-control.tsx": "A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function PromptInputV2ModelControl(props: {
/>
)}
</Show>
<span class="truncate leading-4">{props.modelName}</span>
<span class="amicode-composer-model-label truncate leading-4">{props.modelName}</span>
<span class="-ml-0.5 -mr-1 flex shrink-0">
<Icon name="chevron-down" />
</span>
Expand All @@ -603,7 +603,7 @@ function PromptInputV2ModelControl(props: {
data-control-type="dialog"
variant="ghost-muted"
size="normal"
class="min-w-0 max-w-[220px] justify-start ![font-weight:440] group"
class="amicode-composer-model min-w-0 max-w-[220px] justify-start ![font-weight:440] group"
classList={{ "animate-in fade-in": shouldAnimate() }}
style={{ height: "28px" }}
onClick={props.onUnpaidClick}
Expand All @@ -620,7 +620,7 @@ function PromptInputV2ModelControl(props: {
variant="ghost-muted"
size="normal"
style={{ height: "28px" }}
class="min-w-0 max-w-[220px] justify-start ![font-weight:440] group"
class="amicode-composer-model min-w-0 max-w-[220px] justify-start ![font-weight:440] group"
classList={{ "animate-in fade-in": shouldAnimate() }}
data-action="prompt-model"
data-control-type="popover"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import { describe, expect, test } from "bun:test"
import { readFileSync } from "node:fs"
import { resolve } from "node:path"

// amicode#2189 — the composer control row at narrow widths. The row must stay
// legible and keep Send reachable: chips truncate instead of overlapping, and
// below named container breakpoints they shed in an explicit priority order
// (variant -> harness -> model label -> concise). Layout lives in CSS
// container queries on the `amicode-composer` container, so these tests assert
// the rules and the class wiring from source (the repo's pattern for CSS
// behavior; see travelling-dot.test.ts).

const indexCss = readFileSync(resolve(__dirname, "../../index.css"), "utf8")
const composerSource = readFileSync(resolve(__dirname, "../prompt-input-v2.tsx"), "utf8")
const harnessSource = readFileSync(resolve(__dirname, "harness-control.tsx"), "utf8")
const rowSource = readFileSync(
resolve(__dirname, "../../../../session-ui/src/v2/components/prompt-input/index.tsx"),
"utf8",
)

describe("composer row slot wiring", () => {
test("the control group is tagged so the CSS can target it", () => {
expect(rowSource).toMatch(/class="amicode-composer-controls [^"]*min-w-0 flex-1/)
})

test("agent and variant selects carry their slot classes", () => {
expect(rowSource).toMatch(/title="Choose agent"[\s\S]{0,200}class="amicode-composer-agent"/)
expect(rowSource).toMatch(/title="Choose model variant"[\s\S]{0,200}class="amicode-composer-variant"/)
})

test("the model control and its label carry their slot classes", () => {
expect(composerSource.match(/amicode-composer-model /g)?.length).toBe(2)
expect(composerSource).toContain('class="amicode-composer-model-label truncate')
})

test("the harness trigger carries its slot class and can shrink", () => {
expect(harnessSource).toContain('class="amicode-composer-harness min-w-0 ')
})
})

// Pull the body of the first CSS rule whose selector list contains `selector`.
function ruleBody(css: string, selector: string): string {
const at = css.indexOf(selector)
if (at < 0) return ""
const open = css.indexOf("{", at)
return css.slice(open + 1, css.indexOf("}", open))
}

describe("chips truncate; Send is never overlapped", () => {
test("the control group clips horizontally and keeps focus rings inside the clip", () => {
const body = ruleBody(indexCss, ".amicode-composer-controls {")
expect(body).toMatch(/overflow-x:\s*clip/)
expect(body).toMatch(/padding-inline:\s*4px/)
expect(body).toMatch(/margin-inline:\s*-4px/)
})

// Each chip's trigger sits inside TooltipV2's `div[data-component="tooltip-v2-trigger"]`
// (display: flex). That wrapper, not the button, is the row's flex item, so
// min-width: 0 on the button alone never lets it shrink: the wrapper's
// automatic min-width pins it at the full label width.
const CHIPS = ".amicode-composer-agent, .amicode-composer-model, .amicode-composer-variant, .amicode-composer-harness"
const TRIGGER = '.amicode-composer-controls [data-component="tooltip-v2-trigger"]'

test("every slot chip, and the tooltip wrapper that is its flex item, can shrink so the label ellipsizes", () => {
const body = ruleBody(indexCss, `.amicode-composer-controls :is(${CHIPS}),\n${TRIGGER}:has(:is(${CHIPS}))`)
expect(body).toMatch(/min-width:\s*0/)
})

test("the add button never shrinks", () => {
expect(ruleBody(indexCss, `${TRIGGER}:has([data-action="prompt-attach"])`)).toMatch(/flex-shrink:\s*0/)
})

test("the trailing controls never shrink", () => {
expect(rowSource).toContain('<div class="mr-1 flex shrink-0 items-center">{control}</div>')
})
})

// Every `@container amicode-composer (max-width: Nrem) { ... }` block, as
// [N, body]. Bodies here are flat rule lists, so brace depth 2 ends a block.
function containerBlocks(css: string): Array<[number, string]> {
const out: Array<[number, string]> = []
const re = /@container amicode-composer \(max-width:\s*([\d.]+)rem\)\s*\{/g
for (let m = re.exec(css); m; m = re.exec(css)) {
let depth = 1
let i = re.lastIndex
for (; i < css.length && depth > 0; i++) {
if (css[i] === "{") depth++
else if (css[i] === "}") depth--
}
out.push([Number(m[1]), css.slice(re.lastIndex, i - 1)])
}
return out
}

// The breakpoint (rem) at which `selector` is shed, or undefined.
function shedAt(selector: string): number | undefined {
const hits = containerBlocks(indexCss).filter(([, body]) => body.includes(selector))
return hits.length === 1 ? hits[0][0] : undefined
}

describe("explicit shed order: variant -> harness -> model label -> concise", () => {
const variant = shedAt(".amicode-composer-variant")
const harness = shedAt(".amicode-composer-harness")
const modelLabel = shedAt(".amicode-composer-model-label")
const concise = shedAt(".amicode-concise-toggle-wrap")

test("each sheddable control has exactly one breakpoint", () => {
expect([variant, harness, modelLabel, concise].every((n) => typeof n === "number")).toBe(true)
})

test("the breakpoints shed in priority order, widest first", () => {
expect(variant!).toBeGreaterThan(harness!)
expect(harness!).toBeGreaterThan(modelLabel!)
expect(modelLabel!).toBeGreaterThan(concise!)
})

test("the concise toggle keeps its #1633 breakpoint (26rem), now last in the order", () => {
expect(concise).toBe(26)
})

test("variant and harness are removed outright, tooltip wrapper included (no stray gap)", () => {
const blocks = containerBlocks(indexCss)
const body = (n: number | undefined) => blocks.find(([rem]) => rem === n)![1]
const variantBody = body(variant)
expect(variantBody).toContain('[data-component="tooltip-v2-trigger"]:has(.amicode-composer-variant)')
expect(ruleBody(variantBody, ".amicode-composer-variant")).toMatch(/display:\s*none/)
const harnessBody = body(harness)
expect(harnessBody).toContain(
'.amicode-composer-controls:not([data-harness-degraded]) [data-component="tooltip-v2-trigger"]:has(.amicode-composer-harness)',
)
expect(ruleBody(harnessBody, ".amicode-composer-harness")).toMatch(/display:\s*none/)
})

test("the harness is never shed under a degraded harness (it is the way back)", () => {
const blocks = containerBlocks(indexCss)
const body = blocks.find(([rem]) => rem === harness)![1]
expect(body).toContain(".amicode-composer-controls:not([data-harness-degraded]) .amicode-composer-harness")
})

test("the model chip goes icon-only: its label is visually hidden but keeps the accessible name", () => {
const blocks = containerBlocks(indexCss)
const label = ruleBody(blocks.find(([rem]) => rem === modelLabel)![1], ".amicode-composer-model-label")
expect(label).not.toMatch(/display:\s*none/)
expect(label).toMatch(/position:\s*absolute/)
expect(label).toMatch(/clip-path:\s*inset\(50%\)/)
expect(label).toMatch(/width:\s*1px/)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function HarnessComposerControl() {
as={ButtonV2}
variant="ghost-muted"
size="normal"
class="max-w-[220px] justify-start ![font-weight:440]"
class="amicode-composer-harness min-w-0 max-w-[220px] justify-start ![font-weight:440]"
aria-label="Choose harness"
data-action="prompt-harness"
>
Expand Down
62 changes: 62 additions & 0 deletions packages/app-bundle/overlay/packages/app/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,65 @@
display: none;
}
}

/* amicode(#2189): the composer control row at narrow widths. The control
group (.amicode-composer-controls, session-ui prompt-input) is the row's only
flexible region; the trailing controls and Send never shrink.
- It clips on the x axis, so however long a label gets, no chip can paint
over the trailing controls or Send. `clip` (not `hidden`) leaves the y axis
visible; the 4px inline padding, cancelled by a -4px margin, keeps the
first and last chips' focus rings (2px + 2.5px offset) inside the clip.
- Every select chip may shrink below its label width, so a label that does
not fit ellipsizes (each label span is already `truncate`). Each chip's
trigger sits inside TooltipV2's `div[data-component="tooltip-v2-trigger"]`
(display: flex), and that wrapper is the row's flex item, so it needs
min-width: 0 too; otherwise its automatic min-width pins the chip at its
full label width. The add button keeps its size. */
.amicode-composer-controls {
overflow-x: clip;
padding-inline: 4px;
margin-inline: -4px;
}

.amicode-composer-controls :is(.amicode-composer-agent, .amicode-composer-model, .amicode-composer-variant, .amicode-composer-harness),
.amicode-composer-controls [data-component="tooltip-v2-trigger"]:has(:is(.amicode-composer-agent, .amicode-composer-model, .amicode-composer-variant, .amicode-composer-harness)) {
min-width: 0;
}

.amicode-composer-controls [data-component="tooltip-v2-trigger"]:has([data-action="prompt-attach"]) {
flex-shrink: 0;
}

/* amicode(#2189): the shed order. As the composer narrows, its chips leave
in an explicit priority order, widest breakpoint first:
variant (36rem) -> harness (32rem) -> model label (28rem) -> concise (26rem,
the #1633 rule above).
The agent chip and Send are never shed; the agent label ellipsizes instead.
The harness is never shed under a degraded harness: there the trio is
inert and the harness select is the only way back. The model chip goes
icon-only (provider icon + chevron); its label is visually hidden, not
removed, so the button keeps its accessible name. */
@container amicode-composer (max-width: 36rem) {
.amicode-composer-controls .amicode-composer-variant,
.amicode-composer-controls [data-component="tooltip-v2-trigger"]:has(.amicode-composer-variant) {
display: none;
}
}

@container amicode-composer (max-width: 32rem) {
.amicode-composer-controls:not([data-harness-degraded]) .amicode-composer-harness,
.amicode-composer-controls:not([data-harness-degraded]) [data-component="tooltip-v2-trigger"]:has(.amicode-composer-harness) {
display: none;
}
}

@container amicode-composer (max-width: 28rem) {
.amicode-composer-controls .amicode-composer-model-label {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,13 @@ export function PromptInputV2(props: PromptInputV2Props) {
</div>

<div class="flex h-11 items-center px-2">
{/* amicode#2189: the control group is the row's only flexible region.
It clips horizontally so a crowded chip can never paint over the
trailing controls or Send, and the app's `amicode-composer`
container query sheds its chips in priority order (index.css). */}
<div
class="flex min-w-0 flex-1 items-center gap-1"
class="amicode-composer-controls flex min-w-0 flex-1 items-center gap-1"
data-harness-degraded={props.harnessDegraded ? "" : undefined}
aria-hidden={state.mode === "shell"}
inert={state.mode === "shell" ? true : undefined}
style={buttons()}
Expand Down Expand Up @@ -254,6 +259,7 @@ export function PromptInputV2(props: PromptInputV2Props) {
title="Choose agent"
keybind={["Mod", "."]}
control={control}
class="amicode-composer-agent"
tourTarget="posture"
/>
)}
Expand Down Expand Up @@ -282,6 +288,7 @@ export function PromptInputV2(props: PromptInputV2Props) {
title="Choose model variant"
keybind={["Shift", "Mod", "D"]}
control={control}
class="amicode-composer-variant"
/>
</Show>
)}
Expand All @@ -298,7 +305,7 @@ export function PromptInputV2(props: PromptInputV2Props) {
</Show>
</div>
<Show when={props.trailingControl} keyed>
{(control) => <div class="mr-1 flex items-center">{control}</div>}
{(control) => <div class="mr-1 flex shrink-0 items-center">{control}</div>}
</Show>
<PromptInputV2SubmitButton
mode={state.mode}
Expand Down Expand Up @@ -576,13 +583,15 @@ function PromptInputV2ConfiguredSelect(props: {
control: PromptInputV2SelectControl
model?: boolean
tourTarget?: string
class?: string
}) {
const current = () => props.control.current()
const providerID = () => props.control.options().find((option) => option.id === current())?.providerID
return (
<PromptInputV2Select
title={props.title}
tourTarget={props.tourTarget}
class={props.class}
keybind={props.control.keybind?.() ?? props.keybind}
options={props.control.options()}
current={current()}
Expand Down
Loading