Skip to content

feat(studio): converge card, table, tooltip, and input with the prototype - #2226

Merged
kantord merged 7 commits into
mainfrom
feat/studio-foundation-2204b
Oct 13, 2026
Merged

kantord merged 7 commits into
mainfrom
feat/studio-foundation-2204b

Conversation

@peppescg

@peppescg peppescg commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is the second slice of the Studio alignment foundation (#2204, part of #2210). It is stacked on #2225 and should merge after it. It brings the card, table, tooltip, and input primitives in line with the prototype. It also retires Studio's own ui/sortable-head in favour of the prototype's sort hook, and takes the one styles.css cherry-pick that has a consumer. Behaviour stays the same. The visible changes are listed below and backed by before/after screenshots.

What changed

card

  • Every part carries a data-slot, and CardAction is exported.
  • CardHeader is the prototype's @container/card-header grid. It opens a right-hand action column when a CardAction is present.
  • A bordered header or footer pads itself away from the body.
  • Studio's card tokens are unchanged.
  • No Studio surface renders Card yet, so nothing on screen changes.

table and the sortable head

  • Table takes a containerClassName for its scroll wrapper.
  • Heads and cells use the prototype's px-4 / py-3 padding.
  • NestedTableRow, NestedTableRowTrigger, and CollapsibleTableRows add expandable sub-rows, driven by ChevronIndicator from feat(studio): add the @/ alias and port the prototype's foundation primitives and utilities #2225.
  • TableRow drops the stock has-aria-expanded:bg-muted/50, as the prototype does.
  • components/ui/sortable-head.tsx and its test are removed. The prototype's components/sortable-head.tsx replaces them:
    • useTableSort owns the sorted column and its direction.
    • directed() applies the direction to a comparison.
    • SortableHead takes the sort state and its column key.
  • The configured-skills table moves onto useTableSort, and skill-inventory sorts through directed(). The table's explicit px-4 / py-3 overrides are dropped because the new defaults supply the same padding.
  • The memory Facts about you table, which feat(studio): align memory settings and fact detail with the prototype #2222 added on the retired head, also moves onto useTableSort / SortableHead (99c9b20cb).

tooltip

  • Each Tooltip carries its own TooltipProvider, so it works without an app-level provider. delayDuration defaults to 0; it was 200 ms.

  • The parts carry data-slot. TooltipContent sits flush to its trigger (sideOffset 0, was 4) and has the prototype's rounded-square arrow.

  • Tooltip onlyWhenTruncated, backed by use-is-truncated from feat(studio): add the @/ alias and port the prototype's foundation primitives and utilities #2225, opens only while the trigger's text overflows.

  • Studio's workspace-level TooltipProvider stays and still type-checks, but the per-Tooltip provider now sets the delay.

  • Native title= attributes are replaced with Tooltip onlyWhenTruncated on three chat labels that truncate text:

    Label File
    The file path in an Edit or Write diff header features/chat/edit-diff.tsx
    The streaming reasoning preview features/chat/reasoning-disclosure.tsx
    An attached image's file name features/chat/chat-composer.tsx

    The full text stays in the label, so screen readers read it as before. The tooltip content is capped at min(32rem, 100vw - 2rem) and wraps.

  • The other title= attributes in features/ stay. They are disabled-action reasons (session sidebar, chat header, learning review, memory consolidation), resize-handle and button hints, the token-usage breakdown, the minimap marker label, and the model card's title={model.id}, whose ID is already shown in full. None of them is a truncated label.

input

#2211 replaced the input with the prototype's verbatim. That brought in the aria-invalid:, file:, and selection: states, but it also replaced Studio's contrast-hardened edges (from #1873) with the prototype's border-input and translucent 3px ring. Both fall below 3:1 non-text contrast.

This PR keeps the prototype's states and restores border-control-border and the solid focus-visible:ring-2 focus-visible:ring-ring. An invalid field focuses with a solid destructive ring instead of the prototype's translucent one.

styles.css cherry-picks

  • thinking-bounce keyframe: taken. The streaming indicator's dots now use animate-[thinking-bounce_0.9s_infinite] instead of the identical keyframe the component declared in an inline <style>.
  • iOS standalone body background: already in Studio, since html, body are painted with --shell-gradient-end. The rule now carries the prototype's comment explaining why.
  • hide-scrollbar: not taken. Its only consumer in the prototype is the composer's pill toolbar, which Studio does not have yet.

Tokens, palettes, the appearance store, storage keys, the boot script, and the 16px root font size are unchanged. No dependencies changed.

Differences from the prototype

File Difference
components/ui/card.tsx, table.tsx, tooltip.tsx None apart from Biome formatting (line width 100).
components/sortable-head.tsx SortableHead also sets aria-sort (ascending, descending, or none) on its header cell. The prototype's has none. Studio's retired head had it, and its tests assert it.
components/ui/input.tsx border-control-border instead of border-input. focus-visible:ring-2 focus-visible:ring-ring instead of ring-[3px] ring-ring/50. aria-invalid:ring-destructive instead of /20 with a dark /40. Plus a comment saying why.
styles.css The keyframe and the iOS comment are verbatim. Studio keeps its own margin: 0 on html, body.
features/chat/streaming-indicator.tsx The dot markup and doc comment are the prototype's. The component keeps Studio's phaseLabel prop. The prototype derives the phase and start time from the message, which belongs to the chat feature port.
Tests All are new and written for Studio's no-isolate rules. The prototype has no tests for these primitives.

Visible changes

  1. Every Input gets a darker border and a solid focus ring. The border was --input (light hsl(240 5.9% 90%), dark hsl(0 0% 20.4%)) and is now --control-border (#83838a / #8c8c8c). The focus ring was a translucent 3px ring and is now a solid 2px --ring. Inputs now match Textarea and look as they did before feat(studio): add shadcn primitives from the prototype and upstream shadcn #2211. Affected surfaces: the Skills filter, Settings → Profile display name, Settings → Agent name, the schedule form's text, time, and number fields, and the chat rename field.
  2. The Skills table's inactive sort column reads in the foreground colour. Its label was muted. The both-ways icon is now text-muted-foreground/60. Desktop only, because the phone list has no headers.
  3. Tooltips open without the 200 ms delay and sit 4px closer to their trigger. This applies to the top-nav icons.
  4. Long chat labels show a styled tooltip instead of the browser's native title. The tooltip appears on hover, and only while the label is cut off. Before, the native title appeared even when the label fit. This applies to diff paths, the reasoning preview, and image names.

Nothing else changes on screen. The card and table padding changes have no rendered call site that differs, and the streaming dots compute the same animation (0.9s infinite, delays 0ms / 160ms / 320ms). Only the keyframe name changes, from streaming-indicator-bounce to thinking-bounce.

For #2194 (schedules) once this lands

#2194 imports the retired components/ui/sortable-head. It needs these changes:

  • features/schedules/schedules-workspace.tsx:
    • Import SortableHead, useTableSort, and type TableSort from @/components/sortable-head.
    • Replace the useState<{ direction; key }>({ direction: "asc", key: "status" }) and changeSort pair with const sort = useTableSort<ScheduleInventoryOrder>("status"). The toggle semantics are identical: the active column flips, and a new column starts ascending.
    • Pass sort.key and sort.dir to deriveScheduleInventory.
    • In the inventory table, replace the sort / onSort props with sort: TableSort<ScheduleInventoryOrder>. Each <SortableHead direction label onSort> becomes <SortableHead label sort={sort} sortKey="…">.
    • The px-4 / px-4 py-3 overrides on heads and cells are now the defaults and can go.
    • The rows hold the actions DropdownMenu. TableRow no longer highlights a row while its menu is open (has-aria-expanded:bg-muted/50 is gone), so add that class to those rows to keep the highlight.
  • features/schedules/schedule-detail.tsx: run history switches to the Ran column descending, and to other columns ascending. useTableSort always starts a new column ascending. To keep the current behaviour exactly, keep the local state and pass sort={{ dir: direction, key: sortKey, toggle: changeSort }}, because TableSort is a plain interface. Rename SortDirection to SortDir.
  • features/schedules/schedule-inventory.ts: change import type { SortDirection } from "../../components/ui/sortable-head" to import type { SortDir } from "@/components/sortable-head". directed() can replace the local sign if wanted.
  • Tests: aria-sort and the header button names (the column labels) are unchanged, so tests that select by them keep working. The inactive header label colour change applies to the schedules tables too.

No regression

Gates, compared with #2225's baseline

Both branches are on origin/main aa1979c1d, which includes #2222.

Gate #2225 (slice a, db98c3768) This PR
task studio:check: Biome 408 files 415 files, clean
task studio:check: typecheck clean clean
task studio:check: server tests 24 files / 187 tests 24 files / 187 tests
task studio:check: web tests 123 files / 769 tests 130 files / 802 tests
task studio:check: generated-artifact check clean clean
task studio:browser 54 passed 54 passed (desktop and mobile Chromium)

Web tests gain 8 files and 35 tests, and lose 1 file and 2 tests: the retired ui/sortable-head.test.tsx, whose assertions move with the component. The Error: socket hang up line in the web test output is pre-existing; it appears on the slice-a tip too.

Pinned behaviour

  • features/knowledge/knowledge-workspace.sort.test.tsx (new, 5 tests). It was committed before the swap, in its own commit, and passes against both the old ui/sortable-head and the new useTableSort. It drives only the rendered table and pins:

    • the default sort: name ascending, case-insensitive, numeric collation;
    • header clicks: the active column flips, and a new column starts ascending;
    • the direction-independent name tiebreak;
    • Enter and Space on the header buttons, and Tab between them;
    • aria-sort on both columns;
    • the phone list keeping plain localeCompare name order whatever the table sort;
    • sorting the filtered rows.

    The A/B run, with the old sort code checked out: 4 files / 18 tests passed. With HEAD: 4 files / 23 tests passed. Both runs cover the pinned test, knowledge-workspace.test.tsx, skill-inventory.test.ts, and the sortable-head test.

  • components/sortable-head.test.tsx carries over the retired ui/sortable-head.test.tsx. Both of its assertions survive with only the props adapted to the new API:

    • aria-sort is none, ascending, or descending for an inactive, ascending, or descending column;
    • one header click makes exactly one call, now toggle("name") instead of onSort().
  • features/chat/truncated-text-tooltips.test.tsx (new, 4 tests). For each converted label (Edit diff, Write diff, reasoning preview, image name), it checks that:

    • the full text stays in the label;
    • a truncated label shows the full text in a tooltip on hover;
    • a label that fits shows no tooltip.

    The composer's Preview and Remove buttons keep their accessible names.

  • components/ui/tooltip.test.tsx covers a tooltip without a provider, a tooltip inside Studio's app-level provider, the controlled open prop, and onlyWhenTruncated opening and closing as the trigger overflows.

  • features/chat/streaming-indicator.test.tsx pins three dots on thinking-bounce with 0/160/320 ms delays, the keyframe's 5px hop in styles.css, the phase label, and the elapsed-time counter.

  • No existing test was modified or weakened. knowledge-workspace.test.tsx and skill-inventory.test.ts are unchanged and pass. The only removed test file is ui/sortable-head.test.tsx, described above.

Facts about you (memory), added after the rebase onto #2222

facts-about-you.test.tsx gains a test that pins the existing sort: name ascending by default; a new column starts ascending; the active column flips; equal descriptions fall back to name ascending in both directions; aria-sort on each header. It passed 7/7 on #2225's head (old ui/sortable-head) before the migration, and passes on this branch.

The Facts about you screenshots below show row order and content pixel-identical in every sort state. The only difference is the inactive header label's colour (muted → foreground), the same intended change as the skills table. The mobile pairs, where the header is hidden, are pixel-identical.

Screenshots

Captured with a throwaway Playwright journey (Chromium, not committed) that reuses e2e/fixtures.ts with offline BFF routes. Each surface was shot at desktop 1280×800 and mobile 390×844, in light and dark; hover and header states are desktop only, because the phone layouts have no table headers or hover. Before is #2225's head (db98c3768), after is this PR's head (60af5fd63). Every pair was pixel-compared; red boxes mark the regions that differ. Desktop composites are downscaled to 1600px wide. A browser's native title tooltip is not part of a page screenshot, so the before side of each truncated-label hover shows no tooltip. No Studio form sets aria-invalid on an Input, so that state has no rendered surface to capture.

Skills table (SortableHead, useTableSort)

Skills, default sort

Intended change: the Filter input's border is darker, and on desktop the inactive Description header reads in the foreground colour with a lighter both-ways icon. Rows are identical.

Skills, default sort, desktop light

Dark and mobile

Desktop, dark:

Skills, default sort, desktop dark

Mobile, light:

Skills, default sort, mobile light

Mobile, dark:

Skills, default sort, mobile dark

Description clicked (ascending)

Intended change: the inactive Name header reads in the foreground colour, and the Filter border is darker. Row order is identical.

Description clicked (ascending), desktop light

Dark

Desktop, dark:

Description clicked (ascending), desktop dark

Description clicked again (descending)

Intended change: as above. Row order is identical.

Description clicked again (descending), desktop light

Dark

Desktop, dark:

Description clicked again (descending), desktop dark

Header hover (Description)

Intended change: while hovered, the inactive column's both-ways icon stays muted. The boxed line at the top is the Filter input's bottom edge, whose border is darker.

Header hover (Description), desktop light

Dark

Desktop, dark:

Header hover (Description), desktop dark

Settings → Memory, Facts about you (SortableHead)

Default sort (Name ascending)

Intended change: the inactive Remembers header reads in the foreground colour. Rows are identical. Mobile has no header, so it is identical.

Default sort (Name ascending), desktop light

Dark and mobile

Desktop, dark:

Default sort (Name ascending), desktop dark

Mobile, light:

Default sort (Name ascending), mobile light

Mobile, dark:

Default sort (Name ascending), mobile dark

Remembers ascending

Intended change: the inactive Name header colour. Row order is identical.

Remembers ascending, desktop light

Dark

Desktop, dark:

Remembers ascending, desktop dark

Remembers descending

Intended change: the inactive Name header colour. Row order is identical.

Remembers descending, desktop light

Dark

Desktop, dark:

Remembers descending, desktop dark

Header hover (Name)

Intended change: while hovered, the inactive column's both-ways icon stays muted.

Header hover (Name), desktop light

Dark

Desktop, dark:

Header hover (Name), desktop dark

Inputs (border-control-border, solid focus ring)

Skills Filter, focused

Intended change: a solid 2px ring replaces the translucent 3px ring.

Skills Filter, focused, desktop light

Dark and mobile

Desktop, dark:

Skills Filter, focused, desktop dark

Mobile, light:

Skills Filter, focused, mobile light

Mobile, dark:

Skills Filter, focused, mobile dark

Settings → Profile, display name

Intended change: the field border is darker.

Settings → Profile, display name, desktop light

Dark and mobile

Desktop, dark:

Settings → Profile, display name, desktop dark

Mobile, light:

Settings → Profile, display name, mobile light

Mobile, dark:

Settings → Profile, display name, mobile dark

Settings → Profile, display name focused

Intended change: the solid 2px focus ring.

Settings → Profile, display name focused, desktop light

Dark and mobile

Desktop, dark:

Settings → Profile, display name focused, desktop dark

Mobile, light:

Settings → Profile, display name focused, mobile light

Mobile, dark:

Settings → Profile, display name focused, mobile dark

Settings → Agent, agent name

Intended change: the field border is darker.

Settings → Agent, agent name, desktop light

Dark and mobile

Desktop, dark:

Settings → Agent, agent name, desktop dark

Mobile, light:

Settings → Agent, agent name, mobile light

Mobile, dark:

Settings → Agent, agent name, mobile dark

Schedule task form

Intended change: the text, time and number field borders are darker, and the focused Name field has the solid ring. The textarea and select are unchanged.

Schedule task form, desktop light

Dark and mobile

Desktop, dark:

Schedule task form, desktop dark

Mobile, light:

Schedule task form, mobile light

Mobile, dark:

Schedule task form, mobile dark

Chat rename field, focused

Intended change: the darker border and solid focus ring.

Chat rename field, focused, desktop light

Dark

Desktop, dark:

Chat rename field, focused, desktop dark

Tooltips

Top-nav tooltip (Chats)

Intended change: the tooltip sits 4px closer to the icon and has the prototype's rounded-square arrow.

Top-nav tooltip (Chats), desktop light

Dark

Desktop, dark:

Top-nav tooltip (Chats), desktop dark

Truncated diff path, hovered

Intended change: the styled tooltip shows the full path.

Truncated diff path, hovered, desktop light

Dark

Desktop, dark:

Truncated diff path, hovered, desktop dark

Truncated reasoning preview, hovered

Intended change: the styled tooltip shows the full reasoning line.

Truncated reasoning preview, hovered, desktop light

Dark

Desktop, dark:

Truncated reasoning preview, hovered, desktop dark

Truncated image name, hovered

Intended change: the styled tooltip shows the full file name.

Truncated image name, hovered, desktop light

Dark

Desktop, dark:

Truncated image name, hovered, desktop dark

Unchanged chat surfaces and streaming dots (thinking-bounce)

Streaming run, thinking dots

Identical on desktop. The dots compute the same animation on both trees (0.9s infinite), only the keyframe name changes. Mobile differs by 113–153 px of at most 2/255 per channel on the composer bar's rounded corners, which is invisible.

Streaming run, thinking dots, desktop light

Dark and mobile

Desktop, dark:

Streaming run, thinking dots, desktop dark

Mobile, light:

Streaming run, thinking dots, mobile light

Mobile, dark:

Streaming run, thinking dots, mobile dark

Edit diff in the transcript

Identical on desktop. Mobile has the same invisible corner anti-aliasing as above.

Edit diff in the transcript, desktop light

Dark and mobile

Desktop, dark:

Edit diff in the transcript, desktop dark

Mobile, light:

Edit diff in the transcript, mobile light

Mobile, dark:

Edit diff in the transcript, mobile dark

Transcript and composer

Identical.

Transcript and composer, desktop light

Dark and mobile

Desktop, dark:

Transcript and composer, desktop dark

Mobile, light:

Transcript and composer, mobile light

Mobile, dark:

Transcript and composer, mobile dark

Composer with an attached image

Identical.

Composer with an attached image, desktop light

Dark and mobile

Desktop, dark:

Composer with an attached image, desktop dark

Mobile, light:

Composer with an attached image, mobile light

Mobile, dark:

Composer with an attached image, mobile dark

Together with #2225 this completes #2204. The items the issue lists as deferred to the feature port that needs them stay open in #2210.

Re-verification (2026-10-11)

Re-verified at this head: no change needed. The app-level TooltipProvider nit stays open (optional).

Closes #2204

🤖 Generated with Claude Code

peppescg and others added 7 commits October 13, 2026 11:41
Port the prototype's card: every part carries a data-slot, CardAction
joins the exports, and CardHeader becomes the @container/card-header grid
that opens a right-hand action column when a CardAction is present. A
bordered header or footer pads itself away from the body. Studio's card
surface tokens are unchanged.

No Studio surface renders Card today, so nothing on screen changes.

Refs #2204

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Before the skills table moves onto the prototype's sortable head, pin
what a user sees: name ascending by default with case-insensitive
numeric collation, a header click flipping the active column and
starting another column ascending, the direction-independent name
tiebreak, Enter and Space on the header buttons, aria-sort on both
columns, the phone list keeping plain name order, and sorting what the
filter leaves.

The test drives only the rendered table, so it runs unchanged against
the current SortableHead and its replacement.

Refs #2204

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Port the prototype's table: Table takes a containerClassName for its
scroll wrapper, heads and cells use the prototype's px-4 / py-3 padding,
and NestedTableRow, NestedTableRowTrigger, and CollapsibleTableRows add
expandable sub-rows driven by ChevronIndicator. TableRow drops the
stock has-aria-expanded highlight, as the prototype does.

Retire components/ui/sortable-head.tsx for the prototype's
components/sortable-head.tsx: useTableSort owns the column and
direction, directed() applies the direction to a comparison, and
SortableHead takes the sort state and its column key. Studio keeps
aria-sort on the header cell, which the prototype lacks.

The configured-skills table moves onto useTableSort and drops the
padding overrides the new defaults now supply; skill-inventory sorts
through directed(). Sorting behaves as before. The one visible change is
the inactive sortable column: its label now reads in the foreground
colour with a muted icon, instead of a muted label.

Refs #2204

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Port the prototype's tooltip. Each Tooltip now carries its own
TooltipProvider, so a tooltip works without an app-level provider and
opens without delay (delayDuration 0, was 200 ms). The parts carry
data-slot, TooltipContent sits flush to its trigger with a rounded
square arrow, and Tooltip gains onlyWhenTruncated: backed by
useIsTruncated, it opens only while the trigger's text overflows.
Studio's workspace-level TooltipProvider stays and still type-checks,
but the per-Tooltip provider now decides the delay.

Replace the native title= on the three chat labels that ellipsise text
with Tooltip onlyWhenTruncated: a diff's file path (Edit and Write
blocks), the streaming reasoning preview, and an attached image's file
name. The full text stays in the label, so screen readers read it as
before; a sighted user now sees it in a styled tooltip, and only when
it is cut off. Other title= attributes are disabled-reason hints,
resize-handle hints, or labels that never truncate, and stay as they
are.

Refs #2204

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
#2211 replaced the input with the prototype's verbatim, which brought
the prototype's aria-invalid, file:, and selection: states but also
swapped Studio's border-control-border and solid ring-2 ring-ring focus
ring for the prototype's border-input and translucent 3px ring. Those
fall below 3:1 non-text contrast, which #1873 had fixed.

Keep the prototype's states and restore Studio's border and focus ring.
An invalid field focuses with a solid destructive ring rather than the
prototype's translucent one, for the same reason. Inputs look as they
did before #2211: a darker border at rest and a solid ring on focus.

Refs #2204

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Declare the prototype's thinking-bounce keyframe in styles.css and move
the streaming indicator's dots onto it through
animate-[thinking-bounce_0.9s_infinite], replacing the identical
keyframe the component declared in an inline <style>. The dots bounce
exactly as before.

Studio already paints html and body with --shell-gradient-end, which is
the prototype's iOS standalone fix; it gains the prototype's comment
explaining why. hide-scrollbar is not taken: its only prototype consumer
is the composer's pill toolbar, which Studio does not have yet.

Tokens, palettes, the appearance store, storage keys, the boot script,
and the 16px root font size are unchanged.

Refs #2204

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
#2222 added the memory Facts about you table on the retired
ui/sortable-head. It now uses useTableSort and SortableHead from
components/sortable-head, like the skills table.

A new test pins the existing behaviour, and it passes on both the old
and the new head: name ascending by default, a new column starts
ascending, the active column flips, the name tie-break stays ascending,
and aria-sort on each header.

Refs #2204

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@kantord
kantord force-pushed the feat/studio-foundation-2204b branch from 60af5fd to 780bba9 Compare October 13, 2026 08:42
@kantord
kantord merged commit 23c3659 into main Oct 13, 2026
31 checks passed
@kantord
kantord deleted the feat/studio-foundation-2204b branch October 13, 2026 10:54
kantord added a commit that referenced this pull request Oct 13, 2026
#2226 replaced components/ui/sortable-head with the prototype's
components/sortable-head (useTableSort, SortableHead). Move the inventory
and run-history tables to it: the inventory uses useTableSort, the run
history keeps its newest-first local state, and cells and heads drop their
explicit padding now that it is the table default.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 13, 2026
2 tasks
@kantord kantord mentioned this pull request Oct 14, 2026
41 tasks done
@kantord

kantord commented Oct 14, 2026

Copy link
Copy Markdown
Member

Post-merge review follow-ups for this PR. No blockers or regressions found. Items worth tracking were filed here:

Other candidate findings were checked and dropped as not worth tracking.

Fully or partially written by an AI agent.

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.

Studio alignment: foundation — @/ alias, primitive APIs, shared hooks and lib

2 participants