Skip to content

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

Description

@akramcodez

Description

When running Nanocoder in a small terminal window, if the user has enough chat messages to create a scrollable history, pressing the / key causes the chat view to unexpectedly jump/scroll all the way to the bottom.

Reproduction Steps

  1. Open Nanocoder.
  2. Resize the terminal window so it is relatively small in height.
  3. Generate enough chat messages to create a scrollable history.
  4. Scroll up slightly in the history so you are no longer at the bottom.
  5. Type / in the input field to trigger the command menu.
  6. Expected: The slash command completion menu opens smoothly without aggressively moving the chat history viewport.
  7. Actual: The chat view jumps immediately to the bottom of the message list.

Context & Suspected Cause

This is a layout glitch likely stemming from how Ink.js handles <Static> components and flexbox recalculations. When showCompletions becomes true in source/components/user-input.tsx, the autocomplete menu renders its list of options. This dynamically changes the height of the input container, pushing the chat view up and triggering Ink's scroll container to recalculate and pin itself to the bottom of the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions