Skip to content

fix(ui): prevent chat from aggressively scrolling to bottom on slash …#591

Open
Dhirenderchoudhary wants to merge 3 commits into
Nano-Collective:mainfrom
Dhirenderchoudhary:fix/581-chat-scroll-on-slash
Open

fix(ui): prevent chat from aggressively scrolling to bottom on slash …#591
Dhirenderchoudhary wants to merge 3 commits into
Nano-Collective:mainfrom
Dhirenderchoudhary:fix/581-chat-scroll-on-slash

Conversation

@Dhirenderchoudhary

Copy link
Copy Markdown
Contributor

Description

Resolves #581.

Previously, rendering the slash command completions menu outside of the main bordered input <Box> altered the height of the live viewport area. This height change triggered Ink.js to recalculate flexbox layouts, forcing the chat history to unexpectedly snap to the bottom in smaller terminal windows.

This commit moves the rendering of both command completions and file suggestions inside the bounded layout. The container expands naturally without disrupting the overall window height calculation, keeping the user's scroll position intact.

Additionally:

  • Adds structural layout tests verifying completions render inside the container.
  • Fixes test timing flakes where simulated stdin input was occasionally ignored.

Type of Change

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

Testing

Automated Tests

  • New features include passing tests in .spec.ts/tsx files
  • All existing tests pass (pnpm test:all completes successfully)
  • Tests cover both success and error scenarios

Manual 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)
  • Appropriate logging added using structured logging (see CONTRIBUTING.md)

…command

Resolves Nano-Collective#581.

Previously, rendering the slash command completions menu outside of the main
bordered input <Box> altered the height of the live viewport area. This height
change triggered Ink.js to recalculate flexbox layouts, forcing the chat history
to unexpectedly snap to the bottom in smaller terminal windows.

This commit moves the rendering of both command completions and file suggestions
inside the bounded layout. The container expands naturally without disrupting
the overall window height calculation, keeping the user's scroll position intact.

Additionally:
- Adds structural layout tests verifying completions render inside the container.
- Fixes test timing flakes where simulated stdin input was occasionally ignored.
@Dhirenderchoudhary Dhirenderchoudhary force-pushed the fix/581-chat-scroll-on-slash branch from 9d48b59 to 69f0974 Compare June 21, 2026 12:02
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.

[Bug] Chat view scrolls to the bottom when pressing "/" in small terminals

1 participant