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

Account list update events #6106

Closed
Simon-Laux opened this issue Oct 24, 2024 · 2 comments · Fixed by #6118
Closed

Account list update events #6106

Simon-Laux opened this issue Oct 24, 2024 · 2 comments · Fixed by #6118
Assignees
Labels
enhancement New feature or request

Comments

@Simon-Laux
Copy link
Member

Simon-Laux commented Oct 24, 2024

What?

Emit events from core when Account List items change, similar to how chatlist UI events (#4476) were added.

How?

  • AccountListChanged
    • account id = 0 -> already used to emit accounts from the account manager (todo reference?)
    • This event is needed for addition and deletion of accounts. (technically it is for completeness)
  • AccountListItemChanged
    • account id = <id of account>

Update Cases for AccountListItemChanged:

Basically when properties in the jsonrpc Account Object changes, so

Why?

Basically move the responsibility for notifying the ui of updates to the core, to reduce need for workarounds in UI.
Yes in this case mostly desktop will benefit, but when android and iOS add proper tablet support/UI then they will benefit too.
deltatouch also has a desktop/tablet ui mode where the account list is always shown.

Who will do it?

I'm willing to do this. The intention in making this issue instead of a private note is to get feedback early.

Why now?

@Simon-Laux Simon-Laux added the enhancement New feature or request label Oct 24, 2024
@iequidoo
Copy link
Collaborator

iequidoo commented Oct 25, 2024

  • Do we need "account id" inside an event? AFAIU you subscribe to events of a particular account.
  • I'd suggest to think about more consistent naming, there is no such thing as AccountList in the core, only struct Accounts. So, i think AccountsChanged and AccountsItemChanged may be better.

@Simon-Laux
Copy link
Member Author

Simon-Laux commented Oct 26, 2024

Do we need "account id" inside an event?

The event emitter that desktop uses is on the Account Manager, all events have an id field for the account id, afaik events that are emitted in the account manager have id=0.
So no we don't need it inside EventType, because it is already "outside" in the Event.

So, i think AccountsChanged and AccountsItemChanged may be better.

fair point, though when we add sorting you might say the order that could change makes it a list? anyways I don't really care much about specific naming in this case, so would just agree here, unless there are other better suggestions.

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

Successfully merging a pull request may close this issue.

2 participants