File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
crates/rust-project-goals-cli-llm/src Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ pub struct UpdatesGoal {
98
98
/// Markdown with update text (bullet list)
99
99
pub comments : Vec < ExistingGithubComment > ,
100
100
101
- /// Comments.len but accessible to the template
102
- pub num_comments : usize ,
101
+ /// The "<details>" summary, a prettified version of comments.len().
102
+ pub details_summary : String ,
103
103
104
104
/// Progress towards the goal
105
105
pub progress : Progress ,
Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ async fn prepare_goals(
122
122
123
123
let why_this_goal = why_this_goal ( & issue_id, issue) ?;
124
124
125
+ let details_summary = match comments. len ( ) {
126
+ 0 => String :: from ( "No updates posted." ) ,
127
+ 1 => String :: from ( "1 update posted." ) ,
128
+ len => format ! ( "{len} updates posted." ) ,
129
+ } ;
125
130
result. push ( UpdatesGoal {
126
131
title : title. clone ( ) ,
127
132
issue_number : issue. number ,
@@ -131,7 +136,7 @@ async fn prepare_goals(
131
136
has_help_wanted,
132
137
help_wanted,
133
138
is_closed : issue. state == GithubIssueState :: Closed ,
134
- num_comments : comments . len ( ) ,
139
+ details_summary ,
135
140
comments,
136
141
tldr,
137
142
why_this_goal,
Original file line number Diff line number Diff line change 1
1
{{ #if comments }}
2
2
3
3
<details >
4
- <summary >{{ num_comments }} update(s) posted. </summary >
4
+ <summary >{{ details_summary }} </summary >
5
5
6
6
<!-- this comment helps to convince the markdown parser to do the right thing -->
7
7
29
29
<!-- this comment helps to convince the markdown parser to do the right thing -->
30
30
31
31
<details >
32
- <summary >No updates posted. </summary >
32
+ <summary >{{ details_summary }} </summary >
33
33
</details >
34
34
35
35
{{ /if }}
You can’t perform that action at this time.
0 commit comments