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

Optional/toggle-able sections in workflows #5465

Open
1 task done
stodoran opened this issue Nov 12, 2024 · 0 comments
Open
1 task done

Optional/toggle-able sections in workflows #5465

stodoran opened this issue Nov 12, 2024 · 0 comments
Labels
Feature requests Feature Requests

Comments

@stodoran
Copy link

Dupe Check

Describe the solution you'd like?

My feature request is to be able to make part of the text in a workflow optional. How this would work:

Example workflow is below. Any text inside double square braces is optional. These portions of the workflow are tabbed to just like arguments, and can be toggled in a similar way to an enum. If toggled off, the text could be dimmed to show it won't be included when the command is run, or it could be cut out and replaced sort of icon indicating the cut such as a notch (which can be tabbed to again to re-enabled the section).

foo [[--bar]]

A toggle-able section should be able to wrap arguments. For example, in the below workflow the count argument only gets tabbed to if the user first sets the section it resides in to enabled when first tabbing through the command.

foo [[--bar {{count}}]]

Is your feature request related to a problem? Please describe.

This would primarily be useful for flags/arguments to commands called within workflows, or to make entire lines/sections of a workflow be toggle-able.

Right now there is a workaround if I have a workflow with a boolean flag that should sometimes be passed but not always. I can make a flag optional by creating an enum with two values:

  • A single space (don't provide the flag)
  • The flag value

Here is a screenshot of a minimal example:
image
Notice how the "bar" flag is made optional by have a single space as the first option in the enum, and the flag value itself as the second option in the enum.

This works for creating an optional flag, but has the following drawbacks:

  • Feels like a hack
  • Takes longer to set up than the feature I've described would
  • In a command with many optional flags, the command can end up with many spaces in a row (not readable)
  • Cannot nest an argument within (biggest drawback, makes the enum workaround only viable for boolean flags)

The use of the proposed feature would also extend beyond flags, for example if the user wishes to conditionally run some lines of the workflow the current best solution is to use an if statement and make the condition an enum. With this feature proposal those lines could just be wrapped in braces.

In short: this proposed feature would make it easier to create a workflow with optional flags and cleaner to use such a workflow. It would allow optional use of workflow arguments, and it would make calling certain lines of the workflow conditionally more simple.

Additional context

No response

How important is this feature to you?

3

Warp Internal (ignore) - linear-label:39cc6478-1249-4ee7-950b-c428edfeecd1

None

@stodoran stodoran added the Feature requests Feature Requests label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature requests Feature Requests
Projects
None yet
Development

No branches or pull requests

1 participant