Skip to content

fix(ui-ux): persist search topic filters in the URL - #1955

Merged
taopedia-site-maintainer[bot] merged 1 commit into
e35ventura:testfrom
9876543210-tc-0123456789:uiux/persist-search-topic-filters
Jul 1, 2026
Merged

fix(ui-ux): persist search topic filters in the URL#1955
taopedia-site-maintainer[bot] merged 1 commit into
e35ventura:testfrom
9876543210-tc-0123456789:uiux/persist-search-topic-filters

Conversation

@9876543210-tc-0123456789

@9876543210-tc-0123456789 9876543210-tc-0123456789 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Persist search topic filters in the URL so filtered search results survive refreshes and can be shared directly.

Linked issue

Closes #1954

Problem

  • Topic facets on /search/ only live in client state.
  • Refreshing the page clears the selected topics.
  • Sharing a filtered search URL does not reproduce the same filtered view.
  • Manually provided topic params are ignored on first load.

What changed

  • Read repeated topic query params on page load.
  • Sync active topic selections back into the URL with history.replaceState().
  • Remove invalid or invisible topic params when the current query does not support them.
  • Cover the new URL-state behavior in scripts/check-search-facets.js.

Before video

before.mp4

After video

after.mp4

Testing

  • npm run test:search-facets

Requested label

ui-ux

@taopedia-site-maintainer taopedia-site-maintainer Bot added the other Maintenance, deployment, tooling, validation, or repo work outside preferred categories label Jul 1, 2026
@9876543210-tc-0123456789

Copy link
Copy Markdown
Contributor Author

Maintainer note: this change is intended as a user-facing search usability fix rather than maintenance/tooling work. It persists active search topic filters in the URL so filtered searches survive refresh and can be shared directly. If you agree, please relabel this PR from other to ui-ux.

@taopedia-site-maintainer

Copy link
Copy Markdown

Verdict: Close

PR #1955: fix(ui-ux): persist search topic filters in the URL

This PR is labeled other, so failed local validation is a close decision.

Cross-repo validation:

  • pass merged checkout: Validated site PR head 7c81fd2 merged into test, with articles test.
  • pass npm ci: Dependencies installed.
  • fail cross-repo build: <--- Last few GCs --->

[2351189:0x37c33000] 69883 ms: Mark-Compact 971.9 (1005.0) -> 963.7 (1003.5) MB, pooled: 2 MB, 1427.32 / 0.00 ms (average mu = 0.195, current mu = 0.157) allocation failure; GC in old space requested
[2351189:0x37c33000] 71595 ms: Mark-Compact 966.3 (1005.0) -> 963.7 (996.7) MB, pooled: 9 MB, 1459.98 / 0.00 ms (average mu = 0.171, current mu = 0.147) allocation failure; GC in old space requested

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0xe42d60 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
2: 0x121ded0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
3: 0x121e1a7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
4: 0x144d015 [node]
5: 0x144d043 [node]
6: 0x146611a [node]
7: 0x14692e8 [node]
8: 0x1cd07a1 [node]
Aborted (core dumped)


Automated review by Taopedia Site Maintainer.

@e35ventura e35ventura added ui-ux Visual design, layout, or usability work and removed other Maintenance, deployment, tooling, validation, or repo work outside preferred categories labels Jul 1, 2026
@e35ventura e35ventura reopened this Jul 1, 2026
@taopedia-site-maintainer taopedia-site-maintainer Bot added other Maintenance, deployment, tooling, validation, or repo work outside preferred categories and removed ui-ux Visual design, layout, or usability work labels Jul 1, 2026
@taopedia-site-maintainer

Copy link
Copy Markdown

Verdict: Close

PR #1955: fix(ui-ux): persist search topic filters in the URL

This PR is labeled other, so failed local validation is a close decision.

Cross-repo validation:

  • pass merged checkout: Validated site PR head 7c81fd2 merged into test, with articles test.
  • pass npm ci: Dependencies installed.
  • fail cross-repo build: > taopedia@0.0.1 prebuild

node scripts/sync-articles.js && node scripts/generate-history.js && node scripts/build-linkgraph.js

Synced 681 published articles from taopedia-articles
Generating article history from Git...
✓ account_not_allowed_commit (1 revisions)
✓ account_rejects_locked_alpha (1 revisions)
✓ active_lock_exists (1 revisions)
✓ active_uid (29 revisions)
✓ activity_cutoff (32 revisions)
✓ activity_cutoff_factor (4 revisions)
✓ activity_cutoff_factor_milli_out_of_bounds (1 revisions)
✓ activity_cutoff_too_low (1 revisions)
✓ address_poisoning_scams (22 revisions)
✓ adjustment_interval (12 revisions)
✓ admin_action_prohibited_during_weights_window (1 revisions)
✓ admin_freeze_window (1 revisions)
✓ all_networks_in_immunity (1 revisions)
✓ alpha_distribution_ratio (35 revisions)
✓ alpha_halving (33 revisions)
✓ alpha_high (12 revisions)
✓ alpha_high_too_low (1 revisions)
✓ alpha_low (11 revisions)
✓ alpha_low_out_of_range (1 revisions)
✓ alpha_outstanding (32 revisions)
✓ alpha_price (31 revisions)
✓ alpha_reserve (38 revisions)
✓ alpha_sigmoid_steepness (10 revisions)
✓ alpha_staker (31 revisions)
✓ alpha_tokens (38 revisions)
✓ already_approved (1 revisions)
✓ already_deposited (1 revisions)
✓ already_finalized (1 revisions)
✓ already_stored (1 revisions)
✓ amount_too_low (1 revisions)
✓ announced_coldkey_hash_does_not_match (1 revisions)
✓ announcement_deposit_invariant_violated (1 revisions)
✓ arbitrage (18 revisions)
✓ arithmetic_overflow (1 revisions)
✓ auto_epoch_already_imminent (1 revisions)
✓ autostaking (35 revisions)
✓ axon (32 revisions)
✓ back_running (16 revisions)
✓ bad_enc_key_len (1 revisions)
✓ bad_origin (1 revisions)
✓ balance_low (1 revisions)
✓ balance...


Automated review by Taopedia Site Maintainer.

@taopedia-site-maintainer

Copy link
Copy Markdown

Verdict: Close

Final action: close.

PR #1955: fix(ui-ux): persist search topic filters in the URL

This PR is labeled other, and the autonomous reviewers did not both approve its codebase value versus bloat/reward. The site maintainer requires dual approval for other changes, so a split decision closes the PR.

Codex review:
This diff persists /search/ topic filter state in the URL and changes how filtered search views survive reload/share. That is a real user-facing behavior change, not a non-visual maintenance change.

Because this review run is constrained to non-visual PRs and must not judge UI/UX behavior, I cannot approve it as part of the autonomous non-visual path. The local validation is clean and the implementation appears targeted, but the central question for this lane is whether a non-visual maintenance change is necessary. This PR is outside that lane rather than a necessary non-visual fix.

Requested change: route this as a visual/user-facing search behavior PR instead of the non-visual other path, or resubmit only non-user-visible validation changes if that is the intended scope.

Claude advisory review:
Verdict: Approve

Reasoning:

  • Without this PR, topic filter selections on /search/ are lost on page refresh and cannot be shared by URL — a concrete, present functional gap for any user who filters results and then refreshes or tries to share the link.
  • The implementation is minimal and correct: searchParams.getAll('topic') reads repeated params on load; syncSearchUrl() uses replaceState (not pushState, so history is not polluted); topics are stripped from the URL when there is no active query; reconcileSelectedTopics() removes URL-specified topics that aren't in the current result set and handles the edge case where facets would be hidden (< 2 topics), preventing invisible stuck filters. Both result-rendering paths (metadata and Pagefind) call reconcileSelectedTopics.
  • The early syncSearchUrl() on load is a no-op when the URL already reflects what was read, and correctly clears topics when there is no query.
  • Validation additions in check-search-facets.js are proportional: source-level assertions guard against the behavior being accidentally removed; built-output assertions confirm it survives the Astro build. The readFileSync on search.astro is unconditional but the file always exists in the repo.
  • Build CI passes (three successive successful runs).

Risks:

  • None material. replaceState is broadly supported and the diff/no-op guard prevents spurious history entries. The sort in sortedSelectedTopics() produces stable URL output, avoiding unnecessary replaceState calls.
  • The dual source+HTML assertions are mildly fragile to minification renaming, but string literals like getAll('topic') are unlikely to be mangled by Astro's bundler.

Why closed:

  • The final action is close, even if one advisory reviewer approved.
  • Both automated reviewers must approve this class of PR before it can merge.

Automated review by Taopedia Site Maintainer.

@e35ventura e35ventura reopened this Jul 1, 2026
@taopedia-site-maintainer taopedia-site-maintainer Bot added ui-ux Visual design, layout, or usability work and removed other Maintenance, deployment, tooling, validation, or repo work outside preferred categories labels Jul 1, 2026

@taopedia-site-maintainer taopedia-site-maintainer 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.

Verdict: Auto-merge approved

PR #1955: fix(ui-ux): persist search topic filters in the URL

Automated reviewers:

  • Codex: The PR fixes a real user-facing search behavior regression: selected search topic filters are currently lost on refresh and cannot be shared through the URL.
  • Claude: approve

Cross-repo validation:

  • pass merged checkout: PR head 7c81fd2 merges cleanly into test. Build/render is validated by the required GitHub Actions build check.

Automated review by Taopedia Site Maintainer.

@taopedia-site-maintainer
taopedia-site-maintainer Bot merged commit c610674 into e35ventura:test Jul 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui-ux Visual design, layout, or usability work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist search topic filters in the URL

2 participants