Skip to content

fix: switch course year tags without piling up browser history#261

Merged
rootulp merged 1 commit into
mainfrom
worktree-bright-forging-possum
Jul 17, 2026
Merged

fix: switch course year tags without piling up browser history#261
rootulp merged 1 commit into
mainfrom
worktree-bright-forging-possum

Conversation

@rootulp

@rootulp rootulp commented Jul 17, 2026

Copy link
Copy Markdown
Owner

A Reddit commenter noted that on a course page (e.g. /courses/im703-wisconsin), clicking through the year tags stacks a browser-history entry per click, so returning to the previous page requires many Back clicks.

The year tags used <Link> with default push navigation. Adding replace keeps the URL shareable/bookmarkable while a year switch replaces the current history entry β€” so one Back returns to the previous page instead of stepping through each viewed year.

Added an e2e test (e2e/course-year-history.spec.ts) that clicks through several years and asserts a single Back returns to the courses overview.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01Bytmqtq2bNyot4PRvo8es7

Summary by CodeRabbit

  • Bug Fixes

    • Updated course year navigation so switching between editions does not add unnecessary browser-history entries.
    • Selecting β€œAll years” or a specific year now lets you return directly to the previous page with one Back action.
  • Tests

    • Added end-to-end coverage verifying the improved browser-history behavior when switching course years.

Course year tags used <Link> with default push navigation, so clicking
through several years stacked a history entry per click and returning to
the previous page required many Back clicks. Add `replace` so the URL
stays shareable while a year switch replaces the current history entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bytmqtq2bNyot4PRvo8es7
@rootulp rootulp self-assigned this Jul 17, 2026
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tritimes Ready Ready Preview, Comment Jul 17, 2026 9:54pm

@rootulp
rootulp enabled auto-merge (squash) July 17, 2026 21:51
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 582060d5-0942-4528-9070-7c5d3388a922

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 26b8f26 and 9b740de.

πŸ“’ Files selected for processing (2)
  • app/e2e/course-year-history.spec.ts
  • app/src/app/courses/[course]/page.tsx

πŸ“ Walkthrough

Walkthrough

Course year links now replace the current browser-history entry when switching editions. A Playwright test verifies year URL updates and confirms one back navigation returns to the courses overview.

Changes

Course year navigation

Layer / File(s) Summary
Replace year navigation and verify history
app/src/app/courses/[course]/page.tsx, app/e2e/course-year-history.spec.ts
Year links use Next.js replace, and the end-to-end test verifies that switching among 2025, 2024, and 2023 does not stack history entries.

Estimated code review effort: 2 (Simple) | ~10 minutes

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly summarizes the main change: course year tags now replace history entries instead of stacking them.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-bright-forging-possum

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@rootulp
rootulp merged commit a39ac91 into main Jul 17, 2026
6 of 7 checks passed
@rootulp
rootulp deleted the worktree-bright-forging-possum branch July 17, 2026 21:54
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.

1 participant