identity-wallet icon indicating copy to clipboard operation
identity-wallet copied to clipboard

Refactor `enum CurrentUserPrompt` to `trait CurrentUserPrompt`

Open nanderstabel opened this issue 1 year ago • 0 comments

Description

The goal of this issue is to restructure the CurrentUserPromps to follow the same format as actions. This again will make it much clearer and easier for Impierce but also for third parties to add and navigate through the CurrentUserPromps.

The idea is to turn CurrentUserPromps into structs as well (which implement a new CurrentUserPrompt trait). Though these structs will be fairly simple for our current code, this does open up more flexibility in future/third party additions. The current enum might appear as a cleaner solution to our current needs, but as enums are static this will bar us from more flexible ways of extending the code in the future.

Again we will use the typetag library to compliment these structs. This will make it possible to serialize the CurrentUserPromps for easy back-end to front-end communication.

The file will contain some comments guidelining third party usage as well.

Motivation

The result will be a clear a much clearer, cleaner and safer pattern to follow for third parties to add their UserPrompts.

Resources

n/a

To-do List

[ ] Transpose existing code to new format [ ] Add comments and guidelines [ ] Test new code

nanderstabel avatar Jan 16 '24 12:01 nanderstabel