Currently, I am developing a Web-GUI for a semantic search which involves using a single text-input as a search-box. The typical queries include phrases like "buildings higher than 100 meters".
My goal is to enhance the user experience by formatting the input text in a way that the server's response highlights entities and operators with different colors. This will help the user easily identify what the computer has understood.
For instance:
https://i.sstatic.net/4OEMs.jpg
I have come across numerous methods to achieve this, but most of them seem cumbersome. My aim is to maintain the simplicity of a regular text-field. Users should be able to navigate within the text by clicking and using arrow keys. While awaiting the server's response, the text should remain black. Once the server interprets the query, the colored highlighting should appear almost instantly (within a few milliseconds).
This thread serves as a platform for discussing various approaches to tackle this challenge and identifying the optimal solution that caters to all users' needs.