OpenProgram Docs

Responsive composer controls

Each row responds to its own measured width, with no fixed breakpoint: chat and DAG pages have different controls at the same width. Menus, values, keyboard, tooltips and accessible names never change.

Environment row

LevelShows
0Everything
1Names capped near 12 characters with an ellipsis; environment chip icon-only
2Branch names hidden: branch icon and diff badge
3 (data-compact)Every label hidden (status, surface, project, directory, DAG Fit, zoom percentage, Legend); diff badge becomes a half-green, half-red dot

use-compact-environment-row.ts lays the row out per level with transitions off (data-measuring), then animates to the first data-squeeze level that fits clientWidth. It measures the last chip's right edge with auto margins zeroed: that margin makes scrollWidth always fill the row. Roomier levels need 12px of slack. Split panes use the same logic.

Control row

AspectRule
Measureuse-compact-controls-row.ts sums clusters and gap in a hidden max-content copy beside .composer-bottom-row, removed before paint
CompactSets data-compact when the sum exceeds the width: permission, model and effort labels collapse to Shield, Message, Terminal and Biceps icons
ExpandNeeds 12px of slack
Re-measures onResize, content or class changes, web-font load
Why a copyThe live row is never toggled: its Buttons transition every property, so it would still report compact widths

Rules

  • One row, never wrapping; no control hidden. Composer height and splitRatio do not change.
  • Labels do not flex-shrink. A capped name ends in an ellipsis. One transition rule, no display:none.
  • Icon triggers keep size, order and operation; chat and execution use distinct icons; effort-icon colour shows the level.
  • Native ResizeObserver and MutationObserver; model, permission and effort state untouched.

Bottom control surface

StateSurfaceUnchanged
Restingbackground:var(--chip-bg); border 0, no shadow20px height, 5px radius, icon and label colours
Hover, open8% of --chip-bg mixed into --text-brightMenus, tooltips, animations, effort colours
NarrowAs restingTriggers stay 20px icon buttons

focus-visible indicators stay.

Context popover

ContextBreakdownPanel unmounts when closed, so a cache prevents a Loading-only card on reopen.

CaseShows at onceBackground
Same session and branchLast complete statisticsRequest, update in place
First open, no cacheLoading stateRequest, cache on success
Other session or branchCache for that sessionId + headIdOld request cancelled, cannot overwrite
Refresh failsCached contentNo error page

Frontend process only, 32 branches, least recently used out (apps/web/lib/chat/context-breakdown-cache.ts). For concurrent refreshes of one key the newest wins.

Component boundaries
Under composer/DoesDoes not
environment-row/environment-row.tsxComposes chips, renders caller-supplied trailing contentDAG names, portal ids, submission, project state
environment-row/use-compact-environment-row.tsMeasures and sets levelRender or style
environment-row/environment-row.module.cssLayout, pills, squeeze animation, DAG slotInput or bottom controls
environment-row/chips/channel-chip, environment-chip, web-surface-chip, worktree-chipThe row's responsive state
input/Textarea, keyboard, history callbacksSend or switch mode
attach/, paste/, modes/question/Component and its CSS Module togetherSelectors in the root module
submit/Build and submit messages, side effectsRender the input
modes/composer-body.tsxSelects input, function form or question formOwn input, attachment or session state
state/use-composer-settings.tsSettings for the current SessionScopeGlobal focused-session fallback
controls/use-*.tsModel availability, tool profiles, unattended stateSync in the Composer root
index.tsxPasses arguments, renders one EnvironmentRowHold refs, observers or row JSX

The DAG module owns its HUD and supplies it through EnvironmentRow's trailing slot. ProjectBadge, WorkingDirChips and GoalChip stay in shared modules. Check: apps/web/scripts/chat/check-composer-environment-row.mjs.

Options compared
OptionOutcome
Container queriesOnly for the context ring label and effort card width: the row's need is not a function of width alone
Accessible namesReuse tooltips, triggers and labels; visual hiding keeps DOM semantics
Horizontal scrollingFallback for extremely narrow widths only
Wrap to two rowsRejected: changes composer height and transcript spacing
Acceptance
  1. Overflow squeezes through data-squeeze to data-compact, with no fixed-width cases or label flex-shrink:1.
  2. All labels share one animation rule.
  3. Past the split-pane threshold, all right-hand settings and left permission and more controls stay visible without overlap.
  4. Permission, chat model, execution model and effort icons each open their menu.
  5. Widening returns all labels; reselecting split, switching chat and DAG, and refreshing preserve this.
  6. Bottom controls have a non-transparent surface at rest, border 0, no shadow, and a stronger background on hover or open.
  7. Reopened Context statistics come from the cache; background completion updates cache and ring.
  8. Cache isolated by session and branch; stale requests cancelled; failed refreshes keep the cache; 32-entry eviction.
Last updated · 2026-11-25