Skip to content

Revert "fix: complete Google Font setup in brand panel"#2869

Merged
drfarrell merged 1 commit intomainfrom
revert-2867-correct-google-font-upload-from-ui
Sep 18, 2025
Merged

Revert "fix: complete Google Font setup in brand panel"#2869
drfarrell merged 1 commit intomainfrom
revert-2867-correct-google-font-upload-from-ui

Conversation

@drfarrell
Copy link
Copy Markdown
Collaborator

@drfarrell drfarrell commented Sep 18, 2025

Reverts #2867


Important

Reverts previous changes to Google Font setup in brand panel, removing logic for font configuration and integration with Tailwind and layout management.

  • Revert Changes in FontManager:
    • Removed logic for handling sandbox session in addFont().
    • Removed calls to addFontToTailwindConfig() and layoutManager.addFontVariableToRootLayout().
    • Removed editorEngine.frames.reloadAllViews() calls in addFont(), removeFont(), and syncFontsWithConfigs().
  • Revert Changes in ast-generators.ts:
    • Removed logic for handling font IDs with special characters in createFontFamilyProperty().
  • Revert Changes in ast-manipulators.ts:
    • Removed logic for handling font IDs with special characters in addFontToTailwindTheme().

This description was created by Ellipsis for 42b1ae2. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • Refactor
    • Streamlined font management: adding/removing/syncing fonts no longer triggers global view reloads, resulting in faster, less disruptive updates.
    • Automated theme/root layout updates on font changes have been removed; apply any desired theme/layout adjustments manually.
    • Font keys now require valid identifier-style names for theme mapping. Fonts with non-identifier names may not be auto-mapped until renamed.

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Building Building Preview Comment Sep 18, 2025 9:25pm
web Building Building Preview Comment Sep 18, 2025 9:25pm

@supabase
Copy link
Copy Markdown

supabase Bot commented Sep 18, 2025

This pull request has been ignored for the connected project wowaemfasoptxrdjhilu because there are no changes detected in apps/backend/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes remove Tailwind/root-layout update and global view reload steps from font addition/removal/sync flows, retaining only internal state updates and font loading. AST helpers now always use Identifier keys for font family entries, eliminating prior StringLiteral fallback for non-identifier font IDs.

Changes

Cohort / File(s) Summary
Web: FontManager flow simplification
apps/web/client/src/components/store/editor/font/index.ts
Removed sandbox retrieval and config updates in addFont; dropped Tailwind config, root layout insertion, and global view reloads from addFont/removeFont/sync. Kept internal font state updates and fontSearchManager operations. Public API unchanged.
Fonts AST generators: key handling
packages/fonts/src/helpers/ast-generators.ts
In createFontFamilyProperty, always generate object key with Identifier (t.identifier(font.id)); removed conditional logic that used StringLiteral for non-identifier IDs. Structure of values unchanged.
Fonts AST manipulators: Tailwind theme key
packages/fonts/src/helpers/ast-manipulators.ts
In addFontToTailwindTheme, always use Identifier for the fontFamily key, removing fallback to StringLiteral for invalid identifier IDs. Value array remains [var(--font...), 'sans-serif'].

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant FM as FontManager
  participant FSM as FontSearchManager
  participant TW as Tailwind Config
  participant RL as Root Layout
  participant V as Views

  rect rgba(230,240,255,0.5)
  note over User,FM: Previous addFont flow (simplified)
  User->>FM: addFont(font)
  FM->>FM: update internal _fonts
  FM->>FSM: update index + load(font)
  FM->>TW: add fontFamily entry
  FM->>RL: insert CSS var to root
  FM->>V: reload all views
  end

  rect rgba(230,255,230,0.5)
  note over User,FSM: New addFont flow
  User->>FM: addFont(font)
  FM->>FM: update internal _fonts
  FM->>FSM: update index + load(font)
  note over TW,RL: No updates
  note over V: No reload
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

I nudge the fonts with a gentle hop,
No configs to tweak, no reload stop—
Just letters lined in tidy rows,
Identifiers where the family grows.
With whisker-twitch and lighter load,
I bound ahead on the simpler road. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-2867-correct-google-font-upload-from-ui

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e6562d and 42b1ae2.

📒 Files selected for processing (3)
  • apps/web/client/src/components/store/editor/font/index.ts (0 hunks)
  • packages/fonts/src/helpers/ast-generators.ts (1 hunks)
  • packages/fonts/src/helpers/ast-manipulators.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@drfarrell drfarrell merged commit 43468e4 into main Sep 18, 2025
3 of 6 checks passed
@drfarrell drfarrell deleted the revert-2867-correct-google-font-upload-from-ui branch September 18, 2025 21:25
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