Add environment-specific favicons#369
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
846f26b to
2054833
Compare
2054833 to
248c80c
Compare
248c80c to
abb7bfe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abb7bfe53b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| preview: '/favicon-preview.ico', | ||
| development: '/favicon-development.ico', |
There was a problem hiding this comment.
Exempt the new favicon variants from proxy auth
In preview/development the metadata now points browsers at /favicon-preview.ico or /favicon-development.ico, but I checked src/proxy.ts and its matcher only excludes the exact favicon.ico path plus common image extensions, not other .ico files. Those static icon requests will therefore enter proxyCore and fall through to handleAuthGate, which calls createAuthForProxy(...).getAuthContext() before NextResponse.next(), adding auth/session work to every page load just to serve a public asset. Please extend the proxy exclusion to cover these new .ico paths or all .ico assets.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds environment-specific favicon selection based on VERCEL_ENV, so production/preview/development environments can display distinct favicon variants.
Changes:
- Introduces a centralized favicon config (
getFaviconEnvironment,getFaviconHref, size/type constants). - Wires the selected favicon into the App Router
metadata.iconsin the root layout. - Adds unit tests validating favicon environment resolution and href selection.
Reviewed changes
Copilot reviewed 3 out of 7 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/configs/favicon.ts |
Defines environment-to-favicon mapping and helper functions used by the app. |
src/app/layout.tsx |
Exports metadata to set the favicon dynamically via Next.js metadata API. |
tests/unit/favicon.test.ts |
Adds unit tests for environment resolution and favicon href selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const FAVICON_HREFS = { | ||
| production: '/favicon.ico', | ||
| preview: '/favicon-preview.ico', | ||
| development: '/favicon-development.ico', | ||
| } as const satisfies Record<FaviconEnvironment, string> |
abb7bfe to
c0099b8
Compare
Summary
Adds environment-specific favicon selection from
VERCEL_ENV.Moves the default production favicon to
public/favicon.icoand adds root-level preview/development.icovariants with darker tinted backgrounds.Validation
bun vitest run tests/unit/favicon.test.tsbun run check