Skip to content

search-ui: add forceButton prop to sidebar for VS Code

Administrator requested to merge tjk/search-sidebar-buttons into main

Created by: tjkandala

We need the search sidebar to only render buttons in VS Code so that query changes are committed to the zustand store directly, as opposed to through URL change on link click. We communicate query changes from the sidebar to the main search webview, which understandably do not share the same history.

To accomplish this, we need a prop to force search sidebar links to be rendered as buttons.

Test plan

  • sg start web-standalone
  • Execute a search
  • Observe that some sidebar suggestions are links by default (we do not use the forceButton prop in the web app)
    • sidebar-link-button-1
  • Click on a link to confirm that it still works (updates URL, executes search)
    • sidebar-link-button-2
  • Hardcode forceButton to true
  • Observe that links are now buttons, update query on click
    • sidebar-link-button-3

Merge request reports

Loading