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

Change default keybind for reset action #389

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- Add `slumber new` subcommand to generate new collection files [#376](https://github.com/LucasPickering/slumber/issues/376)
- Add `default` field to profiles
- When using the CLI, the `--profile` argument can be omitted to use the default profile
- Reset edited recipe values to their default using `r`
- Reset edited recipe values to their default using `z`
- You can [customize the key](https://slumber.lucaspickering.me/book/api/configuration/input_bindings.html) to whatever you want
- Add `selector_mode` field to chains, to control how single vs multiple results from a JSONPath selector are handled
- Previously, if a selector returned multiple results, an error was returned. Now, the result list will be rendered as a JSON array. To return to the previous behavior, set `selector_mode: single` in your chain.
Expand Down
2 changes: 1 addition & 1 deletion crates/tui/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Default for InputEngine {
Action::Toggle => KeyCode::Char(' ').into(),
Action::Cancel => KeyCode::Esc.into(),
Action::Edit => KeyCode::Char('e').into(),
Action::Reset => KeyCode::Char('r').into(),
Action::Reset => KeyCode::Char('z').into(),
Action::SelectProfileList => KeyCode::Char('p').into(),
Action::SelectRecipeList => KeyCode::Char('l').into(),
Action::SelectRecipe => KeyCode::Char('c').into(),
Expand Down
6 changes: 3 additions & 3 deletions crates/tui/src/view/component/recipe_pane/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ mod tests {
);

// Reset username
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().inner().override_value(), None);

// Edit password
Expand All @@ -359,7 +359,7 @@ mod tests {
);

// Reset password
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().inner().override_value(), None);
}

Expand Down Expand Up @@ -423,7 +423,7 @@ mod tests {
);

// Reset token
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().inner().override_value(), None);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/tui/src/view/component/recipe_pane/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ mod tests {
);

// Reset edited state
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().override_value(), None);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/tui/src/view/component/recipe_pane/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ mod tests {
);

// Reset edited state
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
let selected_row =
component.data().inner().select.data().selected().unwrap();
assert!(!selected_row.value.is_overridden());
Expand Down
Loading