@@ -81,7 +81,7 @@ pub struct ListOptions {
8181 json : bool ,
8282}
8383
84- #[ derive( Debug , Clone , PartialEq , Eq ) ]
84+ #[ derive( Debug , Default , Clone , PartialEq , Eq ) ]
8585pub struct ReviewOptions {
8686 patch_id : Option < Rev > ,
8787 revision_id : Option < Rev > ,
@@ -255,7 +255,7 @@ pub async fn run(options: Options, ctx: impl terminal::Context) -> anyhow::Resul
255255 let rid = options. repo . unwrap_or ( rid) ;
256256
257257 // Run TUI with patch list interface
258- let selection = interface:: list ( opts. clone ( ) , profile, rid) . await ?;
258+ let selection = interface:: list ( opts. clone ( ) , profile. clone ( ) , rid) . await ?;
259259
260260 if opts. json {
261261 let selection = selection
@@ -267,17 +267,24 @@ pub async fn run(options: Options, ctx: impl terminal::Context) -> anyhow::Resul
267267
268268 eprint ! ( "{selection}" ) ;
269269 } else if let Some ( selection) = selection {
270- let mut args = vec ! [ ] ;
270+ if let Some ( operation) = selection. operation . clone ( ) {
271+ let mut args = vec ! [ operation. to_string( ) ] ;
271272
272- if let Some ( operation) = selection. operation {
273- args. push ( operation. to_string ( ) ) ;
274- }
275- if let Some ( id) = selection. ids . first ( ) {
276- args. push ( format ! ( "{id}" ) ) ;
277- }
273+ if let Some ( id) = selection. ids . first ( ) {
274+ args. push ( format ! ( "{id}" ) ) ;
278275
279- let args = args. into_iter ( ) . map ( OsString :: from) . collect :: < Vec < _ > > ( ) ;
280- let _ = crate :: terminal:: run_rad ( Some ( "patch" ) , & args) ;
276+ match operation. as_str ( ) {
277+ "review" => {
278+ let opts = ReviewOptions :: default ( ) ;
279+ interface:: review ( opts, profile, rid, * id) . await ?;
280+ }
281+ _ => {
282+ let args = args. into_iter ( ) . map ( OsString :: from) . collect :: < Vec < _ > > ( ) ;
283+ let _ = crate :: terminal:: run_rad ( Some ( "patch" ) , & args) ;
284+ }
285+ }
286+ }
287+ }
281288 }
282289 }
283290 Operation :: Review { ref opts } => {
0 commit comments