Skip to content

hackathon - search/notebook: select and view notebook block results

Administrator requested to merge notebooks-search-block-rendering into notebooks-search

Created by: bobheadxi

This is a hackathon project, and is not being merged into main! See https://sourcegraph.com/notebooks/Tm90ZWJvb2s6NTE5, https://github.com/sourcegraph/sourcegraph/pull/33170, and https://github.com/sourcegraph/sourcegraph/pull/33161

This is entirely quite silly, but here we are!

https://user-images.githubusercontent.com/23356519/160736855-cc02b3d9-cc55-4f36-8e0a-5e8bb210fd6e.mp4

Lots of hacks and caveats:

  • some more code had to be copy-pasted from enterprise
  • not using strong types on notebook blocks, due to OSS/enterprise. Some massaging of data needed since there appears to be three (!!!!) different iterations of notebook block types: the DB types, the GraphQL types, and then an internal representation used within the notebook components that are each ever so slightly different.
  • I'm not sure how to go about doing "real" querying of blocks without some drastic database restructuring, I've left some notes in https://sourcegraph.com/notebooks/Tm90ZWJvb2s6NTE5
  • Search syntax and when to search what probably needs some work
  • I'm not 100% sure the match type implementation is the "right way" to do this but it does seem to work within the search job framework
  • The idea originally was to have query blocks open a new window by default but since that requires fiddling with the component and this kind of... just works... 😅

And of course, the big question:

image

Merge request reports

Loading