Skip to content

feat(search): one filter sidebar for the home page and results, kept on screen across a search, and faster results - #1729

Merged
sickerine merged 9 commits into
devfrom
feat/persistent-search-sidebar
Dec 4, 2026
Merged

sickerine merged 9 commits into
devfrom
feat/persistent-search-sidebar

Conversation

@sickerine

Copy link
Copy Markdown
Collaborator

A search from / used to drop the filter sidebar, flash a full-page spinner, and bring the results page's own sidebar back with its scroll reset: each page built its own.

One frame for / and /results

  • / and /results/* (and the same under /o/<slug>/) move into the app/(search)/ route group. Its layout, components/search-frame.tsx, holds one search state and one filter sidebar, so the sidebar stays on screen through a search, keeping its scroll and open state.
  • On / the sidebar starts folded, and a search opens it there and on its results. Back on / from results, the next search starts with the filters of the one just left, shown as chips in the box; a fresh load of / starts with none.
  • The results page's gate (which search it shows, waiting, lost, failed) is worked out once in the frame and shared with the results layout. A search this browser already holds shows at once. A page with no search to filter has no sidebar, and no Filters tab on a phone. While a page opened from its address waits for its saved copy, the sidebar is dimmed and still, and nothing is fetched.
  • The results layout has no loading boundary of its own, so the home page stays until the results can draw, and the search box no longer fades in.
  • On a phone both tabs stay mounted, so switching keeps typing, scroll and a search on its way. Arriving at a page shows its own tab.

Faster results

  • A signed-in account's search now runs while its request is counted in Convex, instead of after. That count took 360 to 1,080 ms per search from a local build; results arrived in 1.4 to 1.9 s instead of 1.9 to 2.4 s. A visitor is still counted first, in memory, and never reaches the source past its limit. An account past its limit still gets the 429; a new test proves it.

Fixes found while testing

  • Back then Forward lost a change made to the search without a new history entry (from the assistant or another tab): the newest entry's kept copy was never refreshed. Forward onto the newest entry now spends that copy.
  • The assistant says what a search holds only from its latest read or change, not from earlier in the chat.

Checks

  • npx tsc --noEmit; vitest on request limits, search actions and the library page.
  • npm run verify -- shift in Chromium and Firefox: search from /, Back, Forward and return to / show no blanks or spinners. What's left are the results page's own loading moves, which dev has too.
  • Playwright checks: a change from a second tab survives Back, Forward and reload; a bare-ID load sends one search with its filters; on a phone, Back to / lands on the Search tab.
  • Four GPT-6.1 Sol browser testers: two first-use walkers, history and navigation, assistant and translation. An Opus duplication review and a GPT-6.1 Sol cross-family review. Their findings on this change are fixed here; the ones that predate it are listed in the handback.

A separate PR brings the same commits to prod.

…on screen across a search

The home page and the results pages share a route group whose layout holds
the search state and the filter sidebar, so a search from / no longer drops
the sidebar, flashes a full-page spinner, or resets the sidebar's scroll.
A search this browser already holds shows at once instead of waiting for
its account copy; a results page opened from its address shows the
sidebar dimmed and inert until its saved copy arrives. On a phone both tabs
stay mounted, so switching keeps each one's scroll and anything on its way.
…othing blanking in between

- The results page's state is worked out once by the search frame, which
  hides the sidebar on a page with no search (deleted, unknown, failed).
- The results layout keeps no loading boundary of its own, so the home page
  stays until the results can draw, and the search box no longer fades in.
- An account's search runs while its request is counted in Convex instead
  of after; a visitor is still counted first, at no cost.
- The sidebar is away on every page with no search, including when the
  account can't be read, and on a phone the Filters tab goes with it.
- While its filters aren't the search's own yet, the whole sidebar is still,
  Clear all and its button included; its shortcut does nothing while away.
- The frame reads the gate's saved flag instead of its own copy.
- One PageSpinner for the four page spinners; one auth() per counted search.
- Fixed sidebar widths in FilterSidebar, one store factory for both sidebars,
  no pass-through [searchId] layouts, no dead mocks or attributes.
- The home box's mode resets while rendering, not in an effect.
…filters of the one just left

Two walkers and the navigation tester went back to Search for a related
search and had to set their limits again, while the box kept their words.
The sidebar still starts folded; the filters show as chips in the box.
…out a new entry

The newest history entry's copy was kept once and never refreshed, so after
one Back and Forward, a later change from the assistant or another tab was
put back to the older copy by the next Back and Forward, and lost. Forward
onto the newest entry now spends its copy, so the next Back keeps the search
as it then is. The assistant also says what a search holds only from its
latest read or change, not from earlier in the chat.
- A results page fetches nothing until it knows which search it shows, so a
  saved search opened by its ID no longer runs an unfiltered search first,
  and lost or failed pages fetch nothing.
- On a phone, arriving at the home page or a results page shows its own tab,
  not the Filters tab left open on the page before.
- The home search's working state is held by the frame, so a resize across
  the phone width mid-search keeps the box waiting.
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

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: b493e740-4009-4482-84dd-c59496378bb4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T03:06:37.832146Z 203db95 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

… aside (UI rule: one element doesn't both slide and fade)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 203db952d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/openalex/spend-requests.ts Resolved
Comment thread components/search-frame.tsx Resolved
Comment thread components/home/SearchInput.tsx Resolved
- An account Convex finds out of requests is refused here, before asking the
  source, for the next minute: past its limit it reaches the source at most
  once a minute on each server, not on every search.
- A results page waits to fetch while a question in its address is being
  written into a search, and on the bare /results address it's about to leave.
- The home box's picked mode lives beside its words in the query store, so a
  resize across the phone width keeps it.
…nd the account limit test holds the clock still
@sickerine
sickerine merged commit ca314bc into dev Dec 4, 2026
8 of 10 checks passed
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