Hi Sean,
Thanks for this! I wanted a widget like this for a long time.
Indeed, Ben worked on a similar idea, but I think your rendering works much better and your code is at the Morphic level. It would certainly be interesting to join forces here.
I reviewed a bit your code. Here is what I liked:
- I like it that you have explicit models for each section.
- I like the rendering of the sections.
- I like the Announcements.
- I like the fluent API for defining results.
Here is what I think could be improved:
- Computing the result list should not block the UI (it can take long).
- The amount of items in a section should be limited and if there are more of them they should be seen in a separate list or something like that. The idea would be to limit the vertical size of the widget.
- The input text should be a field (so, no enter should be allowed).
- The widget should be dismissible with Esc.
- The list of results should not allow editing (it now does so).
- Pressing the up/down arrows should move in the list. Any other typed character should continue modifying the text field area.
- The first element in the list should be selected all the time. Like this, you can type and then press Enter without using arrows and the mouse.
- "SpotlightCompletionExample open" does not seem work.
What do you say? I would be happy to review more code.
Cheers,
Doru