fix: keep composer mention highlights aligned while editing - #1211
fix: keep composer mention highlights aligned while editing#1211felipeggv wants to merge 2 commits into
Conversation
|
@jSydorowicz21 could you review this PR when available? It fixes the prompt editor cursor, selection, and mention-highlight alignment issues, includes regression coverage for the scrolled overlay case, and is rebased on the current rc. Local validation is green with 33,907 tests passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesMention overlay behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR updates the composer textarea mention overlay behavior. The main changes are:
Confidence Score: 5/5This looks safe to merge after a small overlay-state cleanup.
src/renderer/components/InputArea/components/InputTextarea.tsx Important Files Changed
Reviews (1): Last reviewed commit: "fix: keep mention highlight aligned afte..." | Re-trigger Greptile |
| const overlayRendered = overlayEnabled && segments.some((segment) => segment.kind !== 'text'); | ||
| const overlayVisible = overlayRendered && !hasSelection; |
There was a problem hiding this comment.
When the user selects text, removes the only recognized mention so the overlay unmounts, then brings a mention back, hasSelection can still be true from the old selection. The remounted overlay starts with visibility: hidden until another selection or change event runs, so mention decoration can disappear even though there is no active selection.
|
@felipeggv Thanks for taking this on, and thanks for the unusually thorough validation write-up. Inverting the layering so the native textarea owns the glyphs, caret, and selection while the overlay paints decoration only is the right call. It kills a whole class of caret-drift bugs instead of papering over them, and the zero-inline-advance chip trick is preserved correctly. The four new focused tests are well targeted, too. I found one issue I'd like fixed before we merge.
|
|
Thanks for this! Reviewed as part of a PR sweep. It currently conflicts with |
|
@felipeggv Checking back in on this one. Thanks again for the work here, the layering inversion is still the approach we want and the new tests are good. Nothing has landed on the branch since my last note on July 15, so the same three items are still open:
No rush, and no hard deadline on our side. Just let me know if you would rather hand it off and we can pick up the rebase and the blur fix ourselves. Happy to re-review as soon as it is pushed. |
Summary
Validation
Summary by CodeRabbit