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

PromptStack model #80

Open
Ivshti opened this issue Jun 27, 2019 · 2 comments
Open

PromptStack model #80

Ivshti opened this issue Jun 27, 2019 · 2 comments
Labels
Milestone

Comments

@Ivshti
Copy link
Member

Ivshti commented Jun 27, 2019

This model will be used for showing prompt modals to the user, such as:

  • to ask the user if they're sure if they want to install an add-on
  • if they're sure to open an external URL
  • to show what's new
  • to show advanced context menus on right click (will require different styling/custom popup position, but follows the same logic)
  • to show subtitle controls

and others

PromptStack model that keeps a stack of user prompts that resolve to being closed or actions

It will handle a Msg: OpenPrompt { title, content, buttons }

title is a string title, content is a markdown string, and buttons is Vec<PromptButton>

PromptButton will have content, tooltip, onAction which is a enum PromptButtonAction { Dismiss, MsgAndDismiss(Msg), MsgNoDismiss(Msg) }

more than one prompts can be stacked (nested), hence the name PromptStack

we can use the prompt stack in conjunction with other stateful components, such as the subtitle picker; it will just use the promptstack for it's show/hide logic

@nklhtv
Copy link
Contributor

nklhtv commented Jan 7, 2020

this should be moved to stremio-seed-poc

@Ivshti
Copy link
Member Author

Ivshti commented Jan 7, 2020

disagree, I think it can be used in many stremio implementations and therefore it has a place in core

The logic is the same for all platforms, no matter how modals display (full screen or as a dialog)

@nklhtv nklhtv modified the milestones: v1.0, v1.3 Jun 8, 2022
@nklhtv nklhtv added the proposal label Jun 8, 2022
elpiel added a commit that referenced this issue Jun 14, 2024
Serialize ctx events & implement dismissed events bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants