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 {
9898 /// Markdown with update text (bullet list)
9999 pub comments : Vec < ExistingGithubComment > ,
100100
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 ,
103103
104104 /// Progress towards the goal
105105 pub progress : Progress ,
Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ async fn prepare_goals(
122122
123123 let why_this_goal = why_this_goal ( & issue_id, issue) ?;
124124
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+ } ;
125130 result. push ( UpdatesGoal {
126131 title : title. clone ( ) ,
127132 issue_number : issue. number ,
@@ -131,7 +136,7 @@ async fn prepare_goals(
131136 has_help_wanted,
132137 help_wanted,
133138 is_closed : issue. state == GithubIssueState :: Closed ,
134- num_comments : comments . len ( ) ,
139+ details_summary ,
135140 comments,
136141 tldr,
137142 why_this_goal,
Original file line number Diff line number Diff line change 11{{ #if comments }}
22
33<details >
4- <summary >{{ num_comments }} update(s) posted. </summary >
4+ <summary >{{ details_summary }} </summary >
55
66<!-- this comment helps to convince the markdown parser to do the right thing -->
77
2929<!-- this comment helps to convince the markdown parser to do the right thing -->
3030
3131<details >
32- <summary >No updates posted. </summary >
32+ <summary >{{ details_summary }} </summary >
3333</details >
3434
3535{{ /if }}
You can’t perform that action at this time.
0 commit comments