Skip to content

Conversation

spinualexandru
Copy link
Contributor

@spinualexandru spinualexandru commented Sep 19, 2025

recording_2025-09-19_15-19-17.mp4

Brief description of what this PR does

  • Allows moving the text cursor with left and right arrows so you can modify the input
  • Move inline hooks to hooks so they can be easily reused across components and also make them more maintainable
  • Added UIStateContext for shared state instead of local state
  • Reduced text input complexity
  • Addressed separation of concerns ( input state vs ui state )
  • Improved line counting by adding a debounce and cache to prevent ui blocking
  • Proper cleanup to prevent memory leaks with cleanup effects

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • Tested with Ollama
  • Tested with OpenRouter
  • Tested with OpenAI-compatible API
  • Tested MCP integration (if applicable)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)

@Copilot Copilot AI review requested due to automatic review settings September 19, 2025 12:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds inline cursor navigation functionality to the text input component and refactors code organization. It introduces a new TextInput component from ink-text-input for better cursor handling and reorganizes existing hooks into separate modules for improved maintainability.

  • Adds cursor navigation with left/right arrows using ink-text-input
  • Extracts inline hooks to dedicated hook modules (useUIState, useInputState)
  • Adds UIStateContext for shared state management across components

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
source/hooks/useUIState.ts New hook for managing UI state with context provider
source/hooks/useInputState.ts New hook for managing input state with debounced line counting
source/components/user-input.tsx Refactored to use extracted hooks and TextInput component
source/app.tsx Added UIStateProvider wrapper and formatting updates
package.json Added ink-text-input dependency and types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant