1Feature: Navigation and state retention
2
3 Users navigate forward through screens by making selections, and
4 backward with Esc. The session remembers previous answers so users
5 can review and revise without re-entering everything.
6
7 Rule: Esc navigates back one visible screen at a time
8
9 Scenario: Going back from a command-specific screen
10 Given the user is on the first screen of a command flow
11 When they press Esc
12 Then the preset selection screen is shown
13 And their previous preset choice is preserved
14
15 Scenario: Going back from the preset selection
16 Given the user is on the preset selection screen
17 When they press Esc
18 Then the command menu is shown
19 And their previous command selection is highlighted
20
21 Scenario: Going back step by step through a multi-screen flow
22 Given the user has progressed through several screens
23 When they press Esc repeatedly
24 Then they step back through each previously-visited screen
25 And each screen shows their earlier answer
26
27 Scenario: Esc on the command menu exits the session
28 Given the user is on the command menu
29 When they press Esc
30 Then the session exits without executing restic
31
32 Rule: Screens are skipped when the needed value is already resolved
33
34 Scenario: Command provided on the command line
35 Given the user invokes keld with a command argument
36 Then the command menu is not shown
37 And the session begins at the preset selection
38
39 Scenario: Preset provided on the command line
40 Given the user invokes keld with --preset
41 Then the preset selection screen is not shown
42
43 Scenario: No presets defined in configuration
44 Given the configuration defines no presets
45 Then the preset selection screen is not shown
46
47 Scenario: Exactly one preset defined
48 Given the configuration defines exactly one preset
49 Then that preset is selected automatically
50 And the preset selection screen is not shown
51
52 Scenario: All required values already resolved
53 Given the command, preset, and all command-specific values are already provided
54 Then the session skips directly to the confirmation screen
55
56 Rule: Skipped screens are also skipped during back navigation
57
58 Scenario: Navigating back past a skipped screen
59 Given a screen was skipped because its value was already resolved
60 When the user navigates back from the screen after it
61 Then they land on the screen before the skipped one
62
63 Rule: CLI-provided values are always skipped regardless of navigation
64
65 Scenario: CLI-provided values cannot be reached via back navigation
66 Given the user provided a value on the command line
67 Then that value's screen is never shown
68 And back navigation passes over it in both directions