Skip to content

Sync search filters to the URL - #116

Merged
thcathy merged 4 commits into
masterfrom
cursor/search-query-params-fd1f
Oct 13, 2026
Merged

thcathy merged 4 commits into
masterfrom
cursor/search-query-params-fd1f

Conversation

@thcathy

@thcathy thcathy commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Search Dictation now reads and writes q, suitable, and type on /search-dictation.

  • Opening a filtered URL fills the form and runs the search when the form is valid.
  • Choosing Suitable or Type, running Search, or clearing the search updates the query with replaceUrl.
  • Any and blank values are omitted. Unknown suitable/type values become Any. A too-short q shows the existing validation message and does not search.
  • Creator and date stay on the form only. A future sort param is left untouched.
  • Returning from a dictation with the same query does not search again, so the result list and its page stay put. A chip change updates the URL without searching; the next enter searches that URL.
  • A filter-only URL searches and does not store a blank keyword in history.
  • Share links stay on /link/dictation-view/:id. This does not move state-only openDictation calls onto the id path.

Tests

  • Unit: param → form → search, form → URL, unchanged query skips a second search, a chip change searches again on the next enter, share URL is still /link/dictation-view/{id}.
  • Playwright: e2e/search-dictation-query.spec.ts.

Demo

Pasting /search-dictation?q=apple&suitable=JuniorPrimary&type=Vocab restores the keyword, the Junior Primary and Word chips, and the matching list.

Deep-linked search for apple, Junior Primary, Word

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 4 commits October 10, 2026 23:41
Reading q, suitable, and type on enter restores the search form and runs the search. Chip changes, search, and clear rewrite those params with replaceUrl.

Co-authored-by: Timmy Wong <thcathy@gmail.com>
Read, compare, and write q, suitable, and type through SearchLink. A filter-only URL still searches, and it no longer stores an empty keyword.

Co-authored-by: Timmy Wong <thcathy@gmail.com>
SonarCloud flagged find() on the history list because the result is only used as a boolean.

Co-authored-by: Timmy Wong <thcathy@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@thcathy
thcathy marked this pull request as ready for review October 13, 2026 13:53
@thcathy
thcathy merged commit 90e5cd7 into master Oct 13, 2026
2 checks passed
@thcathy
thcathy deleted the cursor/search-query-params-fd1f branch October 13, 2026 13:54
@sonarqubecloud

Copy link
Copy Markdown

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