wareya / nazeka

Nazeka is a rikai replacement
https://addons.mozilla.org/en-US/firefox/addon/nazeka/
50 stars 8 forks source link

option to highlight detected word in text line, not word position in pop-up window #43

Closed qqw1235f closed 4 years ago

qqw1235f commented 4 years ago

Hello, i suggest to add an option to disable display of word position in pop-up window, and enable highlighting of detected word in text itself (like in rikai or yomichan) xnviewmp_2020-01-10-16_17_05. Personally i like nazeka more, but i miss this feature from yomichan. Is this not too annoying to implement?

wareya commented 4 years ago

It's not annoying to implement, but it conflicts with other nazeka features. Nazeka has the ability to override the lookup context using text selections, which makes it possible to force Nazeka to pick up specific phrases or entire paragraphs for mining, instead of just the sentence it detects. (Also useful when it gets sentence boundaries wrong.)

Changing the selection to highlight the looked-up text also causes weird things to happen to the browser's idea of where the navigation cursor is, and where text focus is, which can cause webpages with complicated javascript (like twitter, discord, youtube, etc.) to do weird, unexpected thing.

If I added an option for this, it would take a lot of work to prevent it from causing collateral damage, so even though Nazeka generally has way more options than anyone would normally have any reason to use, it's one of the few options that I haven't given serious thought to adding so far. If I ever decided to add it, it would be very low priority, since there's so much potential to cause collateral damage.

The context-in-popup highlight was the best middle ground I could come up with that didn't involve actually using text selections to highlight the detected text. It also made it possible to tell exactly what phrases alternative, shorter lookups were coming from (like the following picture), so I decided that it was okay to expect users to get used to looking for the highlight in the popup instead of the web page, since it was possible to give more detail there.

image

qqw1235f commented 4 years ago

It's not annoying to implement, but it conflicts with other nazeka features.

Yes, i know, that's why i suggested this only as optional feature which you can enable only if you need it and don't need another feature with overriding lookup. Alright then, after your explanations everything makes sense, so i'm gonna try to just get used to it, thanks for your detailed reply.