From 8791f8574b3631fdf79830dbde85ad517bef6fee Mon Sep 17 00:00:00 2001 From: gl0w Date: Thu, 10 Sep 2026 06:51:07 +0100 Subject: [PATCH] m6/submit-buttons: + links on issues/pulls + form intros (118 tests) --- src/forge.rs | 64 ++++++++++++++++++++++++++++++++++++++++++++++-- src/inbox.rs | 48 +++++++++++++++++++++++++++++++++--- static/style.css | 8 ++++++ 3 files changed, 115 insertions(+), 5 deletions(-) diff --git a/src/forge.rs b/src/forge.rs index 61a34a7..951136b 100644 --- a/src/forge.rs +++ b/src/forge.rs @@ -948,8 +948,9 @@ fn render_issues_index( description: Option<&str>, ) -> Result { let mut body = String::from("

Issues

\n"); + body.push_str("

+ New issue

\n"); if data.issues.is_empty() { - body.push_str("

No issues yet.

\n"); + body.push_str("

No issues yet. Suggest one — no account needed.

\n"); } else { body.push_str("
\n\n\n"); for issue in &data.issues { @@ -994,8 +995,9 @@ fn render_issues_index( fn render_pulls_index(prs: &[Pr], site_name: &str, nav: &str, description: Option<&str>) -> String { let mut body = String::from("

Pulls

\n"); + body.push_str("

+ New PR prompt

\n"); if prs.is_empty() { - body.push_str("

No pull requests yet.

\n"); + body.push_str("

No pull requests yet. Suggest one — no account needed.

\n"); } else { body.push_str("
#titlestatecommentscreated
\n\n\n"); for pr in prs { @@ -1391,6 +1393,64 @@ mod tests { } } + /// f0rge #25: index pages carry prominent `+` submit buttons (correct + /// hrefs, icon + words) and the empty states link to the forms. + #[test] + fn submit_buttons_on_issues_pulls_indexes() { + // Empty forge: buttons + linked empty states. + let repo = mktemp("submit-empty"); + let out = mktemp("submit-empty-out"); + render_loaded(&load(&repo), &out, "test", "
#titlestatehead→basecreated