Skip to content

Feature: header animation + Private route protection + Token expiry handling - #41

Merged
oneilcode merged 5 commits into
developfrom
feature/header-animation
Jul 12, 2026
Merged

oneilcode merged 5 commits into
developfrom
feature/header-animation

Conversation

@oneilcode

@oneilcode oneilcode commented Jul 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

What changed, and why?

  • add Header animation for both light/dark themes
  • add Private route protection
  • add Token expiry handling

Linked Issue: Closes #30 36 39

Screenshots

dark

Summary by CodeRabbit

  • New Features

    • Added a History page to the app.
  • Bug Fixes

    • Improved handling of expired or invalid sign-in sessions by redirecting users to the locale homepage.
    • Updated behavior for unauthenticated access to the History route to route users to the locale homepage.
    • Refined sticky header styling, including improved scrolled-state and dark-mode appearance.

@oneilcode oneilcode self-assigned this Jul 8, 2026
@oneilcode oneilcode added the enhancement New feature or request label Jul 8, 2026
@netlify

netlify Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for swagger-editor-app ready!

Name Link
🔨 Latest commit 4f5e210
🔍 Latest deploy log https://app.netlify.com/projects/swagger-editor-app/deploys/6a4f7c708e1338000851aab1
😎 Deploy Preview https://deploy-preview-41--swagger-editor-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new HistoryPage route, updates sticky header styling for light and dark scrolled states, and extends updateSession() to redirect invalid-token requests to the locale root after clearing Supabase cookies.

Changes

Feature and fix updates

Layer / File(s) Summary
History page route
src/app/[locale]/history/page.tsx
Adds a default-exported HistoryPage component rendering a placeholder div with class about-page.
Header scroll and dark-mode styling
src/components/layouts/Header/Header.module.css
Reworks .header transitions, updates .header.scrolled background and shadow, adds dark-mode backdrop blur and border-color rules, plus trailing blank lines.
Proxy invalid token handling
src/proxy.ts
updateSession() now captures error from getClaims(), detects invalid or expired tokens, and redirects to locale root while deleting Supabase cookies before the existing no-user /history redirect logic.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: bt-diana, solarsungai

Poem

A bunny hops through history's door,
With header glows and shadows galore.
If tokens go stale, away they sweep,
Cookies tucked up, secrets to keep.
Hop-hop—dark mode twinkles bright,
And /history greets the night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main changes: header animation, private route protection, and token expiry handling.
Description check ✅ Passed The description covers the summary, linked issues, and screenshots; only optional notes and checklist sections are missing.
Linked Issues check ✅ Passed The header styling changes address the dark-theme header animation requested by issue #30.
Out of Scope Changes check ✅ Passed The changes align with the stated goals for header animation, route protection, and token expiry handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 feature/header-animation

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/`[locale]/history/page.tsx:
- Around line 1-3: The HistoryPage component is hardcoded and does not use the
active locale or translated copy. Update the default export in HistoryPage to
accept params, call setRequestLocale(locale) before rendering, and replace the
literal “History page” text with the corresponding Navigation.history
translation from the locale messages so the page is localized.

In `@src/components/layouts/Header/Header.module.css`:
- Around line 19-22: The dark header background in Header.module.css is using an
undefined Mantine CSS variable inside the rgba() value, so the translucent
effect is breaking. Update the dark-scheme .header rule to use a valid RGB
source by either switching to an existing Mantine RGB variable or defining and
using a body RGB custom property, keeping the change localized to the header
background styling.

In `@src/proxy.ts`:
- Around line 40-43: The JWT failure detection in the auth handling path is too
broad and should use Supabase’s structured error type instead of substring
matching. Update the invalid-token check in the logic around getClaims() to
inspect the returned AuthInvalidJwtError and its code value (bad_jwt) so only
true invalid/expired JWT cases trigger the redirect and cookie clearing. Keep
the existing auth flow in src/proxy.ts but replace the message-based includes
checks with the structured error guard at the same decision point.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8504ec01-be3f-4c81-80c9-ee015502de5b

📥 Commits

Reviewing files that changed from the base of the PR and between 2ae3fa9 and 96c7696.

📒 Files selected for processing (3)
  • src/app/[locale]/history/page.tsx
  • src/components/layouts/Header/Header.module.css
  • src/proxy.ts

Comment thread src/app/[locale]/history/page.tsx Resolved
Comment thread src/proxy.ts Resolved

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/proxy.ts`:
- Around line 38-41: The token validation in `src/proxy.ts` only checks
`isAuthApiError(error)` for `bad_jwt`, so `getClaims()` errors of type
`AuthInvalidJwtError` are missed and stale cookies remain. Update the
`isInvalidToken` logic in the proxy flow to also recognize the local JWT
validation failure by checking the error’s `name` alongside the existing
`AuthApiError`/`code` condition, then keep the existing cookie purge path
unchanged for both cases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7550f02d-6ae6-4a07-87bf-92acd9187d40

📥 Commits

Reviewing files that changed from the base of the PR and between 3961ec6 and 4f5e210.

📒 Files selected for processing (1)
  • src/proxy.ts

Comment thread src/proxy.ts Resolved
@oneilcode
oneilcode merged commit 8aaf060 into develop Jul 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Header animation for dark theme?

2 participants