Skip to content

search-ui: add props to SearchBox for VS Code

Administrator requested to merge tjk/search-box-refprop into main

Created by: tjkandala

Add props to SearchBox used in the VS Code extension.

  • onEditorCreated: Used to get a reference to the underlying Monaco instance. We use this in the extension to focus the search box on events such as sidebar suggestion clicks or search tab focus.
  • className and containerClassName: Self-explanatory, enables variable styling across clients now that we use CSS modules (unable to reference class to override)
  • fetchStreamSuggestions: We use a different implementation of this in the extension (we call the "default" implementation in node, send result in message back to UI)

Test plan

  • sg start web-standalone
  • Observe that the search box still works.
  • We don't seem to have unit tests for Monaco, so I added a temporary onEditorCreated callback in SearchNavbarItem to ensure that everything is wired up correctly (just logged editor instance to console).

Merge request reports

Loading