Add comment ID to issue detail page

closed
#1670a39 opened by scooter Apr 13

The 7-character short comment ID should be added to the header on the issue_detail.page.tmpl. Currently it shows the author and the date (or time since the comment was made after humanized by the JS shim.) Before the date, it should show the short comment ID so the user can edit it using git-bug. Put the comment ID, a dot, then the date/time with a bit of margin between them on the right.

2 Comments

agent 1d6a7f0 Apr 13

Implementation Plan: Add comment ID to issue detail page

For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

Goal: Display the 7-character short comment ID in the comment header on the issue detail page, formatted as “ID. date/time”

Architecture: Add an field to the struct, populate it with the short ID from , and update the template and CSS to display it before the date.

Tech Stack: Go (git-bug library), HTML templates, CSS


Task 1: Add ID field to CommentData struct

Files: - Modify:

Step 1: Add ID field to CommentData struct

{ is a shell keyword

Step 2: Verify no syntax errors

Run: Expected: SUCCESS (no output)

Step 3: Commit


Task 2: Populate comment ID in loadIssues()

Files: - Modify:

Step 1: Update comment creation to include ID

Find the comment creation block (around line 115-121) and add the ID field:

Step 2: Verify build succeeds

Run: Expected: SUCCESS

Step 3: Commit


Task 3: Update template to display comment ID

Files: - Modify:

Step 1: Add comment ID to template

Update the comment header section from:

To:

Step 2: Verify template syntax

Run: Expected: SUCCESS

Step 3: Commit


Task 4: Add CSS styling for comment ID

Files: - Modify:

Step 1: Add styling for comment meta and ID

After the existing styles (around line 1411), add:

Step 2: Verify CSS is valid

The CSS file doesn’t get validated during Go build, but visually check the syntax is correct.

Step 3: Commit


Task 5: Verify the implementation

Step 1: Build the project

Run: Expected: SUCCESS

Step 2: Check that all files are modified correctly

Run: Expected: Shows changes to , , and

Step 3: Document completion

Add a comment to the bug indicating the implementation is complete and ready for testing.

agent 196b7a0 Apr 13

Implementation complete! The following changes were made:

  1. issues.go: Added ID field to CommentData struct and populated it from comment.CombinedId().String()

  2. html/issue_detail.page.tmpl: Updated comment header to display ID before date, wrapped in new meta span

  3. static/pgit.css: Added styling for .issue-commentmeta and .issue-commentid with proper spacing and the · separator

The comment ID now appears in the format: “ID · date/time” in the comment header. Build verified successfully.