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

Delete Chat Modal #137

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Delete Chat Modal #137

merged 1 commit into from
Jul 8, 2024

Conversation

noxware
Copy link
Collaborator

@noxware noxware commented Jul 5, 2024

Changes

  • Adds a confirmation modal when trying to delete a chat.
    • The modal is almost a copy of the existing modal for deleting models.
  • Design

Recording

Screen.Recording.2024-07-05.at.12.31.06.mp4

copying delete model modal
let store = scope.data.get_mut::<Store>().unwrap();
store.delete_chat(self.chat_id);
cx.widget_action(widget_uid, &scope.path, PortalAction::Close);
cx.redraw_all();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tell makepad to fully redraw to incorporate the changes from the store.

Copy link
Collaborator

@joulei joulei Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love this (because it's very rare you need to redraw the entire visible application, e.g. resizing), but I get that you're avoiding the creation of some kind of action to listen to and redraw in the relevant parts of the UI.
I think is fine for now, eventually we could add metadata to the PortalAction::Close action (so we listen to the right one) and redraw based on that.

@jmbejar jmbejar merged commit 02026fe into main Jul 8, 2024
@jmbejar jmbejar deleted the delete_chat_confirmation branch July 8, 2024 13:31
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

Successfully merging this pull request may close these issues.

3 participants