Skip to content

fix: add back navigation to "what's new" changelog page (#1965) - #2127

Merged
yannickmonney merged 2 commits into
mainfrom
tale/xs7bnh0n894mg7ts6qa55n9w2s896ztf
Jun 29, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
tale/xs7bnh0n894mg7ts6qa55n9w2s896ztf

Conversation

@larryro

@larryro larryro commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1965.

The full-page "What's new" changelog view (/dashboard/changelog) had no way to navigate back — once the user opened it (from the post-upgrade toast or a deep link) they were stranded.

This adds a back affordance at the top of the page:

  • New ChangelogBackButton component (app/features/changelog/components/changelog-back-button.tsx) that uses TanStack Router's useRouter().history.back() to return the user to wherever they came from, falling back to /dashboard (via useCanGoBack()) when there is no history entry to pop (deep link / fresh tab).
  • Rendered at the top of both the main and error states of the changelog page.
  • New changelog.viewer.back i18n key added to en, de, and fr (de-CH inherits — no override needed).

Acceptance criteria

  • From "What's new" the user can return to where they came from.

Tests / checks run locally

  • changelog-back-button.test.tsx — happy path (pops history) + fallback (navigates to /dashboard). Both pass.
  • bunx tsc --noEmit (typecheck) — green.
  • oxlint --type-aware on changed files — clean.
  • oxfmt --check on changed files — clean.
  • knip — clean.
  • lib/i18n/messages.test.ts (parity + usage enforce) — green.

@larryro

larryro commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Desk Review — #1965 "What's new (changelog) has no way to navigate back"

Verdict: READY TO MERGE.

CI

All checks green — 45 pass, 5 skipping, 0 failed/pending. Notably Unit (1m46s), UI (5m18s), Browser (50s) all pass. The new component test runs in CI under the UI job (test:ui globs app/features/**/*.test.tsx).

Tests

Ran the new suite locally:
bunx vitest --run --project client app/features/changelog/components/changelog-back-button.test.tsx → 2 passed. Both handleBack branches are covered (canGoBack → history.back(); no history → navigate({to:'/dashboard'})).

Review (Round 1 breadth across 5 dimensions → Round 2 independent confirmation)

Correctness — passes. ChangelogBackButton is rendered in both terminal render branches of ChangelogPage (the error branch and the main success branch, which covers tooOld/toUnpublished/upToDate/normal-list). The /dashboard fallback route exists; useCanGoBack/useNavigate/router.history.back() are valid @tanstack/react-router exports; useCallback deps are correct.

i18n — correct. changelog.viewer.back added under the existing viewer object in en/de/fr with valid nesting. de-CH.json has no changelog section at all (it never had the other viewer keys either) and resolves via the documented fallback chain de-CH → de → en. The repo's i18n key-parity test enforces this and passed in CI.

Robustness / scope — fine. Pure presentational button, no lifecycle/concurrency/resource concerns; fallback is a hardcoded internal route (no boundary/security issue). The second commit's desk-process.json edit is a pure formatter (oxfmt) reflow — array values unchanged, semantically identical.

Non-blocking suggestions (optional; do NOT gate merge)

  1. Loading state lacks the back button — changelog.tsx:159-165 (spinner branch) renders no affordance. It's transient (resolves to error or loaded, both of which have the button) and the browser back button still works, so it doesn't strand the user. Consider adding <ChangelogBackButton /> to the spinner branch for consistency.
  2. Consider the shared @tale/ui Button (variant="ghost") to match the existing back-affordance pattern in prompt-compare-view.tsx. Not required — raw <button> is used widely in the app and no lint rule bans it.
  3. Test could add an accessibility/label assertion and use the repo's custom render/checkAccessibility helpers (the dominant convention), though the current plain-testing-library approach is also used elsewhere and the behavior is fully covered.

The change meets the acceptance criteria: from "What's new" the user can return to where they came from (or to /dashboard on a deep link).

@yannickmonney
yannickmonney merged commit f6f716d into main Jun 29, 2026
50 checks passed
@yannickmonney
yannickmonney deleted the tale/xs7bnh0n894mg7ts6qa55n9w2s896ztf branch June 29, 2026 17:16
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.

Bug: "What's new" (changelog) has no way to navigate back

2 participants