refactor(desktop): continue composer de-entangle — extract branch/esc/url/placeholder/popout engines - #55842
Merged
Merged
Conversation
…mposerBranch Moves the CodingStatusRow hand-offs (openInWorktree + branch-off / convert / list / switch) out of ChatBar into hooks/use-composer-branch.ts, verbatim. The hook depends only on cwd + draftRef + clearDraft (backend coupling via the projects store); nothing about ChatBar's render. Dead projects/composer-store imports drop out of index.tsx.
…ncel Moves the chat-focused Esc-cancel listener (the latest-handler ref + the register-once window keydown effect) out of ChatBar into hooks/use-composer-esc-cancel.ts, verbatim. Encapsulating the latest-closure ref inside its own hook is the first of the plan's "delete the latest-closure refs" cleanups: it's no longer a loose ref in the 1.4k-line component, just an implementation detail of a focused side-effect hook keyed on busy/awaitingInput/ onCancel.
…UrlDialog Moves the URL dialog's open/value state, autofocus-on-open effect, and submit (host onAddUrl or an @url: directive) out of ChatBar into hooks/use-composer-url-dialog.ts, verbatim. ChatBar just wires the returned openUrlDialog into the context menu and the state into <UrlDialog>.
…rPlaceholder Moves the resting-placeholder state + the conversation-change re-roll effect + the disabled/reconnecting/starting derivation out of ChatBar into hooks/use-composer-placeholder.ts, verbatim. The hook owns its own i18n + browse reset; ChatBar just reads the derived string.
…pout Moves the docked↔floating state, dock/float/toggle actions, drag-gesture wiring, and the on-screen re-clamp effect out of ChatBar into hooks/use-composer-popout.ts, verbatim. ChatBar passes its composerRef in and consumes the returned popout state/handlers; the secondary-window gate and the shared persisted atom stay encapsulated in the hook.
Adds hooks/use-composer-url-dialog.test.tsx (renderHook): @url: directive fallback, host onAddUrl preference + clear/close, and the blank-input no-op. First unit coverage for an extracted composer engine — previously none of this logic was testable while welded into the DOM-coupled ChatBar.
OutThisLife
enabled auto-merge
June 30, 2026 19:41
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…mposer-engines refactor(desktop): continue composer de-entangle — extract branch/esc/url/placeholder/popout engines
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…mposer-engines refactor(desktop): continue composer de-entangle — extract branch/esc/url/placeholder/popout engines
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…mposer-engines refactor(desktop): continue composer de-entangle — extract branch/esc/url/placeholder/popout engines
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…mposer-engines refactor(desktop): continue composer de-entangle — extract branch/esc/url/placeholder/popout engines
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…mposer-engines refactor(desktop): continue composer de-entangle — extract branch/esc/url/placeholder/popout engines
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.
Summary
Continues the composer (
ChatBar) state-engine work from #55500. That PR pulled out the hard draft/queue/submit core; this one extracts the remaining isolated engines into colocated hooks undercomposer/hooks/, each a verbatim, behaviour-preserving move.ChatBarkeeps shrinking toward a thin assembler.ChatBar: 1,472 → 1,248. One commit per engine:useComposerBranchCodingStatusRowhand-offs: open-in-worktree + branch-off / convert / list / switchuseComposerEscCanceluseComposerUrlDialoguseComposerPlaceholderuseComposerPopoutuseComposerUrlDialog)No UX change;
ChatBar's public props are identical. The genuinely-welded trigger engine (detection + chip insertion fused into the editor input/keydown paths) is intentionally left for a dedicated PR — it needs design + its own DOM repro tests, not a mechanical move.Test plan
npm run typecheck— 0 errorseslint— clean on all new hooks +index.tsx(only the pre-existingeditorRef-in-deps warning remains)vitest --environment jsdom src/app/chat/composer— 39 pass incl. theenter-submit/ime-composition/slash-navDOM repros. (The 1attachments.test.tsxfailure is pre-existing onmain— this branch never touches attachments.)use-composer-url-dialog.test.tsx— 3 pass