diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-04 13:54:32 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-04 14:50:01 +0000 |
| commit | 6d9b0cc8fff65447849d0d55db177dcdff315c48 (patch) | |
| tree | 604587b7e06149d89a36383eb2e4227043e6955d /src/lib/git_events.rs | |
| parent | 3908abbbfc5e748dd168d22bf5e3ea6aae17de61 (diff) | |
feat: fetch and display NIP-22 comment counts on issues and proposals
Download kind-1111 NIP-22 comments from relays and show a comment count
in the detail view of `ngit list <id>` and `ngit issue list <id>`.
- git_events: add KIND_COMMENT constant (kind 1111)
- client: import KIND_COMMENT; add `comments` field to FetchReport;
route kind-1111 events into report.comments in process_fetched_events;
consolidate comments across relay reports; display "N comment(s)" in
FetchReport; add a #E-tagged kind-1111 filter in get_fetch_filters
covering all known issue and proposal root IDs
- issue_list: add get_comment_counts() to query the local cache for
kind-1111 events by #E tag and count per issue; extend the filtered
tuple with comment_count; show a CMTS column in the table, a
"Comments: N" line in the detail view, and a "comments" field in JSON
- list: add KIND_COMMENT import; add resolve_event_id() helper and
get_comment_count_for_proposal() to look up the count for a single
proposal from the local cache; pass comment_count into
show_proposal_details(); display "Comments: N" in plain text and
"comments" in JSON; align detail-view labels
Diffstat (limited to 'src/lib/git_events.rs')
| -rw-r--r-- | src/lib/git_events.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/git_events.rs b/src/lib/git_events.rs index 32c23ac..dde0e1a 100644 --- a/src/lib/git_events.rs +++ b/src/lib/git_events.rs | |||
| @@ -88,6 +88,8 @@ pub fn status_kinds() -> Vec<Kind> { | |||
| 88 | pub const KIND_PULL_REQUEST: Kind = Kind::Custom(1618); | 88 | pub const KIND_PULL_REQUEST: Kind = Kind::Custom(1618); |
| 89 | pub const KIND_PULL_REQUEST_UPDATE: Kind = Kind::Custom(1619); | 89 | pub const KIND_PULL_REQUEST_UPDATE: Kind = Kind::Custom(1619); |
| 90 | pub const KIND_USER_GRASP_LIST: Kind = Kind::Custom(10317); | 90 | pub const KIND_USER_GRASP_LIST: Kind = Kind::Custom(10317); |
| 91 | /// NIP-22 comment (kind 1111) — threaded comments on any event. | ||
| 92 | pub const KIND_COMMENT: Kind = Kind::Custom(1111); | ||
| 91 | 93 | ||
| 92 | pub fn event_is_patch_set_root(event: &Event) -> bool { | 94 | pub fn event_is_patch_set_root(event: &Event) -> bool { |
| 93 | event.kind.eq(&Kind::GitPatch) | 95 | event.kind.eq(&Kind::GitPatch) |