varnamproject / varnam-fcitx5

Fcitx5 wrapper for Varnam input method. Easily type Indian languages on Linux desktops.
https://varnamproject.com/
GNU General Public License v3.0
6 stars 1 forks source link

Settings window #1

Open subins2000 opened 4 months ago

subins2000 commented 4 months ago
Screenshot 2024-05-04 at 8 40 20 PM

Also one more thing: Learn words checkbox

cc @anoopmsivadas

anoopmsivadas commented 3 months ago

I've added the learn word checkbox to the config window. But haven't figured out how to display the learnt words using only the fcitx config tool. It reads all configuration information internally from a file and does not permit any function calls. So we might have to build a tool to manage the learnt word list. @subins2000

subins2000 commented 3 months ago

@anoopmsivadas Oh I see, how to solve this requires a bit more thinking from a UX perspective too, we can further discuss this next time we meet up

wengxt commented 3 months ago

@anoopmsivadas Basically there are two options in fcitx. If you want a simple list, you can wrap a std::vector .

The data and the storage does not have to be the fcitx styled ini.

You can instead, create a fcitx::Configuration for only passing the data between configtool and fcitx, and fill the data just when getConfig/getSubConfig is called.

Alternatively, you can create a qt plugin and do whatever you want with qt.

wengxt commented 3 months ago

For example, in https://github.com/fcitx/fcitx5-unikey/tree/master/keymap-editor

For example, in classicui

getConfig tries to fill some data just at the time the config is requested. (This example fills dynamic config metadata not data, but the idea is the same).

https://github.com/fcitx/fcitx5/blob/fab6bbd6c24c54246ceacc5e521820b13c6f316c/src/ui/classic/classicui.cpp#L241

For example, in keyboard engine, a vector of vector looks like: (kcm might looks better) fcitx-config-qt 图片 kcm in KDE 图片

anoopmsivadas commented 3 months ago

@anoopmsivadas Basically there are two options in fcitx. If you want a simple list, you can wrap a std::vector .

The data and the storage does not have to be the fcitx styled ini.

You can instead, create a fcitx::Configuration for only passing the data between configtool and fcitx, and fill the data just when getConfig/getSubConfig is called.

Alternatively, you can create a qt plugin and do whatever you want with qt.

Hi @wengxt , Thank you so much for the suggestions. I was exploring the latter option, that is creating a qt plugin. What we need is a window which lists all the words that the Varnam Engine has learnt over time and an option to delete/unlearn them. And in order to delete any word, we have to call an external function from Varnam. A Qt plugin seems to be better and more flexible solution to me. But I'll look into both options and would let you know if any guidance is needed, hope you won't mind 😅 .

This is what we have in our ibus engine. Screenshot from 2024-05-29 19-33-11

wengxt commented 3 months ago

@anoopmsivadas I'm aware of that UI. I think the what makes it tricky is that, when to notify the engine to reload? There's a few different approach on this depending on how the data is accessed.

How is the data stored? Does it implicitly support concurrency access? or you'll need to notify engine to re-read the file?

Also, here's another different approach we use in Pinyin. You press a hotkey to enter a candidate deletion mode, and then you select the candidate to remove (in our case, it's not just remove from a dict, but remove frequency data associate with it etc) . See the video below.

https://github.com/varnamproject/varnam-fcitx5/assets/259684/9cdaf6c0-e41b-45e4-bcd0-060a21177fcf

I would personally prefer this approach since if user find there was something wrong memorized, they could directly erase it, instead of going to another UI and delete it.

If you ask me about opinion the current UI you have for ibus, I would say..

  1. It's not searchable.
  2. There's no batch operation
  3. I'm not sure why there's prev/next.. does it need to use a pagination method?
  4. I would not expose timestamp in UI. You can take firefox web history as an example on how it's presented to user. Also user may have bad feeling about their input being memorized with an accurate timestamp (I know it maybe necessary to implement certain features, but hide it from UI might be a good idea).
  5. Related to (2). Since you have timestamp, maybe consider a delete n-days history or sth like that.
subins2000 commented 2 months ago

How is the data stored?

The learnt words are stored in a SQLite DB ~/.local/share/varnam/learnings/ml.vst.learnings

Does it implicitly support concurrency access? or you'll need to notify engine to re-read the file?

Yes, it supports concurrency since it's a SQLite DB, so no need to notify engine to re-read

You press a hotkey to enter a candidate deletion mode, and then you select the candidate to remove

We have this feature already, when highlighted a candidate we press CTRL + DEL to unlearn it (remove)

instead of going to another UI and delete it

The UI is just another way to unlearn it

I would not expose timestamp in UI. You can take firefox web history as an example on how it's presented to user. Also user may have bad feeling about their input being memorized with an accurate timestamp (I know it maybe necessary to implement certain features, but hide it from UI might be a good idea).

Yeah I agree, showing the timestamp doesn't add any value

Related to (2). Since you have timestamp, maybe consider a delete n-days history or sth like that.

Would be a nice addition to have

Thank you for the suggestions! Me & @anoopmsivadas discussed this and decided to make a desktop app for showing the recently learnt words, for both the ibus & fcitx engines. This makes it easier for us to maintain everything.