core workflow: First pass on inlining symbols in the file tree
Created by: fkling
Addresses #38662 (closed)
This builds on top of Rok's symbol tag work.
It's a very rudimentary first pass to inline symbols. I basically duplicated the logic for the symbols sidebar with some changes:
- No pagination, I'm requesting a high number of symbols from the server and hope that this will suffice to load all symbols.
- Only show top level symbols. I don't know how reliable the
containerName
data is but if its set I assume it's not a top level symbol.
I had to thread some additional values through to the File component to be able to fetch symbols (I guess another alternative would be to also ask for symbol information when we fetch the file information in the first place, but that feels very wasteful).
It takes a moment to load the data, but I found it too distracting to immediately show a loading indicator. I added some logic to only show it after 800ms. If there are no symbols or there is an error a corresponding message will be shown.
A big drawback of this first solution is that it will show "No symbols found." for files that cannot have symbol information, such as Markdown files. This feels weird, but I don't know of a good way to handle that.
Lastly I'm currently keep using the Tab component because that allows me to keep using the "sidebar collapse" button without additional changes.
https://user-images.githubusercontent.com/179026/180432432-cad4fee9-0ad3-409f-b340-f70715c70a82.mp4
CAVEAT: Our symbol data is very low quality for some files, and using single character labels doesn't improve that either in this case (additional Slack thread).
Test plan
Open file, enable core workflow simple UI. See inline symbols.
App preview:
Check out the client app preview documentation to learn more.