darashi / nos.today

Nostr NIP-50 search web client
https://nos.today
MIT License
18 stars 3 forks source link

Increase contrast of search term [UI] #4

Open alltheseas opened 1 year ago

alltheseas commented 1 year ago

Mockup:

boldpurple

darashi commented 1 year ago

It would be nice to have this, but it does not seem to be that easy to implement properly.

The first reason is that the query is interpreted by the NIP-50 relay, not always as an exact match. For example, my implementation, search.nos.today treats the query as a space-separated AND search (Symbols may be dropped. Details depend on Elasticsearch). If approximations are good enough, we might be able to work around it.

Now that we have determined which strings should be highlighted, there is another problem. This is an implementation problem. It does not seem to be that easy to highlight while taking into account the nesting of tags. There may be cases where it is necessary to highlight across the boundaries of tags that already exist.

So, I think it would be nice to have it, but may not be able to implement it right away. I will continue to think about it.