Skip to content

feat(exports): name downloads and Word authors after the white label kit, and list it on Growth again - #1926

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

gkhngyk merged 19 commits into
ansvisor:mainfrom
cihan-gyk:feature/white-label-exports

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

White label, part 3 of 3: exports and the Growth card. With a kit in use, what the pages download carries the agency's name instead of Ansvisor's. Without one, every name stays as it was. The Growth plan card lists white-label reports again.

Stacked on #1925 (part 2), which is stacked on #1924. Review only the commits after part 2. Current main is merged in (b5a666b, no conflicts).

What changes

  • File names: the ansvisor_ (or ansvisor-) word becomes the company's slug on these exports:

    • Prompts, Topics, Insights;
    • Citations, Competitors, Mentions;
    • Action Center (actions, signals);
    • content opportunity, Content Editor, Library;
    • AI Traffic.

    A kit with only a logo puts no word there.

  • How pages read the kit: once per page load (export-name.ts, getExportBranding). The AI Traffic route reads it on the server. If the kit can't be read, the file name has neither word.

  • Word files (Content Editor, Library, opportunity) name the company as author and last editor. Excel files (write-excel-file) and CSVs carry no author either way.

  • Loading: the white label actions load the service-role client only when first needed, so pages that only name downloads don't load it.

  • Settings › White label forgets the kit it read after a change.

  • Growth card: the Growth plan card and the Choose a plan dialog list "White-label reports & exports" again, beside Looker Studio. fix(billing): stop listing white-label reports, which the app doesn't have #1908 had taken it off until the feature existed.

  • Help and docs: the Reports guide and help say which downloads follow the kit. E-mails don't yet.

After merge: the pricing page (www.ansvisor.com, not in this repo) can promise "White-label reports" on Growth and Custom again.

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. With a kit in use, export from Prompts, Citations, Action Center and AI Traffic: each file name starts with the company's slug.
  2. Download a Word file from the Content Editor. Its author is the company.
  3. With a logo-only kit, file names have no company word. Without a kit, they keep ansvisor_.
  4. Billing › plans, and the Choose a plan dialog: Growth lists "White-label reports & exports".
  5. Unit tests:
    • fileWord and withFileWord;
    • each page's export name;
    • the Word author;
    • the AI Traffic route;
    • the plan cards.

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)

Full checks on this branch (c31be56, with #1924, #1925 and current main): web 813 files / 8,477 tests pass, and yarn build passes. Server format:check and lint are clean, and 352 files / 4,994 tests pass (3 skipped).

🤖 Generated with Claude Code

cihan-gyk and others added 18 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]>
With a kit in use (the plan has white_label and the kit has a company
name or a logo), a brand's report carries the agency's brand instead of
Ansvisor's; without one, nothing changes.

- PDF: the company as author and creator, the kit's footer line (or none)
  instead of "Generated with Ansvisor · www.ansvisor.com", the kit's color
  on the rule, bars and trend line (text set in it darkened until it reads
  on white, WCAG AA), and a cover with the agency's logo or name,
  "Prepared for {brand}" and the brand's client logo.
- Report page: the same cover above the report; the PDF is named
  "{company-slug}_{brand}_report_{date}.pdf" instead of "ansvisor_…".
- getReportBranding(brandId) gives the kit with the logos as data URLs, so
  the browser can draw the PDF while the bucket stays private; an SVG logo
  is drawn onto a canvas as a PNG for the PDF. A kit that can't be read
  makes no PDF (the page asks to try again), so a file in Ansvisor's look
  never goes to a client by mistake.
- Help and the Reports guide say where the kit appears.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With a kit in use, what the pages download carries the agency's name
instead of Ansvisor's; without one, every name stays as it was.

- File names: the "ansvisor_" (or "ansvisor-") word becomes the company's
  slug on the Prompts, Topics, Insights, Citations, Competitors, Mentions,
  Action Center (actions, signals), content opportunity, Content Editor,
  Library and AI Traffic exports, and none for a kit with only a logo.
  Pages read the kit once a page load (export-name.ts, getExportBranding);
  the AI Traffic route reads it on the server. A kit that can't be read
  names the file with neither word.
- Word files (Content Editor, Library, opportunity) name the company as
  author and last editor. Excel files (write-excel-file) and CSVs carry no
  author either way.
- The white label actions import the service-role client when first
  needed, so pages that only name downloads load without it.
- Settings › White label forgets the kit read after a change.
- Help and the Reports guide say which downloads follow the kit; e-mails
  don't yet.

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]>
…F line

Generate visibility reports was approved on main (ansvisor#1896) after this branch
added its white label sentence to Download a PDF, so the copy Chat answers
from (approved-articles.json) is refreshed with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…xports

# Conflicts:
#	web/src/components/settings/white-label-section.tsx
…-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]>
…n again

ansvisor#1908 took "White-label reports" off the Growth card while the app had
none. With the kit, branded reports and branded exports in this stack,
the Growth card and the Choose a plan dialog list "White-label reports &
exports" again, beside Looker Studio.

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 ad62675.

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

# Conflicts:
#	docs/guides/reports.mdx
#	help/settings/white-label.md
#	supabase/schema.sql
#	web/src/components/settings/white-label-section.test.tsx
#	web/src/components/settings/white-label-section.tsx
#	web/src/lib/actions/white-label.test.ts
#	web/src/lib/actions/white-label.ts
@github-actions github-actions Bot removed the needs-migration Adds or edits a migration — apply it to the hosted database label 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 merged commit 2de6303 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants