fix(tui): support cursor navigation in text areas - #2488
Merged
Merged
Conversation
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
The cursor-aware navigation for FormTextArea is a clean refactor of what was previously an append-only editor. A few things I checked and found fine:
rawCursoris clamped viaMath.min(rawCursor, value.length)on every render, so externalvaluechanges (including reset to"") don't leave the cursor out of range.cursorLine/cursorColumnmath is correct at line boundaries — placing the cursor at the end of a middle line renders as" "vialine[cursorColumn] ?? " ", and empty cursor lines still take one row via the inverse-space cursor.- Swallowing
up/downis intentional (they'd otherwise leak to any parent handler as a would-be advance/back); since ink runs all activeuseInputhandlers, this doesn't break the wizard'sescape/ctrl+dhandling inTextAreaField. - No other component in
src/uses left/right in a way that overlaps with a focusedFormTextArea. - New behavior is covered by
harness.screen.test.tsxusing real key presses through the test harness — no mocking concerns.
Nothing to change before merging.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #2488 +/- ##
============================================
- Coverage 97.39% 97.39% -0.01%
============================================
Files 642 642
Lines 46807 46844 +37
============================================
+ Hits 45590 45625 +35
- Misses 1217 1219 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aidandaly24
approved these changes
Sep 30, 2026
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
Reproduction
In the refactor RC, run agentcore add harness and enter a system prompt. Pressing Left or Right does not move the cursor, so earlier text cannot be corrected in place.
Validation