Menu item for issues and commits should be active on detail pages

closed
#52a5eee opened by scooter Apr 13

When navigating to an issue or commit detail page the header menu item for issues or commits is inactive. It should be a link so that the user can click on commits or issues and return to the list of all commits/issues instead of using browser back navigation.

2 Comments

agent 5128aa5 Apr 13

Implementation Plan

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

Goal: Make the header menu items for commits and issues clickable links on detail pages, so users can navigate back to the list view.

Architecture: The fix involves changing the Active() method return values on detail page data structures from plural to singular (e.g., CommitPageData.Active() returns "commit" instead of "commits"). The template already has logic that shows a <span> when active matches, otherwise shows an <a> link. By using different values for list vs detail pages, detail pages will show the menu item as a link.

Tech Stack: Go templates, git-bug for issues


Task 1: Update Commit Detail Page Active Value

Files: - Modify: config.go:221

Step 1: Update CommitPageData.Active() return value

func (s *CommitPageData) Active() string  { return "commit" }

Step 2: Verify the change

Run: grep -n "func.*CommitPageData.*Active" config.go Expected: Output shows return "commit"

Step 3: Commit

jj commit -m "fix: change commit detail page active value to singular"

Task 2: Update Issue Detail Page Active Value

Files: - Modify: issues.go:79

Step 1: Update IssueDetailPageData.Active() return value

func (i *IssueDetailPageData) Active() string { return "issue" }

Step 2: Verify the change

Run: grep -n "func.*IssueDetailPageData.*Active" issues.go Expected: Output shows return "issue"

Step 3: Commit

jj commit -m "fix: change issue detail page active value to singular"

Task 3: Test the Build

Step 1: Build the project

Run: go build ./... Expected: No errors

Step 2: Run any existing tests

Run: go test ./... Expected: All tests pass (if any exist)

Step 3: Commit (if tests were added or modified)


Task 4: Update the Bug with Completion Summary

Step 1: Add completion comment

bug agent comment 52a5eee --message "Fix complete. Changed Active() return values:
- CommitPageData: commits -> commit
- IssueDetailPageData: issues -> issue

Now on detail pages, the commits/issues menu items show as clickable links instead of inactive spans."

Step 2: Close the bug

bug agent close 52a5eee

Verification Steps

After implementing, the header behavior should be:

Page Active Value Menu Item
commits list (log.page.tmpl) “commits” <span class="active">commits</span>
commit detail (commit.page.tmpl) “commit” <a href="...">commits</a>
issues list (issues_list.page.tmpl) “issues” <span class="active">issues</span>
issue detail (issue_detail.page.tmpl) “issue” <a href="...">issues</a>
agent 5123ad5 Apr 13

Fix implemented. Changed Active() return values: - CommitPageData: “commits” -> “commit” (config.go:221) - IssueDetailPageData: “issues” -> “issue” (issues.go:79)

Now on detail pages, the commits/issues menu items show as clickable links that navigate back to the list pages.