Skip to content

fix(tui): support cursor navigation in text areas - #2488

Merged
notgitika merged 1 commit into
refactorfrom
fix/harness-prompt-arrow-navigation
Sep 30, 2026
Merged

notgitika merged 1 commit into
refactorfrom
fix/harness-prompt-arrow-navigation

Conversation

@notgitika

Copy link
Copy Markdown
Contributor

Summary

  • make FormTextArea cursor-aware instead of append-only
  • support Left/Right movement and insertion, newline, and backspace at the cursor
  • keep the active cursor line visible in multiline previews
  • add a Harness wizard regression test covering both arrow directions

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

  • bun test src/handlers/project/add/harness/harness.screen.test.tsx
  • bun test src/components/wizard/wizard.test.tsx src/handlers/project/add/credentials/oauth/oauth.screen.test.tsx
  • bun run typecheck
  • oxlint and Prettier checks on changed files

@github-actions github-actions Bot added the size/m PR size: M label Sep 30, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 30, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 30, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  • rawCursor is clamped via Math.min(rawCursor, value.length) on every render, so external value changes (including reset to "") don't leave the cursor out of range.
  • cursorLine / cursorColumn math is correct at line boundaries — placing the cursor at the end of a middle line renders as " " via line[cursorColumn] ?? " ", and empty cursor lines still take one row via the inverse-space cursor.
  • Swallowing up/down is intentional (they'd otherwise leak to any parent handler as a would-be advance/back); since ink runs all active useInput handlers, this doesn't break the wizard's escape/ctrl+d handling in TextAreaField.
  • No other component in src/ uses left/right in a way that overlaps with a focused FormTextArea.
  • New behavior is covered by harness.screen.test.tsx using real key presses through the test harness — no mocking concerns.

Nothing to change before merging.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 30, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.87755% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.39%. Comparing base (04b45c3) to head (ef7295c).

Files with missing lines Patch % Lines
src/components/FormTextArea.tsx 93.87% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@notgitika
notgitika merged commit b28dd21 into refactor Sep 30, 2026
20 of 22 checks passed
@notgitika
notgitika deleted the fix/harness-prompt-arrow-navigation branch September 30, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants