Skip to content

feat: add instant latest tab to semantic search - #1452

Merged
paulinevos merged 1 commit into
dev-null-sh:productionfrom
paulinevos:feat/search-latest-tab
Nov 3, 2026
Merged

paulinevos merged 1 commit into
dev-null-sh:productionfrom
paulinevos:feat/search-latest-tab

Conversation

@paulinevos

@paulinevos paulinevos commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Most relevant and Latest tabs to semantic search results, with Most relevant selected by default. Latest shows the already-returned matches from the past seven days, newest first. Switching tabs never fetches results again or loads another page.

Changes

  • Add CommitSearchResults.latest() as a non-mutating, week-limited view of the loaded result set.
  • Derive both lists when the existing search response arrives; use accessible local tabs with arrow-key navigation and reset to Most relevant for a new query.
  • Give Latest its own heading, count, and empty-state guidance. Leave dialog search, headline results, API responses, and relevance ranking unchanged.
  • Cover date ordering, the inclusive seven-day boundary, timezone offsets, empty results, and preservation of relevance order; update the public knowledge base.

Validation

  • composer test:lint — passed (existing JavaScript floating-promise warnings remain).
  • composer test:types — passed, including PHPStan and both TypeScript projects.
  • composer test:type-coverage — passed, 100%.
  • bun run test:unit — 233 passed.
  • php -d memory_limit=-1 vendor/bin/pest --parallel --ci --coverage --exactly=100.0 --passthru-php="'-d' 'memory_limit=-1'" — 5,585 passed, 30,248 assertions, 100% coverage.
  • bun run build — passed.
  • Chromium UI checks at 1440×900, 1366×650, and 390×844 in light/dark: default selection, both tabs, newest-first filtering, no recent matches, no matches, delayed loading, query changes, keyboard ArrowLeft/End, and horizontal overflow checks passed. Compared to the base revision using the same synthetic result fixture; inspection captures are intentionally omitted from this text-only PR.
  • Real local server: one semantic-search request before switching tabs, still one after switching there and back. No tab-triggered page navigation.
  • Mobile: Pixel 7 Chromium browser emulation on Linux, with pointer: coarse verified. Fresh load, tap both tabs, client-side search submission, and scrolling beyond the first screen passed; no horizontal overflow. This is browser emulation, not hardware or an Android simulator. OS keyboard, browser chrome, and native safe areas were not verified.
  • PerformanceObserver recorded zero non-input CLS in the exercised scenarios; replacing the result list after user input produces input-excluded layout shifts. Search results do not poll.

Independent review

An independent read-only agent reviewer returned CODE: PASS and VISUAL: PASS, with no unresolved blockers, for base 9c74e97d531404e0dffdddc692e6e4edd0d29000 and head f523d63928598f69c780b6be909c22a156471fc5. The reviewer inspected the complete four-file diff, test/build logs, before/after screenshot sheets, browser assertions/results, touch-emulation results, and the corrected pointer-interaction recording contact sheet. The reviewer did not rerun the full suites. Keyboard and network claims rely on executed assertions rather than the recording. No inspection media is included in this text-only PR.

Limitations

Latest is a filtered view of the existing limited semantic result set, not an exhaustive search for recent commits. It intentionally does not request additional matches. The seven-day window is fixed when that search response arrives. No physical mobile device or native on-screen keyboard was available for verification.

Summary by CodeRabbit

  • New Features
    • Commit search results are now available in “Most relevant” and “Latest” tabs. “Latest” shows matches from the past seven days, newest first, with a separate message when there are no recent matches.
  • Documentation
    • Updated search guidance to clarify that switching to “Latest” filters the existing results and does not run another search or fetch additional matches.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 23:01
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The search page now presents “Most relevant” and “Latest” tabs. Latest shows matching commits from the past seven days, newest first, using the same result set as Most relevant.

Changes: Commit search tabs

Layer / File(s) Summary
Latest result filtering
resources/js/lib/commit-search-results.ts, tests/Unit/CommitSearchResults.test.ts
CommitSearchResults.latest() returns commits created within the past seven days, sorted newest first, while retaining the search term and leaving the original result order unchanged. Tests cover the date boundary and empty results.
Search results tabs
resources/js/pages/search/index.tsx, KNOWLEDGE_BASE.md
The page stores and displays relevant and latest results in separate tabs. Successful searches populate both sets from the returned commits; non-aborted failures use empty sets. The documentation describes the tab behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: nunomaduro, mnapoli

Merge Risk: Minimal · up to f523d

Latest uses the existing search results. No material merge risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: add instant latest tab to semantic search" matches the main change. The PR adds a Latest tab next to Most relevant in semantic search results. The tab shows already-loaded matches fro…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat: add instant latest tab to semantic search" matches the main change. The PR adds a Latest tab next to Most relevant in semantic search results. The tab shows already-loaded matches from the past seven days, newest first, through a new CommitSearchResults.latest() method. The title is specific and concise, and it follows conventional commit style. It does not mention the non-mutating view or the fixed seven-day window, but those are details, not the primary change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4ad5b99-6d63-4f6a-b7f8-af6fa356cf2a
Commits

Reviewing files that changed from the base of the PR and between 9c74e97 and f523d63.

Files selected for processing: 4
  • KNOWLEDGE_BASE.md
  • resources/js/lib/commit-search-results.ts
  • resources/js/pages/search/index.tsx
  • tests/Unit/CommitSearchResults.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Copilot AI 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.

🟡 Changes recommended

Vote responses remain only in local component state, so switching search tabs loses the saved results and leaves the other tab stale.

1 open issue
What changed in this PR

Adds an instant Latest view to semantic search using already-loaded matches, while keeping Most relevant as the default and avoiding additional requests.

Changes:

  • Adds a non-mutating, newest-first view limited to the past seven days.
  • Introduces accessible result tabs with separate headings and empty-state guidance.
  • Adds date-filtering tests and documents the limited-result-set behavior.
File Description
tests/​Unit/​CommitSearchResults.test.ts Tests ordering, seven-day boundary, timezone offsets, empty results, and relevance preservation.
resources/​js/​pages/​search/​index.tsx Derives both result views and adds local tabs that reset for new queries.
resources/​js/​lib/​commit-search-results.ts Implements the non-mutating latest-results filter and sort.
KNOWLEDGE_BASE.md Documents tab behavior and the scope of Latest results.

Review effort: Balanced

Comment on lines +112 to +113
<TabPanels>
<TabPanel>
@paulinevos
paulinevos merged commit 2fc3bdb into dev-null-sh:production Nov 3, 2026
12 checks passed
@paulinevos
paulinevos deleted the feat/search-latest-tab branch November 3, 2026 23:09
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.

2 participants