Skip to content

feat: use one teal icon across web, extension and landing with per-environment favicons - #2293

Open
paustint wants to merge 2 commits into
mainfrom
feat/unified-icon-colors
Open

paustint wants to merge 2 commits into
mainfrom
feat/unified-icon-colors

Conversation

@paustint

Copy link
Copy Markdown
Contributor

Why

Icon colour had no consistent meaning. Teal was both the desktop app and the extension's tab, black was the web app and the extension toolbar icon, admin was a slate that read as black, and a localhost tab looked identical to production.

What changes

Surface Before After
Web app, landing, canvas favicon black tile teal tile
Web app in development (pnpm start and a locally built server) same as prod orange tile
Web app on staging same as prod violet tile
Extension toolbar icon black tile teal tile (matches the extension's own tab)
Salesforce page button grey, black on hover grey, teal on hover
Docs favicon white tile, black mark white tile, teal mark
Admin favicon and header logo slate tile red tile
Desktop app teal unchanged

How

  • pnpm icons:brand (scripts/generate-brand-icons.mjs) writes every tile icon from one SVG template, so surfaces differ only by colour. Adds sharp as a dev dependency for rasterising.
  • File names are unchanged because they are public URLs. New files: favicon-development-*, favicon-staging-*, favicon-docs.ico.
  • Environment favicons are chosen at serve time: applyEnvironmentFavicons in the API (keyed on ENV.ENVIRONMENT) and devFaviconPlugin in the Vite dev server.
  • Apple touch and Windows tile icons are now full-bleed squares, since those platforms apply their own mask.
  • jetstream-icon-pro-*.png are regenerated with the shared corner radius; the extension manifest now points at them.

Worth a look before merging

  • The orange, violet and red are my picks. Each is one line in VARIANTS in the generator.
  • The mark is now centred in the tile; the old exports sat slightly left.
  • Existing users will see the favicon and extension toolbar icon change colour, so this wants a line in the release notes.
  • Not verified in a real browser: I checked the generated PNGs and ICOs visually and ran typecheck plus the new API unit test, but did not load the extension or run the apps.
  • The older hand-exported variants (-inverse, -bare, -white-bg, -sfdc-blue, black jetstream-icon-*) are untouched because their URLs may be linked externally.

…vironment favicons

Icon colour had no consistent meaning: teal was both desktop and the
extension tab, black was web and the extension toolbar, and admin was a
near-black slate. Teal is now the product colour everywhere; docs, admin,
development and staging each get their own tile so those tabs cannot be
mistaken for production.

All tile icons are now generated by `pnpm icons:brand` from one SVG
template. File names are unchanged because they are public URLs. The
desktop icons are left alone: they were already teal and need a padded
squircle and .icns that the generator does not produce.

@jetstream-bot-agent jetstream-bot-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Not ready to approve

The staging favicon can never be served: the swap is keyed on ENV.ENVIRONMENT, which is only ever development or production — staging is identified by ENV.STAGE. One-line fix, see the inline comment.

Reviewed: bb10b15 — 52 files, +256/-20. Focus: the serve-time favicon swap (API + Vite dev plugin), the extension manifest icon rename, the icon generator script.

Checked and clean: extension manifest/html icon names all resolve through sharedAssetsPlugin to files that exist in libs/shared/assets/public/images; the swap regex matches all three sized favicon links in apps/jetstream/index.html and leaves apple/android/ms icons alone; generated .ico files are valid 3-image containers and the PNGs have the sizes their names claim; favicon-docs.ico exists for Docusaurus; public file names are unchanged (SSO docs and canvas ECA URLs still resolve); sharp is already in allowBuilds; hover fill on the Salesforce page button targets the new jetstream-icon-tile class.


🤖 Final-gate review via Claude Code /pr-gatekeeper

Comment thread apps/api/src/main.ts Outdated
let jetstreamIndexHtml: string | null = null;
try {
jetstreamIndexHtml = readFileSync(join(__dirname, '../jetstream/index.html'), 'utf8');
jetstreamIndexHtml = applyEnvironmentFavicons(readFileSync(join(__dirname, '../jetstream/index.html'), 'utf8'), ENV.ENVIRONMENT);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium — Logic & Correctness

ENV.ENVIRONMENT is z.enum(['development', 'production']) (libs/api-config/src/lib/env-config.ts:130), and staging runs with ENVIRONMENT='production' + STAGE='staging' (see the note in scanner.routes.ts:22). So ENVIRONMENT_FAVICON_PREFIX.staging is unreachable here and a staging tab keeps the teal production favicon — the exact confusion this PR sets out to remove. The unit test passes only because it calls the helper with the literal string 'staging'.

Derive the value from both variables, e.g.:

const faviconEnvironment = ENV.ENVIRONMENT === 'development' ? 'development' : ENV.STAGE;
jetstreamIndexHtml = applyEnvironmentFavicons(readFileSync(join(__dirname, '../jetstream/index.html'), 'utf8'), faviconEnvironment);

(STAGE is development | staging | production, so it maps straight onto the prefix table.) Narrowing the helper's environment parameter from string to that union would let the compiler catch this kind of mismatch.

Staging runs with ENVIRONMENT='production' and is only identified by
STAGE, so keying the favicon swap on ENVIRONMENT left staging tabs with
the production icon. The helper now takes a typed environment so a
mismatch like this fails typecheck.

@jetstream-bot-agent jetstream-bot-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Ready to approve

No findings at the reporting threshold. The previous review's staging-favicon finding is fixed in 405bd8d87: the swap is now keyed on ENVIRONMENT/STAGE together and the helper takes a typed FaviconEnvironment, so ENV.STAGE maps straight onto the prefix table.

Reviewed: 405bd8d — 52 files, +260/-20. Focus: the serve-time favicon swap (API + Vite dev server), the extension manifest icon rename and how those files reach the bundle, and the icon generator script.

Checked and clean: the swap regex against the real apps/jetstream/index.html links (16/32/96 all have development and staging files; touch/android/ms icons are left alone); every jetstream-icon-pro-* name in the manifest and extension html exists in libs/shared/assets and is picked up by sharedAssetsPlugin; no remaining references to favicon-inverse.ico or the old jetstream-icon-<size>.png manifest names; the generated .ico files are valid 3-image containers; sharp is a root devDependency already allowed in allowBuilds. Static review only — nothing was built or run.


🤖 Final-gate review via Claude Code /pr-gatekeeper

This branch has not been deployed

No deployments
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