Skip to content

docs: add Theming Publisher guide#320

Open
mlennie wants to merge 2 commits into
malloydata:mainfrom
mlennie:docs/theming-guide
Open

docs: add Theming Publisher guide#320
mlennie wants to merge 2 commits into
malloydata:mainfrom
mlennie:docs/theming-guide

Conversation

@mlennie

@mlennie mlennie commented May 25, 2026

Copy link
Copy Markdown
Contributor

Walkthrough video: https://www.loom.com/share/e31e852ca1664526a1e7a355a07bddd6 (recorded before the correction commit below, so parts of it show the earlier draft's behavior)

Adds a Theming Publisher user guide. It documents the three ways to set Publisher's chart, table, and dashboard-tile colors: the instance theme block in publisher.config.json, the in-app Theme Editor at /settings/theme, and per-chart # theme.* annotations. Covers the cascade (a per-chart annotation over the instance theme over Publisher's built-in defaults), the full palette key set (per-mode background, tableHeader, tableHeaderBackground, tableBody, tile, tileTitle, mapColor; shared series + font), light/dark mode behavior, how a config theme edit is re-applied (it seeds the runtime store on first boot, so use --init or the editor's "Reset to defaults" afterward), and current theme-control limits (per-environment themes are reserved in the schema but not yet applied by any viewer).

The guide was fact-checked against the shipped Publisher and renderer code. The second commit (dbac07b) corrects the initial draft to match it: the editor is instance-wide (not per-environment), the runtime store is DuckDB (not SQLite), mapColor applies to choropleth maps only (not heatmaps), the editor UI is four cards (Charts/Maps/Tables/Typography) with per-card previews, and it adds a security note that open-source Publisher does not authenticate requests (so the editor and PUT /api/v0/theme are reachable by anyone who can reach the server; run behind an auth layer or trusted network, and use frozenConfig where the theme must not be mutable).

Adds a cross-link from publishing.malloynb so the main publishing guide points readers at the new doc.

mlennie added 2 commits May 25, 2026 12:35
Documents the four configuration surfaces for Publisher chart,
table, and dashboard tile colors: instance and environment
theme blocks in publisher.config.json, the in-app Theme Editor
at /settings/theme, and per-chart `# theme.*` annotations.
Covers the cascade order, the full palette key set (per-mode
background, tableHeader, tableHeaderBackground, tableBody,
tile, tileTitle, mapColor; shared series + font), light/dark
mode behavior, and current theme-control limits.

Adds a cross-link from publishing.malloynb so the main
publishing guide points readers at the new doc.

Signed-off-by: Monty Lennie <montylennie@gmail.com>
The initial draft predated the theming PR review and described behavior that
does not match what shipped. Corrected and fact-checked against the merged
Publisher/renderer code:

- The in-app Theme Editor edits the single instance theme (not a per-environment
  theme), and its UI is four cards (Charts, Maps, Tables, Typography) with a
  per-card inline preview, not six sections plus one preview pane.
- The runtime theme store is DuckDB, not SQLite.
- publisher.config.json's `theme` only seeds the store on first boot; later JSON
  edits need `--init` or the editor's "Reset to defaults" to re-apply. Added an
  "applying config changes" note and dropped the implication that a plain
  restart re-reads the config.
- Per-environment themes (environments[].theme) are reserved in the schema but
  not yet applied by any viewer; documented the three working surfaces and moved
  per-environment to "what is not theme-controlled yet".
- `palette.mapColor` applies to choropleth maps only; rect-mark heatmaps keep
  their built-in scheme.
- The logo note pointed at a non-existent `MalloyPublisherApp` component;
  corrected to the real app-shell `logoHeader` prop.
- Theme changes apply immediately in the editing tab and to other viewers on
  their next page load (not "the next render in any tab").
- Added a security note: open-source Publisher does not authenticate requests,
  so the editor and PUT/DELETE /api/v0/theme are reachable by anyone who can
  reach the server; run behind an auth layer / trusted network and use
  frozenConfig where the theme must not be mutable. Softened the frozenConfig
  line since the theme is served from the store, not necessarily the config file.

This matches the Publisher README and api-doc.

Signed-off-by: Monty Lennie <montylennie@gmail.com>
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