Commit Graph

14 Commits

Author SHA1 Message Date
Alex Gleason 7c50fa9a90 remove user-customizable theme system
Agora's colors and fonts are now hardcoded in the bundle. There is no
runtime CSS-variable injection, no remote-loaded theme, no font-family
override from event data, no background image, no recolored favicon.
Switching themes only toggles the .dark class on <html>.

Removed:

- src/themes.ts: ThemeConfig, ThemesConfig, CoreThemeColors, ThemeFont,
  ThemeBackground, themePresets (22 presets), buildThemeCssFromCore,
  deriveTokensFromCore, the 'custom' Theme variant. Now exports only
  resolveTheme(theme) -> 'light' | 'dark'.
- src/lib/fontLoader.ts: deleted. Mounted arbitrary @font-face rules with
  event-sourced URLs and font-family overrides — the primary CSS-injection
  vector. sanitizeCssString moved to src/lib/cssSanitize.ts (still used by
  the Letter feature).
- AppProvider hooks useApplyFonts / useApplyBackground / useApplyFavicon.
- useTheme.applyCustomTheme — the entrypoint that wrote external palettes
  to global theme state.
- ColorMomentEyeButton + its callers in NoteCard and PostDetailPage. Color
  Moments (kind 3367) still render as palette art, but the 'Set as theme'
  button is gone.
- LetterAttachment in LetterDetailSheet — the gift-box UI that applied an
  attached color moment as the recipient's theme.
- paletteToTheme() from colorMomentUtils — only getColors() remains.
- customTheme / themes fields from AppConfig, AppConfigSchema,
  EncryptedSettings, EncryptedSettingsSchema. Existing customTheme values
  in localStorage and encrypted NIP-78 settings are now ignored.
- 14 unused @fontsource packages. Only the 10 letter fonts and the 2 base
  UI fonts (Inter Variable, Bebas Neue) remain. noto-sans-nushu is kept
  for the encrypted-letter obfuscation indicator.

Added:

- Static :root {} and .dark {} blocks in src/index.css with the 19 shadcn
  tokens hardcoded. These were previously injected at runtime by
  AppProvider; without them the app would lose all colors when the runtime
  injector was removed.
- src/lib/cssSanitize.ts holding the sanitizeCssString helper for the
  Letter feature's font-family interpolation.

Simplified:

- public/theme.js: no longer reads customTheme or themes from localStorage,
  just resolves system/light/dark with hardcoded built-ins. Must stay in
  sync with src/index.css colors.
- src/lib/fonts.ts: trimmed to only the 10 letter fonts. findBundledFont
  and resolveCssFamily removed (they were only used by fontLoader).
2026-05-23 14:31:04 -05:00
Chad Curtis 0c29506402 Fix all 50 ESLint warnings by extracting non-component exports and adding missing deps
- Extract utility functions from component files into dedicated modules
  to fix react-refresh/only-export-components warnings:
  - parseBadgeDefinition -> src/lib/parseBadgeDefinition.ts
  - parseProfileBadges -> src/lib/parseProfileBadges.ts
  - getColors, paletteToTheme -> src/lib/colorMomentUtils.ts
  - parseDimToAspectRatio, eventToMediaItem -> src/lib/mediaUtils.ts
  - isAudioUrl, isImageUrl, isVideoUrl -> src/lib/mediaTypeDetection.ts
  - buildKindOptions, parseSelectedKinds -> src/lib/feedFilterUtils.ts
  - useVideoThumbnail -> src/hooks/useVideoThumbnail.ts
  - useEnvelopeDimensions -> src/hooks/useEnvelopeDimensions.ts
  - usePortalContainer -> src/hooks/usePortalContainer.ts
  - useAudioPlayer -> src/contexts/audioPlayerContextDef.ts
  - SubHeaderBar context/hooks -> src/components/SubHeaderBarContext.ts
  - EmotionDev hooks -> src/blobbi/dev/useEmotionDev.ts
  - BlobbiActions context def -> BlobbiActionsContextDef.ts

- Remove export from internal-only functions (useEventComments,
  parseEmojiPack, useScrollCarets, formatEffectSummary, getSortedEffectEntries)

- Fix react-hooks/exhaustive-deps warnings by adding missing dependencies
  to useEffect/useCallback/useMemo hooks across 14 files

- Fix logical expression dependency warnings by wrapping conditional
  values (tasks, pubkeys, authorPubkeys) in useMemo

- Move module-level constants (CORE_TAB_IDS, CORE_TAB_LABELS,
  DEFAULT_TAB_LABELS) out of ProfilePage component body

- Reorder usePushNotifications hooks so syncPreferences is defined
  before enable to fix block-scoped variable error
2026-04-05 11:57:31 -05:00
Chad Curtis a32c620b4e Add letter attachment: tap to apply embedded color moment or theme as your Ditto theme 2026-03-26 21:40:30 -05:00
Chad Curtis 848ac15ef0 Fix CI: remove unused prop, centralize color helpers, extract constants, memoize Sets, move @types/dompurify to devDeps 2026-03-26 19:45:51 -05:00
Chad Curtis 018fad1a2e Fix color moments text overlay, add geohash pill and geotag feed support
- Fix color moments rendering long text as emoji overlay; only render
  single emoji (≤2 code points) as palette overlay
- Replace MapPin with ChestIcon on geocache name
- Add geohash pill badge to geocache type/size row, linking to /g/ route
- Truncate geohash display to 5 characters
- Add /g/:geohash route with GeotagPage backed by shared TagFeedPage
- DRY up HashtagPage and GeotagPage into shared TagFeedPage component
- Extend useInterests to support g tags for geohash following
- Add geotag feed tabs to home feed with MapPin icon
2026-03-18 04:00:25 -05:00
Chad Curtis 0be9f809f2 Fix diagonal stripes layout using SVG polygons for crisp edges 2026-02-28 16:52:23 -06:00
Chad Curtis 52860eb64d Fix eye button: img-based SVG rendering, text left/eye right, CSS blink
- Render eye as data-URI img so browser anti-aliases it cleanly without
  creating a compositing layer that affected adjacent elements (the
  foreignObject approach was causing the diagonal stripes to look pixelated)
- Move 'Set as theme' text to the left of the eye, matching the requested layout
- Restore CSS animate-eyelid-blink via overflow-hidden on the eye container
  (the SVG animate element approach didn't fire correctly with React mount/unmount)
- Use React useId for stable unique IDs
- Revert diagonal stripes to original hard-stop gradient (the feathering was wrong)
2026-02-28 16:36:13 -06:00
Chad Curtis 51e84ffa8f Add blinking eye icon to color moment Set as theme button
Replaces the SwatchBook icon with a small circular eye (using the palette
colors for iris/pupil ring) that blinks using espy's eyelid-blink animation
when tapped. The eyelid fills with the palette's midpoint color and carries
the EyeClosed lash icon at its edge, matching the interaction pattern from
espy's color picker.
2026-02-28 16:26:38 -06:00
Chad Curtis d42ca5f300 feat: add 'Set as theme' button to color moment palettes with WCAG-enforced color mapping 2026-02-26 06:10:33 -06:00
Chad Curtis 031f35495a Fix checkerboard pattern rendering on iOS by replacing SVG background with CSS grid 2026-02-21 01:43:41 -06:00
shakespeare.diy 618f8a6c82 Port star and checkerboard layouts from Espy for cleaner rendering
Star: use clip-path polygon pie slices with overlap and background
fill to eliminate anti-aliased seam lines from conic-gradient.

Checkerboard: use SVG pattern with imageRendering: pixelated for
crisp color blocks instead of CSS grid with gaps.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 05:27:36 -06:00
shakespeare.diy b0e7217e5b Revert color layouts to 180px height, render star as rectangle with conic gradient
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 05:26:15 -06:00
shakespeare.diy e5c35a266e Make color moment renders square (aspect-ratio: 1) for all layouts
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 05:25:20 -06:00
shakespeare.diy ff38bb14bc Render polls, geocaches, and color moments per their NIP specs
- PollContent (kind 1068 / NIP-88): Shows question, options with
  selectable vote UI, tallied results with percentage bars, poll type
  badge (single/multi), expiry status. Fetches kind 1018 vote events,
  deduplicates per pubkey, and allows voting when logged in.

- GeocacheContent (kind 37516 / NIP-GC): Shows cache name, type badge,
  size badge, D/T difficulty pips (1-5), description, image, and
  ROT13-decoded hint toggle. Supports verified cache indicator.

- ColorMomentContent (kind 3367 / Espy NIP): Renders color palettes
  with all 6 layout modes (horizontal, vertical, grid, star,
  checkerboard, diagonalStripes). Emoji overlay with adaptive
  light/dark text based on palette luminance. Click-to-copy hex
  swatches. Name display above palette.

- NoteCard now dispatches to the correct content component based on
  event.kind (1, 1068, 3367, 34236, 37516).

- Replaced VinesPage/useStreamVines with generic KindFeedPage/useStreamKind.
  All kind-specific routes (/vines, /polls, /treasures, /colors) use
  the same generic streaming page parameterized by kind number.

- Centralized extra-kind definitions in lib/extraKinds.ts. All feeds
  (home, search, profile, hashtag) respect feed settings for which
  extra kinds to include.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 05:24:01 -06:00