Skip to content

refactor(ui): quiet composer chrome - #1835

Merged
Astro-Han merged 8 commits into
mainfrom
refactor/composer-quiet-chrome
Aug 1, 2026
Merged

refactor(ui): quiet composer chrome#1835
Astro-Han merged 8 commits into
mainfrom
refactor/composer-quiet-chrome

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Quiet the resting composer chrome so the footer is + · permission · model (+ thinking) · send, with attach / skills / Plan·Swarm·Graph packed into the + menu and staged context as drawer Tokens.

  • Resting surface: ghost + and permission icon, model + separate thinking-level Selector (short zh labels), send; mic only when the host wires capture.
  • Modes use Astryx DropdownMenuCheckboxItem (single menuitemcheckbox path, not nested Switch).
  • Skill panel from + is hideTrigger-controlled, anchored to left-controls, Esc returns focus to +.
  • Product-wide native-cursor.css: hand cursor for links only; neutralize StyleX pointer on interactive roles and Astryx Selector shells (fixes intermittent hand on model/thinking chevron).
  • E2E/unit contracts updated for quiet chrome, skill tokens, and cursor ownership.

Verification

  • npm --workspace @maka/ui test — 294 pass
  • npm --workspace @maka/ui run typecheck — pass
  • npm --workspace @maka/desktop run build:main + node --test …/native-cursor-contract.test.js — pass (earlier in branch work)
  • Electron Playwright not re-run in this environment (prior SIGABRT/EPERM); skill/mode E2E selectors updated for tokens and menuitemcheckbox
  • Storybook :6007 used for visual check of empty chat / thinking-level-separate during development

Review focus

  • Footer IA and Astryx primitive choices (CheckboxItem, Selector, Token drawer)
  • native-cursor.css ownership vs per-control patches; Selector shell rule necessity
  • Skill hideTrigger focus + left-controls anchoring

@Astro-Han
Astro-Han force-pushed the refactor/composer-quiet-chrome branch 2 times, most recently from cbe9650 to 3d1a083 Compare August 1, 2026 14:52
Collapse attach, skills, and Plan/Swarm/Graph into +; permission as ghost
icon; model + separate thinking Selector; staged context as drawer Tokens.
Product native-cursor (links only) including Astryx Selector shell.
Restore DropdownMenuCheckboxItem for modes; skill hideTrigger anchors to
left-controls with Esc focus back to +. Gate mic on recognition config.
main landed a per-control cursor:default !important on tool/reasoning
triggers; the product sheet already covers role=button. Remove the
duplicate so the native-cursor contract stays green.
closeSettings already re-reads default permission; gate the quiet mic the
same way so in-app voice config is not stuck waiting for the file watcher.
Drop retired composer chrome CSS/copy and the unused permission quiet
appearance; neutralize FieldLabel/TreeList pointer under native-cursor.
native-cursor and model-switcher target .astryx-selector / multi-selector
theme classes that never appear as Maka className literals. Drop the
retired .maka-composer-context-items rule so the baseline stays at 0.
Scope + to .maka-composer-plus-menu and use exact names so permission
"权限模式" and drawer collapse no longer false-match. Expect permission
tooltip-backed description; target quote Tokens instead of retired chips.
Avoid matching ChatComposerDrawer collapse when a mode token is already staged.
Delete toolbar and mode-indicator specs — plus/menu structure and mode
tokens are locked by UI SSR unit tests. Permission E2E keeps confirm and
Auto change only; quote companion asserts token count and panel text, not
truncated Token labels. Drop the test-only quote-token class.
After main skill coverage prune, function-block-helpers is unreferenced.
Permission journey keeps full-access confirm cancel only; Auto is already
covered by the sandbox-expansion + reload case (avoid flaky second open).
@Astro-Han
Astro-Han force-pushed the refactor/composer-quiet-chrome branch from 58f0f02 to bbe8684 Compare August 1, 2026 15:34
@Astro-Han
Astro-Han merged commit 2054892 into main Aug 1, 2026
4 checks passed
@Astro-Han
Astro-Han deleted the refactor/composer-quiet-chrome branch August 1, 2026 15:48
sunheyi6 added a commit to sunheyi6/maka-agent that referenced this pull request Aug 2, 2026
…oser voice-route gating + model-switcher chrome

Resolve conflicts in app-shell.tsx and model-switcher.css between
main (Astryx ChatSurfaceLayout / quiet composer chrome apache#1835) and
the PR (voice availability gating apache#1740):

- Keep main ChatSurfaceLayout structure; apply PR gating
  (voiceCaptureConfigured / realtimeVoiceConfigured) to composer
  voice callbacks; add realtimeVoiceState + onToggleRealtimeVoice.
- closeSettings now calls refreshShellSettings(), which hydrates
  permission mode and both voice routes from useShellAppearance.
- Drop main composerVoiceCaptureReady local mechanism, superseded
  by merged refreshShellSettings hydration (mount + external change
  + settings close).
- Keep main apache#1835 astryx-selector flat-toolbar chrome; retain PR
  palette-token rebinding in .maka-model-selection-controls.
Astro-Han added a commit that referenced this pull request Aug 5, 2026
…ify them as ghost menus (#2230)

* fix(ui): keep model and thinking pickers mounted mid-turn

The composer unmounted the model + thinking pair while a turn was in
flight (`!props.streaming` gate, #1835), so the footer row reflowed on
every turn start/end and the disabled-reason path built for exactly
this state (switchDisabledStreaming copy + Selector isDisabled) sat
unreachable. The + menu and permission control stay reachable mid-turn
by design (#1444); the pair now follows the same rule — mounted, locked
with an explanatory tooltip.

* refactor(ui): move composer model/thinking pickers onto the ghost-menu toolbar family

The composer footer mixed two component families for one toolbar role:
+/permission/modes were ghost icon buttons, while model/thinking were
Astryx Selector form fields disguised by ~60 lines of product CSS that
cleared field chrome state by state — which is why the pair never
matched its neighbours (chevron, pill focus fill vs accent outline
ring) and why mid-turn it got a cruder treatment (unmount) than the
disabled-with-reason every toolbar member deserved.

Model and thinking pickers are now ghost-button DropdownMenus — the
same primitive as the + and permission controls beside them, so
resting/hover/focus/disabled chrome derives from one Button:

- Model menu: one role=group section per connection (headings kept),
  provider marks on rows, the current value wears a plain check — no
  radio rows, keeping the quiet footer's sm density. Menu search is
  dropped; the panel keeps its 300px scroll and Astryx typeahead.
- Thinking menu: same ghost trigger + checked current item.
- Locked mid-turn via aria-disabled + a reason tooltip in each
  control's own words (new thinkingDisabled* copy; the trigger stays
  focusable so the reason is keyboard/SR-discoverable). The lock also
  rides on every menu row, not just the trigger: an aria-disabled
  Astryx DropdownMenu trigger still opens on ArrowDown, and only
  item-level isDisabled closes that keyboard path.
- The menu panel gains a max-width cap (the Selector's 260px option
  cap died with it); the Selector-based ModelPicker with search stays
  for Settings forms.

Dead with the disguise: the four-state transparent-chrome overrides
for the migrated triggers, the data-pending wrapper rules (Button
isLoading owns pending now), the orphaned 260px trigger rule (the
scoped 220px rule in composer.css always won), and the never-read
data-streaming attributes. The workspace picker keeps its quiet
Selector overlay until it gets its own migration.

Tests: the mid-turn regression test now isolates streaming as the
only lock source (resting session + in-catalog current model) and
asserts the reason copy, with a reverse at-rest assertion — verified
to go red when the streaming branch is removed. A new
chat-model-switcher SSR test pins the group markup, the current-check,
the unknown-current leading row, and the row-level lock.
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