Add an expand / collapse (maximize) toggle to the chat composer#49
Open
DragonnZhang wants to merge 2 commits into
Open
Add an expand / collapse (maximize) toggle to the chat composer#49DragonnZhang wants to merge 2 commits into
DragonnZhang wants to merge 2 commits into
Conversation
Add a toolbar toggle that maximizes the chat composer into a tall editing area for composing/editing long prompts, then collapses it back. Mirrors the existing model and thinking-level pickers (right-side controls, hidden in compact mode). - Toggle button (Maximize2/Minimize2) with aria-pressed and a tooltip. - When expanded, the RichTextInput's inline height flips from the auto-grow cap (min(66vh, 540px)) to max(78vh, 560px), applied as both min/max height so the box is genuinely large even when empty. Recomputed on window resize. - Resets to collapsed on session switch. - New i18n keys chat.expandComposer / chat.collapseComposer in all locales. Adds e2e/assertions/composer-expand.assert.ts, which drives the built app over CDP in the draft state: measures the input height, clicks to maximize (asserts the height grows >= 2x and aria-pressed flips true), then collapses (asserts the height returns and aria-pressed flips false).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48
What & why
OpenWork's chat composer (
FreeFormInput) auto-grows as you type, but only up toa fixed cap —
min(66% of window height, 540px). There was no way todeliberately give the input a large editing area, so drafting or editing a long
prompt meant writing and scrolling inside a small box even with a tall window.
Comparable desktop chat surfaces (Claude's desktop app, ChatGPT desktop, Codex
desktop) all offer a maximize / expand affordance on the composer. OpenWork's
toolbar already has a model picker, a thinking-level picker, a context-usage
indicator and an attach control, but no expand toggle — this adds one.
This adds a small expand / collapse toggle to the composer's right-side
controls, next to the thinking-level and model pickers and following the same
!compactModerule:Maximize2icon when collapsed /Minimize2when expanded, with a tooltip("Expand composer" / "Collapse composer") and
aria-pressedreflecting state.max(78% of window height, 560px)— appliedas both
minHeightandmaxHeighton the editable area so the box is genuinelylarge even when empty — recomputed on window resize alongside the existing cap.
compact.
Frontend-only. It only toggles renderer layout state (
isComposerExpanded)and the inline height style already applied to
RichTextInput. No backend /qwen-code change. Two new i18n keys (
chat.expandComposer,chat.collapseComposer)added to all locales for the tooltip.
Changes
components/app-shell/input/FreeFormInput.tsx—isComposerExpandedstate,expandedMaxHeightcomputed in the existing resize effect, a reset-on-sessioneffect, the toolbar toggle button, and the conditional input height.
packages/shared/src/i18n/locales/*.json—chat.expandComposer/chat.collapseComposerin all 7 locales, inserted in sorted position.e2e/assertions/composer-expand.assert.ts— new CDP assertion (below).Verification (DoD)
bun run typecheck:all— introduces no new errors. Delta vsmainiszero: the only errors are the 11 pre-existing ones in
apps/electron(
auto-update.tsowner/repo, asettings-default-thinkingtest tuple, twotest files importing
vitest) — none in the files this PR touches.bun test— the set of failing tests is byte-for-byte identical tomain(verified by diffing the sorted, timing-stripped failure lists from aclean-
mainrun and this branch: 56 pre-existing failures, e.g.BrowserCDP,BrowserPaneManager, RPC registration profiles,RoutedClient,startWebuiHttpServer,resource-bundle, and the i18n sorted checks whosefirst out-of-order key is
menu.homepage— far from thechat.*keys addedhere). This change adds zero new failures. (The raw
N failtotal isorder-dependent/flaky when the whole suite runs unisolated, which is why the
repo splits
*.isolated.ts; the deterministic signal is the failing-test set,which is unchanged.)
bun run lint:i18n:parity— OK (6 locales, 1544 keys each). The two newkeys are added to every locale in sorted position.
bun run electron:build:renderer, where this change lives)— ✅ builds cleanly.
bun build e2e/assertions/composer-expand.assert.ts)— ✅.
CDP e2e assertion (
composer-expand.assert.ts)Drives the real built app over CDP entirely in the draft (no-session) state — no
seeded conversation needed:
aria-pressed="false".height and the toggle flips to
aria-pressed="true".height and the toggle returns to
aria-pressed="false".The height measurements prove the toggle actually resizes the composer, not
merely swaps an icon.
Part of the autonomous desktop-feature loop (
loop-bot).Generated by Claude Code