Skip to content

Prevent Search from jumping to duplicate Recent results - #1111

Merged
pratikbuilds merged 3 commits into
corbitsdev:mainfrom
pratikbuilds:cl-1108-search-scroll
Oct 17, 2026
Merged

pratikbuilds merged 3 commits into
corbitsdev:mainfrom
pratikbuilds:cl-1108-search-scroll

Conversation

@pratikbuilds

@pratikbuilds pratikbuilds commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1108. Hovering Workflows under Pages could jump Search back to its duplicate in Recent. Skip results whose IDs already appear in a displayed group, keeping Recent first.

match results for the current query and scope
skip IDs already displayed in an earlier group
display the remaining results

Evidence

  • Before: Empty Search displayed Workflows twice; hovering its Pages copy moved scrollTop from 350px to 35px.
    After: Workflows appears once. Hovering the bottom result preserves scrollTop at 316px; mouse selection and ArrowUp/ArrowDown/Enter navigation work, with no browser console errors.
  • bun run build, typecheck, lint, and formatting pass. All 189 web unit tests pass.
  • bun run check fails on the same baseline issue reproduced before changes: five packages declare test scripts but contain no tests: @corbits/approvals, @corbits/deferred-tools, @corbits/url-path, @corbits/worker, and @corbits/workflows.
  • Three permanent unit tests cover Recent priority, scoped deduplication, and query matching before deduplication. All three fail against the pre-fix source and pass with the fix.
  • Temporary browser verification used an isolated local database. Database-backed e2e was not rerun for the test and comment follow-up because DATABASE_URL was unset.

Merge Danger

Door: Two-way. Revert the grouping change and its regression tests.

Blast Radius: Search. Later groups omit results already displayed in an earlier group; query matching, scope eligibility, and selection IDs stay intact.

@pratikbuilds
pratikbuilds marked this pull request as ready for review October 7, 2026 14:13
@TheGreatAxios

Copy link
Copy Markdown
Contributor

@pratikbuilds do we need to solve/change anyting in react-ui here as well?

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review · Request changes

Deduplicates command-palette results by id so an item already displayed in an earlier group (e.g. Recent) is omitted from later groups.

Findings

  • apps/web/src/command-palette/command-groups.ts:71-73 — the dedupe filter is correct across the empty-query Recents, scoped, and query-matching paths (verified with a temporary reproduction test, 4 pass / 0 fail: recents-first dedupe keeps the first occurrence and order; scoped "#" skips unscoped pages without dropping the surviving id; query path keeps the matching item). The gap is regression coverage: there is no command-palette/*.test.ts, and grep finds no test touching buildCommandPaletteGroups. This branch's entire behavior is the dedupe, and issue #1108's scroll-jump is subtle enough to regress unnoticed. Add a permanent unit test beside the module exercising the three paths before merge.
  • apps/web/src/command-palette/command-groups.ts:70 — the // ponytail: comment prefix reads as a personal handle leftover in a public repo; drop the prefix and keep only the rationale.
  • Commit f85904210 — subject "Prevent duplicate search results across groups" omits the repo's CL-#### ticket-id convention used throughout recent history; consider Prevent duplicate search results across groups (CL-1108).

Cited: temporary repro test (tmp/critique-tests/dedupe.test.ts, 4 pass/0 fail, since removed); git diff origin/main...HEAD = one file +4/−1; full apps/web bun test is inconclusive (13 pre-existing module-resolution failures, none touching command-palette — environment noise in the review worktree).

@corbitsdev corbitsdev deleted a comment from corbits-triage Bot Oct 7, 2026
@corbitsdev corbitsdev deleted a comment from corbits-triage Bot Oct 7, 2026
@pratikbuilds
pratikbuilds merged commit 564c703 into corbitsdev:main Oct 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar Search jumps upward when hovering a result also shown in Recent

2 participants