Skip to content

feat(viewer): add back navigation to improve page traversal UX - #1217

Open
hyy321 wants to merge 1 commit into
alibaba:mainfrom
hyy321:feat/viewer-back-navigation
Open

feat(viewer): add back navigation to improve page traversal UX#1217
hyy321 wants to merge 1 commit into
alibaba:mainfrom
hyy321:feat/viewer-back-navigation

Conversation

@hyy321

@hyy321 hyy321 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

The viewer currently relies on breadcrumbs for navigation between repositories, session lists, and session details. On smaller screens, breadcrumb targets can be difficult to tap and labels may be truncated.

This change adds a visible back link beside the heading on both sub-pages:

  • sessions.html links back to /
  • session.html links back to /r/{{.EncodedRepo}}

The existing breadcrumbs remain unchanged. The new links use the existing theme variables, support light and dark modes, provide a minimum 44×44 CSS pixel touch target, and support keyboard navigation.

Implementation

  • Updated internal/viewer/templates/sessions.html.
  • Updated internal/viewer/templates/session.html.
  • Added responsive .page-heading and .back-link styles in internal/viewer/static/style.css.
  • Added rendering coverage in internal/viewer/server_extra_test.go.
  • No backend or routing changes were required.

Closes #830.

Type of Change

  • New feature (non-breaking change that adds functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • Breaking change
  • Refactoring
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make check
  • make test
  • make build
  • git diff --check
  • ocr review completed with 0 findings
  • Tested both back links manually
  • Tested at a 400px viewport in light and dark modes
  • Verified the links measure approximately 68.97×44px
  • Verified Tab focus and Enter navigation
  • Verified the existing breadcrumbs remain functional

The template tests cover empty and populated session lists, the detail-page back-link target, and preservation of the existing breadcrumbs.

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have added tests that prove my change is effective
  • New and existing tests pass locally
  • Documentation updates are not needed for this UI change
  • I have signed the CLA

AI assistance: OpenAI Codex using GPT-6 Astra was used for repository inspection and implementation support. I reviewed the final diff and test results myself.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s).

@Qiyuanqiii Qiyuanqiii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. The implementation matches the issue scope well: both sub-pages get an explicit parent navigation affordance, the existing breadcrumbs are preserved, the touch target and focus states are handled properly, and CI/CodeQL are green.

I don’t see any blocking code issues.

One thing to fix before merge: the PR disclosure says OpenAI Codex was used, but the repository guidelines require both the AI tool and the specific model used to be disclosed. Please add the actual model name to the PR description.

A CSS regression check for the 44×44 minimum touch target could also be useful, but I wouldn’t consider that blocking given the existing rendering tests and manual viewport validation.

Once the model disclosure is completed, this looks good to me.

@hyy321

hyy321 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Looks good overall. The implementation matches the issue scope well: both sub-pages get an explicit parent navigation affordance, the existing breadcrumbs are preserved, the touch target and focus states are handled properly, and CI/CodeQL are green.

I don’t see any blocking code issues.

One thing to fix before merge: the PR disclosure says OpenAI Codex was used, but the repository guidelines require both the AI tool and the specific model used to be disclosed. Please add the actual model name to the PR description.

A CSS regression check for the 44×44 minimum touch target could also be useful, but I wouldn’t consider that blocking given the existing rendering tests and manual viewport validation.

Once the model disclosure is completed, this looks good to me.

Updated the PR description to include the specific model used: GPT-6 Astra. Thanks for the review!

@Qiyuanqiii Qiyuanqiii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No further concerns from my side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(viewer): add back navigation to improve page traversal UX

2 participants