[PR #632] [CLOSED] feat: Add height-limited text input with viewport scrolling #9669

Closed
opened 2026-02-16 18:13:57 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/632
Author: @BurgessTG
Created: 7/3/2025
Status: Closed

Base: devHead: feat/chat-expansion-scroll


📝 Commits (2)

  • 3ab7a4d feat: Add height-limited text input with viewport scrolling
  • e2cb93f fix: resolve merge conflicts for chat box height limiting feature

📊 Changes

2 files changed (+725 additions, -14 deletions)

View changed files

📝 packages/tui/internal/components/chat/editor.go (+425 -6)
📝 packages/tui/internal/components/textarea/textarea.go (+300 -8)

📄 Description

Summary

Enhances the text input experience by adding intelligent height management and scrolling capabilities.

Features

  • Natural growth: Text input expands from 1 to 10 lines as you type
  • Fixed height with scrolling: After 10 lines, maintains fixed height with internal viewport
  • Interactive scrollbar: Visual scrollbar for navigating long text
  • Automatic cursor tracking: Cursor stays visible as you type or navigate
  • Keyboard navigation: Page Up/Down support for scrolling through content

Benefits

  • Better UX for long messages: No more endless text box growth pushing chat history off screen
  • Familiar behavior: Similar to other modern chat applications
  • Maintains context: Can see chat history while composing long messages
  • Visual feedback: Scrollbar shows position in long text

Implementation Details

  • Enhanced textarea.Model with MaxHeight and viewport scrolling
  • Added scrollOffset tracking for viewport behavior
  • Implemented ensureCursorVisible() for automatic scroll adjustment
  • Scrollbar appears/disappears based on content overflow

Test Plan

  • Type more than 10 lines of text to see growth limiting
  • Verify scrollbar appears when content exceeds visible area
  • Test cursor stays visible when typing at bottom
  • Confirm Page Up/Down navigation works
  • Check that chat history remains visible

This is a reopened PR after resolving merge conflicts with the latest dev branch.

🤖 Generated with opencode


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/632 **Author:** [@BurgessTG](https://github.com/BurgessTG) **Created:** 7/3/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat/chat-expansion-scroll` --- ### 📝 Commits (2) - [`3ab7a4d`](https://github.com/anomalyco/opencode/commit/3ab7a4de2dea98f58c0d087d358fdbdf678edf28) feat: Add height-limited text input with viewport scrolling - [`e2cb93f`](https://github.com/anomalyco/opencode/commit/e2cb93f807794d4c0d823a7f75f95e6338f94941) fix: resolve merge conflicts for chat box height limiting feature ### 📊 Changes **2 files changed** (+725 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `packages/tui/internal/components/chat/editor.go` (+425 -6) 📝 `packages/tui/internal/components/textarea/textarea.go` (+300 -8) </details> ### 📄 Description ## Summary Enhances the text input experience by adding intelligent height management and scrolling capabilities. ## Features - **Natural growth**: Text input expands from 1 to 10 lines as you type - **Fixed height with scrolling**: After 10 lines, maintains fixed height with internal viewport - **Interactive scrollbar**: Visual scrollbar for navigating long text - **Automatic cursor tracking**: Cursor stays visible as you type or navigate - **Keyboard navigation**: Page Up/Down support for scrolling through content ## Benefits - **Better UX for long messages**: No more endless text box growth pushing chat history off screen - **Familiar behavior**: Similar to other modern chat applications - **Maintains context**: Can see chat history while composing long messages - **Visual feedback**: Scrollbar shows position in long text ## Implementation Details - Enhanced `textarea.Model` with `MaxHeight` and viewport scrolling - Added `scrollOffset` tracking for viewport behavior - Implemented `ensureCursorVisible()` for automatic scroll adjustment - Scrollbar appears/disappears based on content overflow ## Test Plan - ✅ Type more than 10 lines of text to see growth limiting - ✅ Verify scrollbar appears when content exceeds visible area - ✅ Test cursor stays visible when typing at bottom - ✅ Confirm Page Up/Down navigation works - ✅ Check that chat history remains visible This is a reopened PR after resolving merge conflicts with the latest dev branch. 🤖 Generated with [opencode](https://opencode.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:57 -05:00
yindo closed this issue 2026-02-16 18:13:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9669