Skip to content

fix(web): move to line edges across composer chips - #11897

Open
Gigioxx wants to merge 1 commit into
pingdotgg:mainfrom
Gigioxx:t3code/reproduce-and-fix-issue-3
Open

Gigioxx wants to merge 1 commit into
pingdotgg:mainfrom
Gigioxx:t3code/reproduce-and-fix-issue-3

Conversation

@Gigioxx

@Gigioxx Gigioxx commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Home and Cmd+Left stop after a leading composer chip instead of reaching the start of the line.

Use Lexical's RangeSelection.modify for Home/End and macOS Cmd+Left/Right. It already handles inline decorators around the browser's visual line boundary, including Shift-selection and soft wraps. This covers skill, file, citation, and context chips in the shared web/desktop composer. The change removes five lines overall.

Fixes #11892.

Verified in an isolated Chromium client: reproduced the original bug, then passed 62 selection checks and three soft-wrap scenarios. macOS shortcut checks use an overridden platform in Linux Chromium; native macOS and Windows were not run. All 73 focused composer tests, web typecheck, targeted lint, and formatting pass. Runnable browser checks are attached with the evidence.

Same prompt, immediately after Home:

Before After
Caret stops after the leading chip Caret reaches before the leading chip

Videos press Home, then type BEFORE to show the insertion point: before / after.

Model: GPT-6. Harness: Codex.

Summary by CodeRabbit

  • Bug Fixes
    • Home and End keys now navigate to line boundaries on all platforms.
    • On Mac, Command + Left Arrow and Command + Right Arrow now move to the beginning or end of the current line.
    • Improved text selection behavior when using Home, End, and line-boundary keyboard shortcuts in the composer.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 15, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 73cbd7a

Macroscope's review found this PR approvable — This is a localized composer keyboard-navigation fix that adjusts line-edge selection behavior and adds macOS Command+Arrow handling. It changes no APIs, schemas, defaults, infrastructure, or sensitive code, and its runtime scope is confined to the existing editor component.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f6115181-f09d-4d26-ad59-99fe61eceabc

📥 Commits

Reviewing files that changed from the base of the PR and between bf3be75 and 73cbd7a.

📒 Files selected for processing (1)
  • apps/web/src/components/ComposerPromptEditor.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The composer keyboard handler now supports Home and End on all platforms, plus Mac Cmd+ArrowLeft and Cmd+ArrowRight. It uses Lexical range selection state and updates line-boundary movement without DOM-to-Lexical selection synchronization.

Changes

Composer navigation

Layer / File(s) Summary
Line-boundary keyboard handling
apps/web/src/components/ComposerPromptEditor.tsx
The handler adds cross-platform Home and End support and Mac Cmd+Arrow line-boundary movement. It reads Lexical range selections and passes a boolean direction to selection.modify. The unused DOM selection import and follow-up synchronization were removed.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: chrisdeeming

Merge Risk: ⚪ Minimal · up to 73cbd

No actionable merge risk remains for this change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: moving to line edges across composer chips.
Description check ✅ Passed The description explains the bug, implementation, affected chips, verification, issue reference, and UI changes with before/after screenshots and videos. It does not reproduce the checklist with check…
Linked Issues check ✅ Passed The change addresses #11892. ComposerHomeEndKeyPlugin now handles Home and End on all platforms. It also handles macOS Cmd+ArrowLeft and Cmd+ArrowRight. The handler uses Lexical $getSelection(), `…
Out of Scope Changes check ✅ Passed The diff changes only apps/web/src/components/ComposerPromptEditor.tsx. The changes remain within the shared web and desktop composer navigation scope of #11892. No unrelated product behavior is dem…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Home and Cmd+Left cannot move before a leading skill chip

1 participant