From 37244449d6d0d58bb639f181bd15092de1acaaee Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 5 Mar 2026 14:19:49 +0000 Subject: feat(cover-note): add kind-1624 cover notes for PRs, patches, and issues Implements experimental kind-1624 cover note events: - KIND_COVER_NOTE constant and process_cover_note() in git_events.rs; replaceable semantics (latest created_at, hex-id tiebreak), author or maintainer only - kind-1624 events fetched alongside labels in the fetch pipeline; cover_notes count added to FetchReport display - ngit pr/issue view: cover note displayed in place of description with a clear 'Cover Note:' header; maintainer-authored notes identify the author; original description shown only with --comments; cover_note object included in --json output - ngit pr set-cover-note / ngit issue set-cover-note: publish a kind-1624 event; nostr: mentions in --body converted to q/p tags via tags_from_content (same rules as issue --body) - Fix pre-existing clippy::too_many_lines on repo/mod.rs show_info --- src/bin/ngit/cli.rs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/bin/ngit/cli.rs') diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index 8660b60..d558525 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs @@ -160,7 +160,8 @@ pub struct RepoSubCommandArgs { /// Use local cache only, skip network fetch #[arg(long)] pub offline: bool, - /// Output repository info as JSON; `is_nostr_repo` is false when not in a nostr repository + /// Output repository info as JSON; `is_nostr_repo` is false when not in a + /// nostr repository #[arg(long)] pub json: bool, } @@ -347,6 +348,22 @@ pub enum PrCommands { #[arg(long)] offline: bool, }, + /// set or update the cover note for a PR (author or maintainer only) + /// + /// A cover note is a markdown body that replaces the displayed description. + /// nostr: mentions in --body are converted to q/p tags automatically. + #[command(name = "set-cover-note")] + SetCoverNote { + /// Proposal event-id (hex) or nevent (bech32) + #[arg(value_name = "ID|nevent")] + id: String, + /// Markdown body for the cover note + #[arg(long)] + body: String, + /// Use local cache only, skip network fetch + #[arg(long)] + offline: bool, + }, } // --------------------------------------------------------------------------- @@ -487,6 +504,22 @@ pub enum IssueCommands { #[arg(long)] offline: bool, }, + /// set or update the cover note for an issue (author or maintainer only) + /// + /// A cover note is a markdown body that replaces the displayed description. + /// nostr: mentions in --body are converted to q/p tags automatically. + #[command(name = "set-cover-note")] + SetCoverNote { + /// Issue event-id (hex) or nevent (bech32) + #[arg(value_name = "ID|nevent")] + id: String, + /// Markdown body for the cover note + #[arg(long)] + body: String, + /// Use local cache only, skip network fetch + #[arg(long)] + offline: bool, + }, } #[derive(Subcommand)] -- cgit v1.2.3