Skip to content

Add component search URL state#2447

Open
Mbeaulne wants to merge 1 commit into
06-22-fix-ai-search-no-results-fallbackfrom
06-23-add_component_search_url_state
Open

Add component search URL state#2447
Mbeaulne wants to merge 1 commit into
06-22-fix-ai-search-no-results-fallbackfrom
06-23-add_component_search_url_state

Conversation

@Mbeaulne

@Mbeaulne Mbeaulne commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Description

The component search state (q and disabled_sources) is now persisted in the URL, making searches shareable and preserving state across page refreshes. A "Copy component link" button has been added to the detail pane so users can copy a URL that includes the selected component, active search query, and source filters.

Key behaviors:

  • The search input initializes from the q URL param on mount and syncs back to the URL after a debounce, without trimming whitespace while the input is focused.
  • Focused input is protected from URL echo updates — navigating back to the same page with a slightly different URL (e.g. trimmed query) will not overwrite what the user is actively typing.
  • Source filter toggles immediately write disabled_sources into the URL.
  • Closing the detail pane preserves the active search query and source filters rather than clearing all search params.
  • useDebouncedSearchValue now accepts an initialValue and a shouldSyncExternalValue guard so external value changes can be blocked while the input is focused.
  • New helpers readComponentSearchQuery, readDisabledSourceKeys, and createDashboardComponentsV2SearchParams centralize URL param parsing and serialization, with unknown source keys silently dropped.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Test Instructions

  1. Navigate to the Components V2 dashboard page.
  2. Type a search query and verify the q param appears in the URL after the debounce delay.
  3. Reload the page and confirm the search input and filtered results are restored from the URL.
  4. Toggle source filters and confirm disabled_sources updates in the URL immediately.
  5. Open a component detail pane, then close it and confirm the search query and source filters remain in the URL.
  6. With a component selected, click "Copy component link" and paste the URL — confirm it includes the selected component, query, and filters.
  7. Type in the search input rapidly and confirm the URL does not rewrite the input value while it is focused.

Additional Comments

The disabled_sources param only accepts the known source keys (standard, published, registered, user); unrecognized values are silently dropped during parsing and serialization.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 06-23-add_component_search_url_state/1e0f470

Mbeaulne commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Mbeaulne Mbeaulne requested a review from a team as a code owner June 24, 2026 18:55
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_search_url_state branch from 6d83fca to 97297cc Compare June 24, 2026 19:52
@Mbeaulne Mbeaulne force-pushed the 06-22-fix-ai-search-no-results-fallback branch from 7b2b03a to 821d21a Compare June 24, 2026 19:52
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_search_url_state branch from 97297cc to f57ed8d Compare June 25, 2026 15:55
@Mbeaulne Mbeaulne force-pushed the 06-22-fix-ai-search-no-results-fallback branch 2 times, most recently from dc3ad56 to d4954c6 Compare June 25, 2026 19:38
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_search_url_state branch from f57ed8d to c24dece Compare June 25, 2026 19:38
@Mbeaulne Mbeaulne force-pushed the 06-22-fix-ai-search-no-results-fallback branch from d4954c6 to 83db60e Compare June 25, 2026 19:43
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_search_url_state branch from c24dece to 1e0f470 Compare June 25, 2026 19:43
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