kieler / klighd-vscode

Eclipse Public License 2.0
8 stars 6 forks source link

Ctrl + F for diagrams #167

Open soerendomroes opened 4 months ago

soerendomroes commented 4 months ago

Why bother with finding the best algorithm to create a readable diagram with labels that are big enough to read to be able to find everything if one can just search it.

It needs to be evaluated whether we can directly do a string search in the DOM and how this interacts with filtering techniques such as smart zoom. Just searching in the text and when highlighting or zooming into the corresponding diagram element might also be possible.

If we do this, we should carefully consider the different interaction techniques and how this can be integrated into VS Code and the cli tool at the same time without reimplementing all search features one usually has in these tools.

NiklasRentzCAU commented 4 months ago

Ctrl+F does work in the CLI, it uses the default browser implementation and searches for text in the DOM. However, this means that

  1. It does not work together with smart zoom. When an element is off-screen or hidden because of readability, it cannot be searched.
  2. it does not zoom/pan to the searched element, the default browser implementation would only use the default browser scroll to to to the highlighted element, which is not what Sprotty does. We would need a pan if offscreen and maybe a zoom if the element is too small.