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

feat: hilbish.actions interface #243

Open
TorchedSammy opened this issue Feb 21, 2023 · 0 comments
Open

feat: hilbish.actions interface #243

TorchedSammy opened this issue Feb 21, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@TorchedSammy
Copy link
Member

TorchedSammy commented Feb 21, 2023

the purpose of this will be to store some sort of global stack to have a unified interface for undoing (and redoing..?) shell actions. a couple ideas in mind for undoing things:

this will be stored in the form of a stack (or would it be a delayed fifo?)

there are 2 ways it can operate:

  • 5s after an action is pushed (of course time configurable), it is actually performed. this can be done easily via timeout api
  • before truly exiting the shell, just perform all actions one after the other

the expected functions for this interface:

  • push(action): pushes a new action to the list
  • pop(): pops the latest action
  • get(id): retrieve an action by its id
  • perform(id): perform the action that has the appropriate id

an action is a simple object that has the following properties/functions

  • performer: a function that will do the stated action. with the example of the history delete, this callback will actually run the hilbish.history.delete function or similar
  • undoer: if the action is not destructive and the person wants to undo, this callback will be called
  • id: a unique id to refer to the action
@TorchedSammy TorchedSammy added the enhancement New feature or request label Feb 21, 2023
@TorchedSammy TorchedSammy added this to the v2.2 (Poppy) milestone Feb 21, 2023
@TorchedSammy TorchedSammy removed this from the v2.2 (Poppy) milestone Nov 12, 2023
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

No branches or pull requests

1 participant