Repository navigation
refactor(composer): give the approval redirect wiring readable lines - #847
Merged
Merged
Conversation
The merge of #845 squeezed the composer's approval redirect code onto single lines (one about 330 characters) to fit the max-lines ratchet. Expand those lines into multi-line arguments with comments above the code, and make room by moving the submit's draft handling and send into composer-submission.ts: - trackSubmittedDraft checks whether the editor still shows the submitted draft before clearing or restoring it. It replaces the restore, clear and isDraftCurrent closures that repeated that check. - sendComposerSubmission sends a submit through the approval redirect or a plain send and settles the draft by the outcome. Behavior is unchanged. ChatInputComposer.tsx goes from 1843 to 1825 lines and its ratchet limit drops from 1845 to 1826. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
astyfx
requested review from
heath-s and
schang124
and removed request for
a team
October 28, 2026 02:00
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
b886aa9 |
2026-10-28 02:00 UTC | — | — | — |
b886aa9 < |
2026-10-28 02:00 UTC | 0 | 0 | 0 |
Last scanned: b886aa9 · 2026-10-28 02:00 UTC
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
When #845 was merged, the composer's approval redirect code was squeezed onto single lines so
ChatInputComposer.tsxstayed under its max-lines ratchet. The longest was the redirect submit call, about 330 characters. Others were the redirect-mode call, the approval-shortcuts hook call, thesteerSubmissionandisDraftCurrentone-liners, and theonEmptyEditorKeyprop with a trailing comment. This PR expands those lines and makes room by moving the submit's draft handling and send out of the component. Behavior is unchanged.Changes
ChatInputComposer.tsx: the redirect lines from feat(composer): keep the composer usable while an approval is pending #845 now use multi-line object arguments, and their comments sit on their own line above the code. The component goes from 1843 to 1825 lines.src/components/session/composer-submission.ts:trackSubmittedDraftchecks whether the editor still shows the submitted draft (same task, same text) before it clears the draft, and restores the draft only into an empty editor on its task. It replaces therestoreSubmittedDraft,clearSubmittedDraftandisDraftCurrentclosures, which repeated that check.sendComposerSubmissionsends a submit through the approval redirect (submitApprovalRedirect) or a plainsendUserMessage, then clears or restores the draft based on the outcome. The redirect still clears Lens annotations only once the message is delivered.config/max-lines-ratchet.json: theChatInputComposer.tsxlimit drops from 1845 to 1826.docs/architecture/code-organization.md: the redirect row names the new module and its test.tests/composer-submission.test.tscovers the draft checks, plain-send outcomes (steered, blocked, steer-unavailable, queued) and the redirect order: send first, then clear Lens annotations and the draft.Lines over 160 characters that were already there before #845 stay as they are (the mentions hooks, the
ComposerShelfline and the compare-history description).Verification
bun run lint: pass. No new warnings; the one warning in this file, aboutqueuedTurns, is already on main.bun run typecheck: passbun run check:max-lines-ratchet: pass (64 files)bun run check:switch-exhaustiveness: passbun run check:doc-paths: pass (112 Markdown files)bun run check:i18n: passbun test tests/composer-submission.test.ts tests/approval-redirect-send.test.ts tests/approval-redirect-store.test.ts tests/prompt-input-submit-labels.test.ts tests/prompt-input-utils.test.ts tests/chat-input-utils.test.ts tests/chat-input.runtime.test.ts: 103 pass, 0 failbunx --bun playwright test tests/e2e/composer-approval-request.e2e.ts: 6 passedbunx --bun playwright test tests/e2e/attachment-execution-notice.e2e.ts: 5 passed (plain sends from the composer)bun run build:pages: pass🤖 Generated with Claude Code