Skip to content

Conversation

@paoloricciuti
Copy link
Contributor

What does this PR do?

Just a small exploration but I wanted the ability to prevent the default navigation when invoking a command from a plugin so I asked claude to add it in and it seems like it did a good job. This adds an output property on command.execute.before where you can call output.preventDefault to prevent the navigation...i've also implemented it for the TUI (maybe we should implement it for the webapp and the desktop too but wanted to see what you think about this).

It's nice to give plugins the ability to create commands to do stuff rather than send a prompt (I could use this to allow the user to quickly enable/disable a feature in the svelte plugin for example).

How did you verify your code works?

Launched the version locally with a plugin that stops every command and show a toast.

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Related PR Found

PR #9307: feat(hook): add noReply option to command.execute.before hook

This PR is related to your changes because it also modifies the command.execute.before hook to add new functionality. While #9307 adds a noReply option, your PR #9417 adds preventDefault capability. These PRs both enhance the same hook and should be reviewed together to ensure they don't conflict and work well together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant