Skip to content

feat: add expandable long user prompts - #917

Open
DeepamJha wants to merge 1 commit into
Nano-Collective:mainfrom
DeepamJha:feature/collapse-long-prompts
Open

feat: add expandable long user prompts#917
DeepamJha wants to merge 1 commit into
Nano-Collective:mainfrom
DeepamJha:feature/collapse-long-prompts

Conversation

@DeepamJha

Copy link
Copy Markdown
Contributor

Closes #865

Description

Adds automatic collapsing for long user prompts in the conversation view.

Prompts exceeding 40 words or 300 characters are collapsed for display while the original prompt remains intact.

The implementation:

  • Collapses long prompts while keeping the full message available.
  • Supports Show more / Show less interaction through keyboard focus.
  • Keeps interactive user messages live in the inline transcript so the toggle can receive focus.
  • Strips VS Code context only from the displayed content.
  • Preserves the original message and token calculation.

Type of Change

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

Changeset

  • Added a changeset (pnpm changeset) describing this feature for the changelog.

Testing

Automated Tests

  • Added and updated user-message.spec.tsx
  • Tested 40-word collapse boundary
  • Tested 300-character collapse boundary
  • Tested long unbroken strings
  • Tested VS Code context stripping
  • Tested interactive expand/collapse behavior
  • pnpm test:format
  • pnpm test:lint
  • git diff --check

Manual Testing

Tested the feature in the real CLI:

  • Long prompts collapse automatically.
  • Tab focuses Show more.
  • Enter expands the prompt.
  • Enter again collapses it.
  • Normal input behavior remains functional.

Checklist

  • If this was for an open issue, I was assigned to it
  • Code follows project style guidelines
  • Self-review completed
  • No breaking changes

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.

[Feature] Collapse long user prompts in the conversation view

1 participant