Skip to content

fix(web): improve composer @ file search and popover keyboard scroll - #177

Merged
AruNi-01 merged 1 commit into
mainfrom
aarynlu/composer-mention-search-scroll
Jul 30, 2026
Merged

AruNi-01 merged 1 commit into
mainfrom
aarynlu/composer-mention-search-scroll

Conversation

@AruNi-01

@AruNi-01 AruNi-01 commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Optimize composer @ mention file search and shared popover keyboard scrolling (Welcome + Terminal AI input):

  • @ file search: match only file/folder names with case-insensitive substring (*keyword*), including hidden names (.…); drop Fuse fuzzy matching on full paths that produced irrelevant hits
  • No result cap: return every name match (still ranked: exact → prefix → contains)
  • Keyword highlight: highlight matched segments in the result file name so why it hit is obvious
  • Keyboard scroll padding: when arrowing through @ and / lists, keep 3 peek rows below/above the active item (selection ~4th from bottom); shared helper used by mention + slash (Terminal reuses the same hooks)

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Chore / tooling

Validation

  • just lint
  • bun test src/features/welcome/hooks/__tests__/use-welcome-mention-search.test.ts (apps/web)
  • just fmt
  • Additional checks (describe below)

Checklist

  • I updated documentation if behavior changed
  • I added/updated tests where appropriate
  • I followed repository conventions and AGENTS.md guidance

Summary by cubic

Improves composer @ file mention search to match case-insensitive name substrings with clearer ranking and highlighting. Also smooths keyboard navigation in @ and / popovers by keeping 3 items visible around the selection with a shared scroll helper.

  • Bug Fixes

    • @ file search now matches name substrings only (case-insensitive), includes hidden names, removes fuzzy full-path noise, returns all matches, and ranks exact/prefix before contains.
    • Keyboard navigation in @ and / popovers keeps 3 peek rows around the active item for steadier scrolling.
  • Refactors

    • Extracted shared scrollActiveListItemIntoView for popover lists (Welcome and Terminal).
    • Highlighted matched segments in result names via splitHighlightParts to show why each item matched.

Written for commit ecc84d0. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • File mention search now supports case-insensitive substring matching with improved ranking.
    • Matching text is highlighted in file names.
    • Search results can include all relevant matches without an artificial limit.
  • Bug Fixes

    • Improved keyboard navigation by keeping active slash-command and file-mention items visible while scrolling.
    • Improved matching behavior for directory paths, hidden files, and varied query patterns.

Match @ mentions by file/folder name substring only (no fuzzy path hits),
highlight the keyword in results, and keep 3 peek rows when arrowing
through @ and / popovers (shared by Terminal AI input).
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
atmos-landing Building Building Preview Jul 30, 2026 5:32am

@AruNi-01
AruNi-01 merged commit 86e4fe2 into main Jul 30, 2026
3 of 5 checks passed
@AruNi-01
AruNi-01 deleted the aarynlu/composer-mention-search-scroll branch July 30, 2026 05:33
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ca526c1-ebf2-43bd-8732-75d3765e593e

📥 Commits

Reviewing files that changed from the base of the PR and between d8b42a0 and ecc84d0.

📒 Files selected for processing (7)
  • apps/web/src/features/welcome/components/SlashCommandPopover.tsx
  • apps/web/src/features/welcome/components/WelcomeMentionPopover.tsx
  • apps/web/src/features/welcome/hooks/__tests__/use-welcome-mention-search.test.ts
  • apps/web/src/features/welcome/hooks/use-welcome-mention-search.ts
  • apps/web/src/features/welcome/hooks/use-welcome-slash-navigation.ts
  • apps/web/src/features/welcome/lib/mention-file-search.ts
  • apps/web/src/features/welcome/lib/popover-list-scroll.ts

📝 Walkthrough

Walkthrough

Welcome mention search now uses ranked case-insensitive substring matching and highlights matching file-name segments. A shared scrolling helper keeps active mention, slash-command, and disabled-skill rows visible within their list containers.

Changes

Welcome popover updates

Layer / File(s) Summary
Mention search and name highlighting
apps/web/src/features/welcome/lib/mention-file-search.ts, apps/web/src/features/welcome/components/WelcomeMentionPopover.tsx, apps/web/src/features/welcome/hooks/__tests__/use-welcome-mention-search.test.ts
Mention matching uses deterministic substring ranking, name matches are split for highlighting, and tests cover matching, ranking, and highlight segments.
Shared active-row scrolling
apps/web/src/features/welcome/lib/popover-list-scroll.ts, apps/web/src/features/welcome/hooks/use-welcome-mention-search.ts, apps/web/src/features/welcome/hooks/use-welcome-slash-navigation.ts, apps/web/src/features/welcome/components/SlashCommandPopover.tsx
Popover navigation uses container-aware active-row scrolling, with dedicated refs for command and disabled-skill lists.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant WelcomeMentionPopover
  participant MentionSearch
  participant PopoverList
  User->>WelcomeMentionPopover: enter mention query
  WelcomeMentionPopover->>MentionSearch: filter file candidates
  MentionSearch-->>WelcomeMentionPopover: ranked candidates
  WelcomeMentionPopover->>PopoverList: render highlighted names
  User->>WelcomeMentionPopover: navigate candidates
  WelcomeMentionPopover->>PopoverList: scroll active row into view
Loading

Possibly related PRs

  • AruNi-01/atmos#104: Introduced related slash-command dropdown and keyboard navigation behavior.
  • AruNi-01/atmos#167: Added the related disable_skills view and skill enable/disable flow.

Suggested labels: codex

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aarynlu/composer-mention-search-scroll

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

E2E report: ✅ Passed

4 passed · 0 failed · 0 flaky · 0 skipped · 1m 41s · 100% pass rate

Run

Field Value
Workflow run 30516926211
Selected suites smoke-onboarding
HTML report Open report
Artifacts playwright-html-report, playwright-json-report (14d) · videos/traces in artifacts only
Overview
Metric Count
Passed 4
Failed 0
Flaky 0
Skipped 0
Duration 1m 41s
Pass rate 100%
By file
Name Passed Failed Flaky Skipped
local-onboarding.e2e.ts 2 0 0 0
private-relay-onboarding.e2e.ts 1 0 0 0
remote-onboarding.e2e.ts 1 0 0 0
By project
Name Passed Failed Flaky Skipped
chromium 4 0 0 0

All selected E2E suites passed.

This branch was successfully deployed

1 active deployment
Preview — ecc84d0a Deployed Jul 30, 2026 by vercel[bot]
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.

1 participant