@@ -85,6 +85,8 @@ impl DrawableComponent for TagListComponent {
85
85
Constraint :: Length ( 10 ) ,
86
86
// author width
87
87
Constraint :: Length ( 19 ) ,
88
+ // attachement
89
+ Constraint :: Length ( 1 ) ,
88
90
// commit id
89
91
Constraint :: Percentage ( 100 ) ,
90
92
] ;
@@ -171,6 +173,13 @@ impl Component for TagListComponent {
171
173
true ,
172
174
true ,
173
175
) ) ;
176
+ out. push ( CommandInfo :: new (
177
+ strings:: commands:: show_tag_annotation (
178
+ & self . key_config ,
179
+ ) ,
180
+ self . can_show_annotation ( ) ,
181
+ true ,
182
+ ) ) ;
174
183
}
175
184
visibility_blocking ( self )
176
185
}
@@ -196,6 +205,10 @@ impl Component for TagListComponent {
196
205
self . move_selection ( ScrollType :: PageDown ) ;
197
206
} else if key == self . key_config . keys . page_up {
198
207
self . move_selection ( ScrollType :: PageUp ) ;
208
+ } else if key == self . key_config . keys . move_right
209
+ && self . can_show_annotation ( )
210
+ {
211
+ self . show_annotation ( ) ;
199
212
} else if key == self . key_config . keys . delete_tag {
200
213
return self . selected_tag ( ) . map_or (
201
214
Ok ( EventState :: NotConsumed ) ,
@@ -372,6 +385,22 @@ impl TagListComponent {
372
385
needs_update
373
386
}
374
387
388
+ fn show_annotation ( & self ) {
389
+ if let Some ( tag) = self . selected_tag ( ) {
390
+ if let Some ( annotation) = & tag. annotation {
391
+ self . queue . push ( InternalEvent :: ShowInfoMsg (
392
+ annotation. clone ( ) ,
393
+ ) ) ;
394
+ }
395
+ }
396
+ }
397
+
398
+ fn can_show_annotation ( & self ) -> bool {
399
+ self . selected_tag ( )
400
+ . and_then ( |t| t. annotation . as_ref ( ) )
401
+ . is_some ( )
402
+ }
403
+
375
404
///
376
405
fn get_rows ( & self ) -> Vec < Row > {
377
406
self . tags . as_ref ( ) . map_or_else ( Vec :: new, |tags| {
@@ -382,6 +411,7 @@ impl TagListComponent {
382
411
///
383
412
fn get_row ( & self , tag : & TagWithMetadata ) -> Row {
384
413
const UPSTREAM_SYMBOL : & str = "\u{2191} " ;
414
+ const ATTACHEMENT_SYMBOL : & str = "!" ;
385
415
const EMPTY_SYMBOL : & str = " " ;
386
416
387
417
let is_tag_missing_on_remote = self
@@ -399,6 +429,12 @@ impl TagListComponent {
399
429
EMPTY_SYMBOL
400
430
} ;
401
431
432
+ let has_attachement_str = if tag. annotation . is_some ( ) {
433
+ ATTACHEMENT_SYMBOL
434
+ } else {
435
+ EMPTY_SYMBOL
436
+ } ;
437
+
402
438
let cells: Vec < Cell > = vec ! [
403
439
Cell :: from( has_remote_str)
404
440
. style( self . theme. commit_author( false ) ) ,
@@ -408,6 +444,8 @@ impl TagListComponent {
408
444
. style( self . theme. commit_time( false ) ) ,
409
445
Cell :: from( tag. author. clone( ) )
410
446
. style( self . theme. commit_author( false ) ) ,
447
+ Cell :: from( has_attachement_str)
448
+ . style( self . theme. commit_time( false ) ) ,
411
449
Cell :: from( tag. message. clone( ) )
412
450
. style( self . theme. text( true , false ) ) ,
413
451
] ;
0 commit comments