status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
303 stars 79 forks source link

Introduce `ModelEntryChangeTracker` utility component #16754

Closed micieslak closed 1 week ago

micieslak commented 1 week ago

Description

Some NIM models expose itemChanged signal, e.g.:

proc itemChanged(self: Model, pubKey: string) {.signal.}

in user_model. Then UI can track changes by listening to that signal. However this solution is specific to particular model - needs to be implemented manually per model. Additionally, the signal becomes unavailable to proxy models in the chain, making it unhandy on the UI side.

The solution is to provide such functionality but in a way not specific to any particular model. It can be done as a reusable component providing itemChanged when change on a given item needs to be detected.

Then custom itemChanged can be removed from the NIM side.

This is needed to proceed with https://github.com/status-im/status-desktop/pull/16667