@@ -138,10 +138,17 @@ impl App {
138138 let left_chunks = Layout :: default ( )
139139 . direction ( Direction :: Vertical )
140140 . constraints (
141- [
142- Constraint :: Percentage ( 50 ) ,
143- Constraint :: Percentage ( 50 ) ,
144- ]
141+ if self . diff_target == DiffTarget :: WorkingDir {
142+ [
143+ Constraint :: Percentage ( 60 ) ,
144+ Constraint :: Percentage ( 40 ) ,
145+ ]
146+ } else {
147+ [
148+ Constraint :: Percentage ( 40 ) ,
149+ Constraint :: Percentage ( 60 ) ,
150+ ]
151+ }
145152 . as_ref ( ) ,
146153 )
147154 . split ( chunks[ 0 ] ) ;
@@ -187,6 +194,13 @@ impl App {
187194 DiffTarget :: WorkingDir => Focus :: WorkDir ,
188195 } )
189196 }
197+ keys:: OPEN_COMMIT
198+ if !self . index . is_empty ( )
199+ && self . offer_open_commit_cmd ( ) =>
200+ {
201+ self . commit . show ( ) ;
202+ NeedsUpdate :: COMMANDS
203+ }
190204 _ => NeedsUpdate :: empty ( ) ,
191205 } ;
192206
@@ -295,7 +309,6 @@ impl App {
295309 self . index_wd . update ( & status. work_dir ) ;
296310
297311 self . update_diff ( ) ;
298- self . commit . set_stage_empty ( self . index . is_empty ( ) ) ;
299312 self . update_commands ( ) ;
300313 }
301314
@@ -413,6 +426,33 @@ impl App {
413426 ) ) ;
414427 }
415428
429+ res. push (
430+ CommandInfo :: new (
431+ commands:: COMMIT_OPEN ,
432+ !self . index . is_empty ( ) ,
433+ self . offer_open_commit_cmd ( ) ,
434+ )
435+ . order ( -1 ) ,
436+ ) ;
437+
438+ res. push (
439+ CommandInfo :: new (
440+ commands:: SELECT_STAGING ,
441+ true ,
442+ self . focus == Focus :: WorkDir ,
443+ )
444+ . order ( -2 ) ,
445+ ) ;
446+
447+ res. push (
448+ CommandInfo :: new (
449+ commands:: SELECT_UNSTAGED ,
450+ true ,
451+ self . focus == Focus :: Stage ,
452+ )
453+ . order ( -2 ) ,
454+ ) ;
455+
416456 res. push (
417457 CommandInfo :: new (
418458 commands:: QUIT ,
@@ -426,6 +466,11 @@ impl App {
426466 res
427467 }
428468
469+ fn offer_open_commit_cmd ( & self ) -> bool {
470+ !self . commit . is_visible ( )
471+ && self . diff_target == DiffTarget :: Stage
472+ }
473+
429474 fn components ( & self ) -> Vec < & dyn Component > {
430475 vec ! [
431476 & self . msg,
0 commit comments