You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Allow users to return to previous step. #39
changed the title [-][Feature Request] Allow users to turn to previous step. [/-][+][Feature Request] Allow users to return to previous step. [/+]on Feb 15, 2023
I'm not sure how this would work since each prompt is detached from the rest. Once a prompt has finalized, the library has no reference to it any longer.
One plausible way would be via the group utility. Maybe we can pass hooks to each prompt initializer to go back and forward in history within the group. There we would could potentially store references to each prompt and provide a mechanism for them to clear themselves.
I was trying the clack demo on https://www.clack.cc/ and was surprised I could not go back to a previous step to fix a mistake.
I guess the more the UX feels like a form, the more you expect form-like behavior. (For instance, my first intuition was to use Shift+Tab to “tab back” to the previous input.)
This seems like something that could be added to Groups; some sort of "go back" input (as distinct from "cancel"), which would roll back to the previous step.
We should indeed do this I think, but by reworking how grouped prompts work imo.
Today, a group is just a way to chain the various async tasks and populate a result object. We should probably extend or rework that to support re-running a task
I've opened #617 which implements this for group().
Pressing Shift+Tab returns to the previous step. Answers are kept and each step receives its previous answer as previous (pass it to initialValue to restore the entry). Back is disabled on the first step. It's on by default (navigate: false to opt out) and exposes an onBack({ from, to, results }) callback.
Under the hood it adds an opt-in back action to @clack/core (unbound by default, so standalone prompts are unaffected), a BACK_SYMBOL/isBack() pair mirroring CANCEL_SYMBOL/isCancel(), and a 'back' state.
Happy to adjust the approach per the discussion here — feedback welcome.
Activity
[-][Feature Request] Allow users to turn to previous step. [/-][+][Feature Request] Allow users to return to previous step. [/+]ulken commentedon Feb 18, 2023
I'm not sure how this would work since each prompt is detached from the rest. Once a prompt has finalized, the library has no reference to it any longer.
One plausible way would be via the
grouputility. Maybe we can pass hooks to each prompt initializer to go back and forward in history within the group. There we would could potentially store references to each prompt and provide a mechanism for them to clear themselves.Thoughts @natemoo-re?
fvsch commentedon Apr 25, 2023
I was trying the clack demo on https://www.clack.cc/ and was surprised I could not go back to a previous step to fix a mistake.
I guess the more the UX feels like a form, the more you expect form-like behavior. (For instance, my first intuition was to use Shift+Tab to “tab back” to the previous input.)
DizzyHSlightlyVoided commentedon Jul 12, 2025
This seems like something that could be added to Groups; some sort of "go back" input (as distinct from "cancel"), which would roll back to the previous step.
43081j commentedon Mar 12, 2026
We should indeed do this I think, but by reworking how grouped prompts work imo.
Today, a group is just a way to chain the various async tasks and populate a result object. We should probably extend or rework that to support re-running a task
jolo-dev commentedon Apr 14, 2026
It would be really great to have this.
feat(prompts): add back navigation to `group` (bombshell-dev#39)
feat(prompts): add back navigation to `group` (bombshell-dev#39)
feat(prompts): add back navigation to `group` (bombshell-dev#39)
feat(prompts): add back navigation to `group` (bombshell-dev#39)
StringerBell69 commentedon Oct 15, 2026
I've opened #617 which implements this for
group().Pressing Shift+Tab returns to the previous step. Answers are kept and each step receives its previous answer as
previous(pass it toinitialValueto restore the entry). Back is disabled on the first step. It's on by default (navigate: falseto opt out) and exposes anonBack({ from, to, results })callback.Under the hood it adds an opt-in
backaction to@clack/core(unbound by default, so standalone prompts are unaffected), aBACK_SYMBOL/isBack()pair mirroringCANCEL_SYMBOL/isCancel(), and a'back'state.Happy to adjust the approach per the discussion here — feedback welcome.