Skip to content

Add context-aware component search suggestions#2458

Open
Mbeaulne wants to merge 1 commit into
06-23-add_component_discovery_docsfrom
06-23-add_context-aware_component_search_suggestions
Open

Add context-aware component search suggestions#2458
Mbeaulne wants to merge 1 commit into
06-23-add_component_discovery_docsfrom
06-23-add_context-aware_component_search_suggestions

Conversation

@Mbeaulne

@Mbeaulne Mbeaulne commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Description

Replaces the static list of hardcoded component search suggestions with a dynamic buildComponentSearchSuggestions function that derives suggestions from the loaded component index. Suggestions are scored and ranked based on common input/output types (highest weight), registered source labels, and component name tokens, with curated fallback defaults when the index is sparse. Each suggestion now carries a kind field ("type", "source", "name", or "default") and a suggestion_position index, both of which are emitted in tracking events instead of the previous suggested_query field. Suggestions that overlap with the current query are filtered out, and the empty-state help text is updated to reflect that suggestions are derived from loaded sources.

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. Open the component search panel in the editor or dashboard with no query entered and verify that the empty-state suggestion chips reflect types and source labels from your loaded component libraries rather than always showing the same four hardcoded terms.
  2. Enter a partial query (e.g. csv) and confirm that csv no longer appears as a suggestion chip.
  3. Load a registered component library and verify its label appears as a suggestion chip.
  4. Confirm that tracking events for suggestion clicks now include suggestion_kind and suggestion_position instead of suggested_query.
  5. Run the unit tests in componentSearchSuggestions.test.ts to verify scoring, source label inclusion, and fallback behaviour.

Additional Comments

The COMPONENT_SEARCH_EMPTY_STATE_SUGGESTIONS constant has been removed. The ComponentSearchEmptyStateSuggestions component no longer sources suggestions internally; callers are now responsible for passing a suggestions prop, which allows each surface (dashboard v2 and editor v2) to supply index-aware suggestions independently.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 06-23-add_context-aware_component_search_suggestions/6da5934

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 force-pushed the 06-23-add_component_discovery_docs branch from f91e6bf to 55cfa5e Compare June 24, 2026 18:11
@Mbeaulne Mbeaulne force-pushed the 06-23-add_context-aware_component_search_suggestions branch 2 times, most recently from 514ce6a to d7eb41c Compare June 24, 2026 18:24
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_discovery_docs branch from 55cfa5e to 3010521 Compare June 24, 2026 18:24
@Mbeaulne Mbeaulne force-pushed the 06-23-add_context-aware_component_search_suggestions branch from d7eb41c to cbff091 Compare June 24, 2026 18:36
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_discovery_docs branch from 3010521 to 01ce24d Compare June 24, 2026 18:36
@Mbeaulne Mbeaulne force-pushed the 06-23-add_context-aware_component_search_suggestions branch from cbff091 to a5c0c78 Compare June 24, 2026 18:52
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_discovery_docs branch from 01ce24d to bfc6ffa Compare June 24, 2026 18:52
@Mbeaulne Mbeaulne marked this pull request as ready for review June 24, 2026 18:56
@Mbeaulne Mbeaulne requested a review from a team as a code owner June 24, 2026 18:56
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_discovery_docs branch from bfc6ffa to a7544f7 Compare June 24, 2026 19:52
@Mbeaulne Mbeaulne force-pushed the 06-23-add_context-aware_component_search_suggestions branch from a5c0c78 to 67d60c5 Compare June 24, 2026 19:52
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_discovery_docs branch from a7544f7 to 3470b6f Compare June 25, 2026 15:55
@Mbeaulne Mbeaulne force-pushed the 06-23-add_context-aware_component_search_suggestions branch from 67d60c5 to 48c5305 Compare June 25, 2026 15:55
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_discovery_docs branch from 3470b6f to 80b5b76 Compare June 25, 2026 19:38
@Mbeaulne Mbeaulne force-pushed the 06-23-add_context-aware_component_search_suggestions branch from 48c5305 to 41c25b4 Compare June 25, 2026 19:38
@Mbeaulne Mbeaulne force-pushed the 06-23-add_component_discovery_docs branch from 80b5b76 to d4353cd Compare June 25, 2026 19:43
@Mbeaulne Mbeaulne force-pushed the 06-23-add_context-aware_component_search_suggestions branch from 41c25b4 to 6da5934 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