Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings window #1

Open
subins2000 opened this issue May 4, 2024 · 7 comments
Open

Settings window #1

subins2000 opened this issue May 4, 2024 · 7 comments
Assignees

Comments

@subins2000
Copy link
Member

Screenshot 2024-05-04 at 8 40 20 PM

Also one more thing: Learn words checkbox

cc @anoopmsivadas

@anoopmsivadas
Copy link
Member

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
Copy link
Member Author

@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
Copy link

wengxt commented May 28, 2024

@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
Copy link

wengxt commented May 28, 2024

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
Copy link
Member

@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

@anoopmsivadas anoopmsivadas self-assigned this May 29, 2024
@wengxt
Copy link

wengxt commented May 29, 2024

@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.

Screencast_20240529_082739.mp4

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
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants