Skip to content

feat(branding): introduce support for icon-only branding and better flexibility - #428

Merged
govindavashishtha merged 6 commits into
mainfrom
chore/gv/width-logo
Aug 26, 2026
Merged

govindavashishtha merged 6 commits into
mainfrom
chore/gv/width-logo

Conversation

@govindavashishtha

@govindavashishtha govindavashishtha commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add theme.brand.mode so hosts pick chrome look first: icon-title | icon-only | logo (omit brand for default TrueForge marks).
  • BrandConfig is a discriminated union on mode. name is required and always labels the mark (alt / aria-label); visible title text only for icon-title.
  • Compact surfaces always use the square icon. Expanded chrome uses logo when mode: 'logo', otherwise icon (+ title when icon-title).
  • resolveBrandChrome() maps mode → { expandedVariant, collapsedVariant, showTitle }; SidebarLayout uses it instead of field heuristics.
  • Docs, changelog, and tests updated for the new contract.

Contract

brand.mode Required Expanded Collapsed
omit brand — TF wordmark TF square
'icon-title' name (+ optional icon) square + title square
'icon-only' name, icon square (alt only) square
'logo' name, icon, logo wide logo (alt only) square

Usage

// Default TrueForge wordmark / square mark
<TrueForgeUI server={server} layout="sidebar" />

// Icon + title
theme={{ brand: { mode: 'icon-title', name: 'Acme', icon: '/icon.svg' } }}

// Icon only (name kept for alt)
theme={{ brand: { mode: 'icon-only', name: 'Acme', icon: '/icon.svg' } }}

// Wide logo when expanded
theme={{
  brand: {
    mode: 'logo',
    name: 'Acme',
    icon: '/icon.svg',
    logo: '/wordmark.svg',
    href: '/',
  },
}}

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Breaking `theme.brand` shape affects all hosts that customize branding; runtime behavior is mostly visual with no auth or data-path changes.
> 
> **Overview**
> Introduces **`theme.brand.mode`** (`icon-title` | `icon-only` | `logo`) so hosts choose header chrome up front. **`BrandConfig`** is now a discriminated union: square **`icon`**, optional wide **`logo`**, required **`name`** (always for a11y; visible title only for `icon-title`), and **`href`** at the brand level instead of on image config.
> 
> Adds **`resolveBrandChrome()`** and **`BrandLogo` `variant="icon" | "logo"`**. **`SidebarLayout`** uses them for expanded vs collapsed marks; default branding shows the **TrueForge wordmark** when expanded and the square mark when compact (new wordmark SVGs). **`WelcomeScreen`** and the widget FAB pass **`variant="icon"`**.
> 
> **Breaking for integrators:** replace `brand: { name, logo }` with a `mode` and `icon` / `logo` as required. Docs, changelog, and tests cover the new contract.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ab3fe728b8f068572e16f1eca217c3f248124edc. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

… logo configurations

- Added new  type to support square icons and optional wide logos.
- Updated theme documentation to reflect changes in branding options.
- Implemented logic for rendering icons and logos based on the theme mode.
- Introduced fallback mechanisms for compact and expanded surfaces.
- Updated examples and tests to demonstrate new branding capabilities.
@changeset-bot

changeset-bot Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ab3fe72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@truefoundry/trueforge-ui Minor
@truefoundry/trueforge Patch
frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@govindavashishtha
govindavashishtha enabled auto-merge (squash) August 25, 2026 08:00
@govindavashishtha govindavashishtha self-assigned this Aug 25, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cbc4d79. Configure here.

govindavashishtha and others added 2 commits August 26, 2026 19:18
Hosts pick icon-title, icon-only, or logo first; name always labels the mark, and resolveBrandChrome drives sidebar chrome.

Co-authored-by: Cursor <cursoragent@cursor.com>
govindavashishtha and others added 2 commits August 26, 2026 23:17
Extract shared logo sizing classes into a module constant used by both desktop and mobile sidebar headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@govindavashishtha
govindavashishtha merged commit 3539da2 into main Aug 26, 2026
8 checks passed
@govindavashishtha
govindavashishtha deleted the chore/gv/width-logo branch August 26, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants