fix(app): tighten the leading inset of composer pills with an icon

A pill that starts with an icon now sits it 8px from the edge with a 6px gap to its
label, through one rule on the shared pill instead of the todo pill's own override.
Pills without an icon keep 10px on both sides. The activity menu's rows follow the
capsule's new inset and gap.
This commit is contained in:
Aarav Sareen 2026-10-29 22:02:21 +05:30
parent 49313238aa
commit 581eb0e1bf
6 changed files with 28 additions and 17 deletions

View file

@ -8,7 +8,7 @@
/*
* The open panel sits just above the capsule, with their inline-start edges aligned, and its rows share the capsule's
* grid: the same hairline and 10px inset put row glyphs on the capsule's glyph, and the same 16px glyph and 8px gap put
* grid: the same hairline and 8px inset put row glyphs on the capsule's glyph, and the same 16px glyph and 6px gap put
* row text on the capsule's label. Rows are subgrids of one table, so agent names, descriptions and run times each
* line up in a column; descriptions take the remaining width and truncate only when the panel reaches its maximum.
*/
@ -37,7 +37,7 @@
display: grid;
grid-template-columns: auto auto minmax(0, 1fr) auto;
align-content: start;
column-gap: 8px;
column-gap: 6px;
}
[data-slot="menu-v2-item-content"] > span[dir] {
@ -49,7 +49,7 @@
unicode-bidi: isolate;
}
/* With the list's 4px padding, rows inset 10px like the capsule's content, at the end as at the start. */
/* With the list's 4px padding, rows inset 8px like the capsule's content, at the end as at the start. */
[data-component="menu-v2-item"],
[data-slot="menu-v2-item-content"] {
display: grid;
@ -59,7 +59,7 @@
}
[data-component="menu-v2-item"] {
padding-inline: 6px;
padding-inline: 4px;
border-radius: 4px;
}

View file

@ -180,7 +180,9 @@ export function SessionActivityChips(props: {
class="tabular-nums duration-150 ease-out motion-reduce:animate-none"
classList={{ "animate-in fade-in": view().enter }}
>
<SessionProgressIndicatorV2 class="shrink-0" />
<span data-composer-pill-icon class="flex size-4 shrink-0 items-center justify-center">
<SessionProgressIndicatorV2 />
</span>
<span data-slot="session-activity-summary" class="flex min-w-0 items-center gap-2 overflow-hidden">
{language.activitySummaryRich(counts(), (text) => (
<span class="truncate">

View file

@ -59,6 +59,12 @@
}
}
/* A leading icon sits closer to the edge and to its label than text does. */
[data-composer-pill]:has(> [data-composer-pill-icon]:first-child) {
gap: 6px;
padding-inline-start: 8px;
}
/* The popover a pill opens, just above it. */
[data-composer-pill-panel] {
max-width: calc(100vw - 56px);

View file

@ -193,7 +193,11 @@ function Content(props: {
<Show when={props.pill.icon} fallback={<PillIcon name={props.view.icon} tone={props.view.tone} />}>
{(icon) => (
// Its own contribution: an icon that throws shows nothing and the pill keeps working.
<span data-slot="session-plugin-pill-icon" class="flex size-4 shrink-0 items-center justify-center">
<span
data-slot="session-plugin-pill-icon"
data-composer-pill-icon
class="flex size-4 shrink-0 items-center justify-center"
>
<Contribution plugin={props.plugin}>{() => icon()(props.input)}</Contribution>
</span>
)}
@ -209,11 +213,13 @@ function PillIcon(props: { name?: IconName; tone?: ComposerPillTone }) {
return (
<Show when={props.name}>
{(name) => (
<Icon
name={name()}
size="small"
class={`shrink-0 ${props.tone ? tones[props.tone] : "text-v2-icon-icon-muted"}`}
/>
<span data-composer-pill-icon class="flex size-4 shrink-0 items-center justify-center">
<Icon
name={name()}
size="small"
class={`shrink-0 ${props.tone ? tones[props.tone] : "text-v2-icon-icon-muted"}`}
/>
</span>
)}
</Show>
)

View file

@ -1,8 +1,3 @@
[data-composer-pill][data-slot="session-todo-pill"] {
gap: 6px;
padding-inline-start: 8px;
}
[data-composer-pill-panel][data-slot="session-todo-panel"] {
width: max-content;
min-width: max(var(--kb-popper-anchor-width, 0px), 240px);

View file

@ -44,7 +44,9 @@ export function SessionTodoPill(props: { todos: readonly Todo[]; defaultOpen?: b
<Show when={current()}>
{(todo) => (
<>
<TodoGlyph status={todo().status} />
<span data-composer-pill-icon class="flex size-4 shrink-0 items-center justify-center">
<TodoGlyph status={todo().status} />
</span>
<span dir="auto" class="min-w-0 max-w-[260px] truncate">
{todo().content}
</span>