From edc2bd48110c794af781f15550d7db6d07bdac82 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Thu, 11 Dec 2025 16:12:04 +0100 Subject: [PATCH] bin/issue: Remove selection mode (id-only / operation) --- bin/commands/issue.rs | 18 ------------------ bin/commands/issue/common.rs | 10 ---------- bin/commands/issue/list.rs | 11 ++--------- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/bin/commands/issue.rs b/bin/commands/issue.rs index 00f85c20..61da1806 100644 --- a/bin/commands/issue.rs +++ b/bin/commands/issue.rs @@ -36,12 +36,8 @@ Usage List options - --mode Set selection mode; see MODE below (default: operation) --json Return JSON on stderr instead of calling `rad` - The MODE argument can be 'operation' or 'id'. 'operation' selects an issue id and - an operation, whereas 'id' selects an issue id only. - Other options --no-forward Don't forward command to `rad` (default: true) @@ -70,7 +66,6 @@ pub enum OperationName { #[derive(Debug, Default, Clone, PartialEq, Eq)] pub struct ListOptions { - mode: common::Mode, filter: cob::issue::Filter, json: bool, } @@ -103,18 +98,6 @@ impl Args for Options { _ => Some(true), }; } - - // select options. - Long("mode") | Short('m') if op == OperationName::List => { - let val = parser.value()?; - let val = val.to_str().unwrap_or_default(); - - list_opts.mode = match val { - "operation" => common::Mode::Operation, - "id" => common::Mode::Id, - unknown => anyhow::bail!("unknown mode '{unknown}'"), - }; - } Long("all") if op == OperationName::List => { list_opts.filter = list_opts.filter.with_state(None); } @@ -211,7 +194,6 @@ pub async fn run(options: Options, ctx: impl terminal::Context) -> anyhow::Resul let context = list::Context { profile, repository, - mode: opts.mode, filter: opts.filter.clone(), }; diff --git a/bin/commands/issue/common.rs b/bin/commands/issue/common.rs index 45996477..4579c925 100644 --- a/bin/commands/issue/common.rs +++ b/bin/commands/issue/common.rs @@ -2,16 +2,6 @@ use serde::Serialize; use radicle::issue::IssueId; -/// The application's mode. It tells the application -/// which widgets to render and which output to produce. -/// Depends on CLI arguments given by the user. -#[derive(Clone, Default, Debug, Eq, PartialEq)] -pub enum Mode { - #[default] - Operation, - Id, -} - /// The selected issue operation returned by the operation /// selection widget. #[derive(Clone, Debug, Eq, PartialEq, Serialize)] diff --git a/bin/commands/issue/list.rs b/bin/commands/issue/list.rs index d38b8573..564e97c7 100644 --- a/bin/commands/issue/list.rs +++ b/bin/commands/issue/list.rs @@ -45,14 +45,13 @@ use crate::ui::TerminalInfo; use self::ui::{Browser, BrowserProps}; -use super::common::{IssueOperation, Mode}; +use super::common::IssueOperation; type Selection = tui::Selection; pub struct Context { pub profile: Profile, pub repository: Repository, - pub mode: Mode, pub filter: issue::Filter, } @@ -153,7 +152,6 @@ pub struct HelpState { #[derive(Clone, Debug)] pub struct State { - mode: Mode, pages: PageStack, browser: BrowserState, preview: PreviewState, @@ -211,7 +209,6 @@ impl TryFrom<(&Context, &TerminalInfo)> for State { .collect(); Ok(Self { - mode: context.mode.clone(), pages: PageStack::new(vec![AppPage::Browser]), browser: BrowserState::build(items.clone(), filter, search), preview: PreviewState { @@ -401,10 +398,7 @@ fn browser_page(channel: &Channel) -> Widget { let shortcuts = if state.browser.is_search_shown() { vec![("esc", "cancel"), ("enter", "apply")] } else { - let mut shortcuts = match state.mode { - Mode::Id => vec![("enter", "select")], - Mode::Operation => vec![("enter", "show"), ("e", "edit")], - }; + let mut shortcuts = vec![("enter", "show"), ("e", "edit")]; if state.section == Some(Section::Browser) { shortcuts = [shortcuts, [("/", "search")].to_vec()].concat() } @@ -690,7 +684,6 @@ fn help_text() -> String { # Specific keybindings -`Enter`: Select issue (if --mode id) `Enter`: Show issue `e`: Edit issue `p`: Toggle issue preview