Menu item for issues and commits should be active on detail pages
closedWhen 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
Implementation Plan
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:221Step 1: Update CommitPageData.Active() return value
Step 2: Verify the change
Run:
grep -n "func.*CommitPageData.*Active" config.goExpected: Output showsreturn "commit"Step 3: Commit
Task 2: Update Issue Detail Page Active Value
Files: - Modify:
issues.go:79Step 1: Update IssueDetailPageData.Active() return value
Step 2: Verify the change
Run:
grep -n "func.*IssueDetailPageData.*Active" issues.goExpected: Output showsreturn "issue"Step 3: Commit
Task 3: Test the Build
Step 1: Build the project
Run:
go build ./...Expected: No errorsStep 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
Step 2: Close the bug
Verification Steps
After implementing, the header behavior should be:
<span class="active">commits</span><a href="...">commits</a><span class="active">issues</span><a href="...">issues</a>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.