Skip to content

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

Merged
will-lamerton merged 2 commits into
Nano-Collective:mainfrom
Dhirenderchoudhary:fix/581-chat-scroll-on-slash
Jun 27, 2026
Merged

fix(ui): prevent chat from aggressively scrolling to bottom on slash …#591
will-lamerton merged 2 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)

@Dhirenderchoudhary Dhirenderchoudhary force-pushed the fix/581-chat-scroll-on-slash branch 2 times, most recently from 9d48b59 to 69f0974 Compare June 21, 2026 12:02

@akramcodez akramcodez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

great work @Dhirenderchoudhary, LGTM 👍

@will-lamerton

Copy link
Copy Markdown
Member

Hey @Dhirenderchoudhary. Can you fix the conflict with main? Happy to merge when you have. Thanks :)

…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 63ab8d2 to b0ff723 Compare June 22, 2026 19:46
@Dhirenderchoudhary

Copy link
Copy Markdown
Contributor Author

@will-lamerton I've fixed the conflicts.

@will-lamerton will-lamerton merged commit 6030560 into Nano-Collective:main Jun 27, 2026
10 checks passed
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

3 participants