Skip to content

feat(session-ui): add floating input navigation rail - #39351

Open
DevDengChao wants to merge 3 commits into
anomalyco:devfrom
DevDengChao:input-nav
Open

feat(session-ui): add floating input navigation rail#39351
DevDengChao wants to merge 3 commits into
anomalyco:devfrom
DevDengChao:input-nav

Conversation

@DevDengChao

@DevDengChao DevDengChao commented Jul 28, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #39361

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a floating navigation rail for user messages in the session panel. Each user message gets a horizontal bar whose width encodes content length (short messages = narrow bars, long messages = wide bars). Hovering a bar shows a preview popup with truncated text, image thumbnails, or file icons.

The feature is controlled by a new showInputNav setting (default: false) in Settings > Advanced. It only renders on non-mobile screens (768px+).

Key changes:

  • New InputNav component in packages/session-ui
  • New showInputNav boolean setting in Settings.general
  • Integration in session page, gated on desktop + setting
  • i18n keys for the settings toggle

How did you verify your code works?

  1. Unit tests: 12 tests for computeBarWidth and extractPreviewContent utility functions in input-nav.test.ts
  2. Settings test: 1 test verifying default value is false in settings.test.ts
  3. Typecheck: Passes for both packages/session-ui and packages/app
  4. Existing tests: All 88 session-ui tests and 13 app settings tests pass
  5. Visual verification: Playwright screenshots captured from rendered component

Screenshots / recordings

Basic state - InputNav bars on the right side of the session panel, with different widths representing message lengths:

Basic state

Hover preview (text) - Shows truncated text content when hovering a bar:

Hover text

Hover preview (files) - Shows text, image thumbnail, and file icon:

Hover files

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Add a floating navigation component for user messages in the session panel.
Each user message gets a horizontal bar whose width encodes content length.
Hovering shows a preview popup with text, images, or file information.

- Add showInputNav setting (default: false) in Settings.general
- Create InputNav component with HoverCard preview
- Add computeBarWidth and extractPreviewContent utility functions
- Integrate into session page, gated on desktop + setting
- Add i18n keys for settings toggle
- Add toggle in both v1 and v2 settings UI

TDD: tests written first for computeBarWidth and extractPreviewContent.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Add visual screenshots showing the InputNav component in different states:
- Basic state with proportional width bars
- Hover preview showing text content
- Hover preview with images and file icons

Also add Storybook story for interactive testing.
Replace standalone component screenshots with session panel context:
- Basic state showing InputNav in session panel
- Hover preview with text content
- Hover preview with image thumbnail and file icon
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]: Floating input navigation rail for session panel

1 participant