Skip to content

feat(settings): add the white label kit and a brand's client logo (00429) - #1924

Merged
gkhngyk merged 6 commits into
ansvisor:mainfrom
cihan-gyk:feature/white-label-kit
Nov 1, 2026
Merged

gkhngyk merged 6 commits into
ansvisor:mainfrom
cihan-gyk:feature/white-label-kit

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

White label, part 1 of 3: the kit. Agencies keep their own brand on what they send clients. The pricing page and the Growth billing card promised "White-label reports", but the app had none. #1908 took the promise off until this stack ships, and part 3 puts it back.

The owner decided this on 2026-10-31:

  • Growth and Enterprise, and self-hosted installs;
  • an agency kit plus a client logo per brand;
  • v1 covers reports and exports; e-mails come later.

What this PR adds

  • Settings › White label (Admins edit, others read). The workspace's kit:
    • a logo: PNG, SVG or JPG, up to 1 MB;
    • a main color;
    • a company name;
    • a report footer line;
    • a preview card.
    • Starter sees the section locked, with the way to Growth.
  • Brand settings › General › Client logo: the client's logo for that brand's report cover ("Prepared for {client}").
  • Plans: white_label on Growth as well as Enterprise, in web and server plans. Self-hosted gets it too (owner decision).
  • 00429:
    • white_label_kits: one row per organization. Members read and Admins write; who changed it is stamped from the session.
    • brands.client_logo_path, under the brands policies.
    • A private white-label-logos bucket with no member policy: the app hands out one-time upload addresses and short-lived signed addresses.
  • Safety:
    • Server actions answer { ok, failure }, call assertWritable first and validate with Zod.
    • An uploaded logo must sit in the workspace's (or the brand's) folder and be the type it says.
    • An SVG that could run something (script, event handlers, javascript: links, foreignObject) is refused and deleted.
  • When the kit applies: only when the plan has white_label and the kit has a company name or a logo (kitInUse). Nothing reads the kit yet; parts 2 and 3 do.
  • Coverage lists: white_label_kits holds no brand's data, so the brand-access and demo-guard coverage tests list it as Account data, with why. A brand's client logo lives on brands, whose policies already refuse a demo brand's writes.
  • Help and docs: help/settings/white-label.md (approved: false) and a White label section in the Reports guide.

Stack: part 2 (reports) and part 3 (exports and the Growth card) are stacked on this PR. Merge in order.

For @gkhngyk (prod):

  • Apply 00429.
  • Check the white-label-logos bucket exists after it (the migration creates it).

Related issue

None. White label (owner decision 2026-10-31).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Apply 00429. On a Growth workspace, open Settings › White label as an Admin.
  2. Upload a logo, and set a color, a name and a footer.
    • The preview follows.
    • Unsaved fields stay through a logo change.
    • The logo box is white in light and dark themes.
  3. As a Manager, the section is read-only. On Starter, it's locked with the way to Growth.
  4. In Brand settings › General, add a client logo.
  5. Upload an SVG with a <script>: it is refused.
  6. Unit tests:
    • kit rules (kitInUse, colors darkened to WCAG AA on white, file words);
    • logo checks (type, size, magic bytes, unsafe SVG, folder);
    • Zod schema;
    • server actions;
    • both cards;
    • the coverage lists.

Checked in the browser at 1024px, light and dark: Settings › White label, the preview, and Brand settings › Client logo. The user approved the screens.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes (0 errors; 7 old warnings in files this PR doesn't touch)
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)
  • Migration added (00429) and supabase/schema.sql rebuilt

Checks:

  • On this branch's earlier head 3b3ead4, everything passed except the two coverage tests:
    • web: 803 files / 8,358 tests and yarn build;
    • server: format and lint, and every test except those two.
  • 0edccb7 fixes those two (22/22).
  • The full checks run again on part 3's head, which carries this branch and current main.

🤖 Generated with Claude Code

cihan-gyk and others added 5 commits October 31, 2026 19:16
…429)

Agencies can keep their own brand for what they send clients. Settings ›
White label holds the workspace's kit: a logo (PNG, SVG or JPG, 1 MB), a
main color, a company name and a report footer, with a preview. Brand
settings › General gets the client's logo for the brand's report cover.

- Plans: white_label on Growth as well as Enterprise (web and server);
  Starter sees the section locked, with the way to Growth. Self-host
  doesn't list it, as its plan has no white label to upgrade to.
- 00429: white_label_kits (members read, Admins write, who changed it
  stamped from the session), brands.client_logo_path (follows the brands
  policies) and the private white-label-logos bucket (no member policy:
  the app gives one-time upload and short-lived signed addresses).
- Server actions answer { ok, failure }, check assertWritable first and
  validate with Zod; an uploaded logo must be in the workspace's (or the
  brand's) folder and be what its type says, and an SVG that could run
  something is refused and deleted.
- The kit is used only when the plan has white_label and the kit has a
  company name or a logo (kitInUse); nothing uses it yet.
- Help: help/settings/white-label.md (approved: false); docs: a White
  label section in the Reports guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The owner's decision (2026-10-31): a self-hosted install has every
feature, white label included, so the White label section and the
brand's Client logo show there as on Growth and Enterprise. The cloud
plans don't change: Growth and Enterprise have it, Starter doesn't.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…os on white paper

- Settings › White label: uploading or removing a logo refreshed the whole
  form from the server, so a name, color or footer typed but not saved
  was lost. A logo change now updates only the logo and the kit's state;
  what is typed stays, and Save still takes it.
- The logo boxes in Settings › White label and Brand settings › Client
  logo were muted on a dark theme, so a dark logo couldn't be seen. They
  are white paper in both themes, as the report and its Preview are.
- Tests follow the self-hosted decision (the section and the Client logo
  card show there too); the Reports guide names self-hosted installs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-access and demo-guard lists

white_label_kits (00429) has no brand_id: one kit per organization, shared
by its brands. Both coverage tests now list it with why; a brand's client
logo lives on brands, whose policies already refuse a demo brand's writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit f9ee2a9.

Approve preview

@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Nov 1, 2026
gkhngyk
gkhngyk previously approved these changes Nov 1, 2026

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gkhngyk
gkhngyk merged commit a41547c into ansvisor:main Nov 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-migration Adds or edits a migration — apply it to the hosted database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants