Skip to content

feat: add favicon color setting - #80

Merged
SawyerHood merged 3 commits into
mainfrom
favicon-color-setting
Jun 10, 2026
Merged

SawyerHood merged 3 commits into
mainfrom
favicon-color-setting

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Summary

Adds a Favicon color setting under Appearance that tints the browser tab icon to one of 8 colors — Red, Orange, Yellow, Green, Teal, Blue, Purple, Pink — or the theme-aware Default. Handy for telling bb instances/profiles apart by tab.

How it works

  • New apps/app/src/lib/favicon-color-preference.ts following the existing localStorage preference pattern (atomWithStorage + createLocalStorageEnumStorage, key bb.faviconColor, default "default").
  • The favicon is a monochrome glyph on transparent, so no new image assets: the module draws the existing PNG onto a canvas and recolors it with source-in compositing, then swaps the <link rel="icon"> hrefs to data URLs.
  • initializeFaviconColor() (called from main.tsx) applies the stored color at startup, re-applies on preference changes, and registers a prefers-color-scheme listener after the index.html bootstrap listener so a tinted favicon survives that script resetting hrefs on system theme changes. Selecting Default restores the existing dev/light/dark variant behavior.
  • Settings UI: dropdown with color swatches in the Appearance section of AppSettingsView, mirroring the Theme control.

Validation

  • pnpm exec turbo run typecheck --filter=@bb/app ✅
  • pnpm exec turbo run lint --filter=@bb/app ✅

🤖 Generated with Claude Code

SawyerHood and others added 3 commits June 10, 2026 11:48
Adds an Appearance setting that tints the browser tab favicon to one of
8 colors (or the theme-aware default), making it easy to tell bb
instances apart. The favicon glyph is monochrome, so tinting recolors it
on a canvas via source-in compositing — no new image assets needed. The
preference persists in localStorage (bb.faviconColor) and re-applies
after the index.html bootstrap script resets favicons on system theme
changes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Replaces the plain circle swatches with the favicon glyph itself,
rendered in each candidate color by using the favicon image as a CSS
mask — so the preview matches the resulting tab icon.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
# Conflicts:
#	apps/app/src/views/AppSettingsView.tsx
@SawyerHood
SawyerHood merged commit d852155 into main Jun 10, 2026
5 of 6 checks passed
@SawyerHood
SawyerHood deleted the favicon-color-setting branch June 10, 2026 19:15
hubarDevPersonal added a commit to hubarDevPersonal/bb that referenced this pull request Sep 21, 2026
From the independent acceptance review of the theme and surface commits:

- --surface-scrim is removed from the codex dark block. In Codex bg.scrim
  is the modal backdrop; in bb --surface-scrim is the frosted page-header
  surface (AppPageHeader), so get-bb#80 turned thread and page headers
  darker than the sidebar and let the timeline show through at 50%.
  Codex has no header-bar token, so it derives again.
- The light block no longer sets --destructive-text, --warning-text,
  --diff-added or --diff-removed. The tokens are dark-only and those
  hues measured 2.8-4.0:1 on white; bb's defaults stay readable.
- Raised cards (tool, terminal, system and file-diff blocks, task-diff
  message card, task-ready banner, composer) get border-border-seam and
  the desktop sidebar seam is restored. It is #ffffff0d in codex
  (reference border.light, practically invisible) and keeps an edge in
  themes whose raised and sidebar steps are only 2-3% ink.
- Tests that assumed the old default theme id now use
  defaultAppTheme.themeId, and the curated category map includes the
  new workbench plugin (three suites were red on the branch).
- The --palette-* identity tokens are documented in the bb-cli theming
  reference.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
hubarDevPersonal added a commit to hubarDevPersonal/bb that referenced this pull request Sep 26, 2026
From the independent acceptance review of the theme and surface commits:

- --surface-scrim is removed from the codex dark block. In Codex bg.scrim
  is the modal backdrop; in bb --surface-scrim is the frosted page-header
  surface (AppPageHeader), so get-bb#80 turned thread and page headers
  darker than the sidebar and let the timeline show through at 50%.
  Codex has no header-bar token, so it derives again.
- The light block no longer sets --destructive-text, --warning-text,
  --diff-added or --diff-removed. The tokens are dark-only and those
  hues measured 2.8-4.0:1 on white; bb's defaults stay readable.
- Raised cards (tool, terminal, system and file-diff blocks, task-diff
  message card, task-ready banner, composer) get border-border-seam and
  the desktop sidebar seam is restored. It is #ffffff0d in codex
  (reference border.light, practically invisible) and keeps an edge in
  themes whose raised and sidebar steps are only 2-3% ink.
- Tests that assumed the old default theme id now use
  defaultAppTheme.themeId, and the curated category map includes the
  new workbench plugin (three suites were red on the branch).
- The --palette-* identity tokens are documented in the bb-cli theming
  reference.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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