@@ -8,7 +8,6 @@ use crate::{
8
8
CommandBlocking , CommandInfo , Component , DrawableComponent ,
9
9
EventState ,
10
10
} ,
11
- keys:: SharedKeyConfig ,
12
11
strings:: { self } ,
13
12
ui:: style:: SharedTheme ,
14
13
} ;
@@ -29,21 +28,15 @@ pub struct CompareDetailsComponent {
29
28
data : Option < ( CommitDetails , CommitDetails ) > ,
30
29
theme : SharedTheme ,
31
30
focused : bool ,
32
- key_config : SharedKeyConfig ,
33
31
}
34
32
35
33
impl CompareDetailsComponent {
36
34
///
37
- pub const fn new (
38
- theme : SharedTheme ,
39
- key_config : SharedKeyConfig ,
40
- focused : bool ,
41
- ) -> Self {
35
+ pub const fn new ( theme : SharedTheme , focused : bool ) -> Self {
42
36
Self {
43
37
data : None ,
44
38
theme,
45
39
focused,
46
- key_config,
47
40
}
48
41
}
49
42
@@ -68,11 +61,7 @@ impl CompareDetailsComponent {
68
61
fn get_commit_text ( & self , data : & CommitDetails ) -> Vec < Spans > {
69
62
let mut res = vec ! [
70
63
Spans :: from( vec![
71
- style_detail(
72
- & self . theme,
73
- & self . key_config,
74
- & Detail :: Author ,
75
- ) ,
64
+ style_detail( & self . theme, & Detail :: Author ) ,
76
65
Span :: styled(
77
66
Cow :: from( format!(
78
67
"{} <{}>" ,
@@ -82,11 +71,7 @@ impl CompareDetailsComponent {
82
71
) ,
83
72
] ) ,
84
73
Spans :: from( vec![
85
- style_detail(
86
- & self . theme,
87
- & self . key_config,
88
- & Detail :: Date ,
89
- ) ,
74
+ style_detail( & self . theme, & Detail :: Date ) ,
90
75
Span :: styled(
91
76
Cow :: from( time_to_string(
92
77
data. author. time,
@@ -97,48 +82,15 @@ impl CompareDetailsComponent {
97
82
] ) ,
98
83
] ;
99
84
100
- if let Some ( ref committer) = data. committer {
101
- res. extend ( vec ! [
102
- Spans :: from( vec![
103
- style_detail(
104
- & self . theme,
105
- & self . key_config,
106
- & Detail :: Commiter ,
107
- ) ,
108
- Span :: styled(
109
- Cow :: from( format!(
110
- "{} <{}>" ,
111
- committer. name, committer. email
112
- ) ) ,
113
- self . theme. text( true , false ) ,
114
- ) ,
115
- ] ) ,
116
- Spans :: from( vec![
117
- style_detail(
118
- & self . theme,
119
- & self . key_config,
120
- & Detail :: Date ,
121
- ) ,
122
- Span :: styled(
123
- Cow :: from( time_to_string(
124
- committer. time,
125
- false ,
126
- ) ) ,
127
- self . theme. text( true , false ) ,
128
- ) ,
129
- ] ) ,
130
- ] ) ;
131
- }
132
-
133
85
res. push ( Spans :: from ( vec ! [
86
+ style_detail( & self . theme, & Detail :: Message ) ,
134
87
Span :: styled(
135
- Cow :: from( strings:: commit:: details_sha(
136
- & self . key_config,
137
- ) ) ,
138
- self . theme. text( false , false ) ,
139
- ) ,
140
- Span :: styled(
141
- Cow :: from( data. hash. clone( ) ) ,
88
+ Cow :: from(
89
+ data. message
90
+ . as_ref( )
91
+ . map( |msg| msg. subject. clone( ) )
92
+ . unwrap_or_default( ) ,
93
+ ) ,
142
94
self . theme. text( true , false ) ,
143
95
) ,
144
96
] ) ) ;
@@ -166,6 +118,7 @@ impl DrawableComponent for CompareDetailsComponent {
166
118
dialog_paragraph (
167
119
& strings:: commit:: compare_details_info_title (
168
120
true ,
121
+ data. 0 . short_hash ( ) ,
169
122
) ,
170
123
Text :: from ( self . get_commit_text ( & data. 0 ) ) ,
171
124
& self . theme ,
@@ -178,6 +131,7 @@ impl DrawableComponent for CompareDetailsComponent {
178
131
dialog_paragraph (
179
132
& strings:: commit:: compare_details_info_title (
180
133
false ,
134
+ data. 1 . short_hash ( ) ,
181
135
) ,
182
136
Text :: from ( self . get_commit_text ( & data. 1 ) ) ,
183
137
& self . theme ,
0 commit comments