Skip to content

fix(ui): lay out the task form by container width, not viewport - #6355

Merged
atomantic merged 2 commits into
mainfrom
cos/task-mtp6743o/agent-306b4e64
Sep 6, 2026
Merged

fix(ui): lay out the task form by container width, not viewport#6355
atomantic merged 2 commits into
mainfrom
cos/task-mtp6743o/agent-306b4e64

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

The Quick Task dashboard widget squeezed its description textarea down to one character per line.

TaskAddForm keyed its layout off viewport breakpoints, but a dashboard tile is ~250px wide on a 2560px screen — so every sm: was unconditionally true and pinned the wide side-by-side row into the narrowest column. The expanded options overflowed the tile the same way, as did ReviewerPicker's ~32rem reviewer table.

Both components now declare @container on their own root and key their layout off container queries. The container lives on the component rather than the dashboard grid cell because ReviewerPicker also renders in SlashDoRunDrawer, the schedule panel and the Code Reviewers settings tab — none of which provide a container ancestor, so a cell-level container would leave those permanently stuck in the stacked form.

Thresholds are set from each layout's actual content minimum rather than copied across from the viewport values: the compact row goes horizontal at @xl (576px ≈ the old 640px viewport once page padding is subtracted, so phones keep the stacked form), the provider/model/effort row at @lg, and the reviewer table at @xl against its ~32rem grid.

Also guards the flex/grid items holding <select>s with min-w-0 so they shrink instead of overflowing, and wraps the rows whose contents can't. The two hover-vs-touch md: affordances stay viewport-based — those really are about the device, not the box.

client/src/components/dashboard/AGENTS.md records the convention, so the next page component reused as a widget doesn't reintroduce it.

Test plan

  • client suite: 620 tests / 48 files pass across components/cos, QuickTaskWidget, and responsiveGridConventions.test.js; the full suite is 866/868 files, with the 2 failures (a11yConventions, FableLoomStory.browser) reproducing identically on a clean origin/main worktree.
  • vite build succeeds; verified in dist/assets/index-*.css that container-type:inline-size and the @container (width>=24/32/36rem) tiers are emitted, and that Tailwind's scanner still extracts the 7-track grid template now that it lives in a WIDE_TRACKS constant.
  • Host widths checked against the new thresholds — the tightest (TaskConfigDrawer, size="md") leaves the picker 600px, above its 576px threshold.

The Quick Task dashboard widget squeezed its description textarea down to
one character per line. TaskAddForm's compact row keyed its layout off
viewport breakpoints, but a dashboard tile is ~250px wide on a 2560px
screen — so every `sm:` was unconditionally true and pinned the wide
side-by-side row into the narrowest column. The expanded options and the
reviewer table (a ~32rem grid) overflowed the tile the same way.

Both components now declare `@container` on their own root and key their
layout off container queries. The container lives on the component rather
than the grid cell because ReviewerPicker also renders in drawers, the
settings page and the schedule panel, none of which provide a container
ancestor — a cell-level one would leave those stuck in the stacked form.

Also guards the flex/grid items that hold selects with `min-w-0` so they
shrink instead of overflowing, and wraps the rows whose contents can't.
The hover-vs-touch `md:` affordances stay viewport-based; they really are
about the device.

Records the convention in the dashboard AGENTS.md so the next page
component reused as a widget doesn't reintroduce it.
@md (448px) sat well below the viewport `sm:` (640px) it replaced, so a
phone would have gone horizontal where it used to stack — leaving the
textarea ~200px. @XL (576px) is roughly that old threshold once page
padding is subtracted, and it's where the textarea, the 10rem app picker
and the Add button each still get usable width.

Same reasoning moves the provider/model/effort row to @lg: two 10rem
selects plus a flexible model select don't fit in 448px.
@atomantic
atomantic merged commit a7e4b8a into main Sep 6, 2026
7 checks passed
@atomantic
atomantic deleted the cos/task-mtp6743o/agent-306b4e64 branch September 6, 2026 02:37
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.

1 participant