dorfteich/packages/shared/src
Claude Opus 5 a327126fac
All checks were successful
CI / Lint, typecheck, test (pull_request) Successful in 7m8s
CI / Build container images (pull_request) Successful in 4m3s
CI / Auth e2e pack (pull_request) Successful in 9m1s
CI / Import/export fidelity gate (pull_request) Successful in 1m3s
CD / Build and push images (push) Successful in 16s
CD / Deploy to Test (push) Successful in 17s
CD / Smoke tests against Test (push) Successful in 1m21s
CD / Promote to Int (push) Successful in 13s
CI / Lint, typecheck, test (push) Successful in 6m49s
CI / Build container images (push) Has been skipped
CI / Auth e2e pack (push) Successful in 8m42s
CI / Import/export fidelity gate (push) Successful in 58s
#307: pond-level branding overrides the instance logo and favicon
Built on #306's storage, serving and crop control — a layer, not a parallel
implementation. `resolveBranding` in shared is the ONE place that answers
"which asset applies here?", and both the sidebar logo and the favicon swap
read it.

The decision most likely to be "fixed" by accident, so it is pinned by name
in `branding.test.ts`: **a logo set belongs to one level and variants are
never mixed across levels.** A pond that uploaded only a light logo shows THAT
logo in dark mode; it does not borrow the instance's dark variant. Decided
2026-08-01 — a logo silently swapping to a different image when the viewer
switches theme is a change nobody ordered, and a design that looks wrong is
more honest than one that is quietly substituted. Only a pond with no logo at
all inherits the instance's set, again as a set. The settings screen warns
about a missing dark variant; it never blocks.

Consequences that fall out of that rule and are easy to get wrong:

- The serving route does NOT fall back when given a pond scope. The caller
  already decided which level applies; a "helpful" fallback in the route
  would mix variants across levels behind the resolver's back.
- The logo link's accessible name follows the LEVEL: a pond logo is named by
  the pond, an instance logo by the instance. It is the link home, and a
  link's name has to say where it goes.

- **Charged to the pond's storage quota**, before the write, like attachments.
  Without it branding would be a way around the quota, and replacing a logo
  repeatedly would consume disk with no ceiling. The replaced asset's bytes
  are released FIRST, so re-uploading the same logo costs nothing — and a
  refused upload puts the released reservation back, so a rejection cannot
  leave the pond with more room than it had.
- **Purge removes the branding files.** The purge standard is absolute: after
  it nothing referencing the pond survives, rows or files. Asserted against
  the real purge path, not the new code alone.
- Security unchanged from #306 and not relaxed because the uploader is now an
  ordinary Pond Admin: SVG refused, magic bytes and IHDR checked server-side,
  size caps, content type pinned, no image parsing.
- The favicon swap is driven by the RESOLVED pond, never the raw route
  parameter — an unreadable or unknown slug must not leave a stale icon in
  the tab. That it happens after first paint is accepted and stated in the
  code and the UI: avoiding it would mean server-rendering index.html, which
  is #179's territory.

Same audit id as #306 (`branding.changed`) with `scope: 'pond'` — the catalogue
already carries the field, so no version bump.

Verified: api suite 105 files / 592 tests green; 5 pond-branding e2e tests
(pond scope serves the pond's bytes while the instance level still 404s, the
quota is charged and released exactly, SVG refused at pond level, a reader may
read but not change, purge deletes the files); 9 shared unit tests on the
resolution order including both mixing directions.
2026-08-01 20:44:02 +02:00
..
editor-schema #169: Nicht-Text-Inhalte — Task-Checkboxen, Wissensgraph 2026-07-21 14:35:16 +02:00
permissions #205: classification inherits down the tree; lowering is a guarded, audited act 2026-07-31 06:12:26 +02:00
admin-users.ts Add Site-Admin user management (#59) 2026-07-10 00:31:41 +02:00
api-error.ts Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
api-tokens.ts Public REST API v1: personal access tokens, instance switch + per-pond opt-in (#104) 2026-07-12 11:17:03 +02:00
auth.test.ts Add user, identity, session, and auth-support data model 2026-07-05 00:42:22 +02:00
auth.ts #214: OIDC Authorization Code with PKCE, Keycloak as reference IdP 2026-07-31 12:44:52 +02:00
backup-set.ts Nextcloud backup target: admin-configured, manual + scheduled uploads, in-app restore (#103) 2026-07-12 10:39:18 +02:00
backup-status.ts Backup mirror to BASEL: rsync of the sets after every successful run (#84) 2026-07-12 12:20:32 +02:00
backup-target-policy.test.ts #192: deploy-level backup target allowlist 2026-07-30 12:17:14 +02:00
backup-target-policy.ts #192: deploy-level backup target allowlist 2026-07-30 12:17:14 +02:00
branding.test.ts #307: pond-level branding overrides the instance logo and favicon 2026-08-01 20:44:02 +02:00
branding.ts #307: pond-level branding overrides the instance logo and favicon 2026-08-01 20:44:02 +02:00
collab-token.test.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
collab-token.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
comments.ts Add threaded page comments: data model, API, and comment policy (#91) 2026-07-11 21:42:29 +02:00
conversion.ts Obsidian vault import: endpoint, job orchestration, rollback (#117) 2026-07-14 17:13:11 +02:00
custom-fonts.test.ts #303: operator-uploaded fonts — storage, API, PDF embedding, backup 2026-08-01 14:49:13 +02:00
env.test.ts Add Prisma with PostgreSQL, automatic migrations, and /readyz 2026-07-04 19:16:44 +02:00
env.ts #306: instance branding — logo and favicon, cropped in the browser 2026-08-01 19:30:52 +02:00
favorites.ts Favorites: personal page stars, golden icons, sidebar filter (#132) 2026-07-16 12:03:55 +02:00
feed-tokens.ts #149: Atom-Feeds für Teiche und Seiten, privat via Feed-Token 2026-07-20 00:49:53 +02:00
files.ts Add non-image attachments with allowlist, SVG policy, and file managers (#61) 2026-07-10 02:52:40 +02:00
fonts.test.ts Add per-pond fonts: catalog, build, application, and admin UI (#66) 2026-07-10 11:16:29 +02:00
fonts.ts #303: operator-uploaded fonts — storage, API, PDF embedding, backup 2026-08-01 14:49:13 +02:00
health.test.ts Scaffold pnpm monorepo with lint, format, and test tooling 2026-07-04 19:06:27 +02:00
health.ts Scaffold pnpm monorepo with lint, format, and test tooling 2026-07-04 19:06:27 +02:00
home.ts Editable landing page for the Site Admin 2026-07-12 23:50:16 +02:00
i18n-tools.test.ts Add i18n with i18next, German and English, and a key-parity check 2026-07-04 19:23:45 +02:00
i18n-tools.ts Add i18n with i18next, German and English, and a key-parity check 2026-07-04 19:23:45 +02:00
index.ts #305: a full pond archive before deletion and before purge 2026-08-01 20:24:35 +02:00
labels.test.ts Add label UI: tree management, page assignment, and sidebar filter (#44) 2026-07-09 11:41:42 +02:00
labels.ts Page hierarchy: parentId, create-under-parent, reparent (#106) 2026-07-14 09:57:47 +02:00
legal.ts Add instance legal pages with public rendering and footer links (#82) 2026-07-11 16:40:04 +02:00
links.ts Pond-wide wikilink graph endpoint (#111) 2026-07-14 10:21:25 +02:00
members.ts Add pond member management UI (#54) 2026-07-09 20:22:52 +02:00
notifications.ts #151: Mention-Benachrichtigungen über die Glocke 2026-07-20 01:25:16 +02:00
pages.ts #212: mark attachment downloads by filename prefix and companion file 2026-07-31 07:29:16 +02:00
plugins.ts #232: plugin allowlist with SHA-256 hash pinning 2026-07-31 21:26:36 +02:00
pond-archive.ts #305: a full pond archive before deletion and before purge 2026-08-01 20:24:35 +02:00
ponds.ts #307: pond-level branding overrides the instance logo and favicon 2026-08-01 20:44:02 +02:00
public-api.ts #211: classification through feeds, public API, search and the no-JS shell 2026-07-31 07:23:53 +02:00
quotas.ts Add Site-Admin quota override management UI (#58) 2026-07-10 00:14:28 +02:00
search.test.ts Add SearchProvider interface with PostgreSQL FTS (#49) 2026-07-09 13:25:05 +02:00
search.ts #211: classification through feeds, public API, search and the no-JS shell 2026-07-31 07:23:53 +02:00
secret-store.ts Add backup sidecar: nightly dump, volume archive, prune, status, restore (#83) 2026-07-11 17:29:15 +02:00
setup.ts Add the first-run setup wizard UI (#81) 2026-07-11 16:05:01 +02:00
system.ts #224: read-trail storage — partitioning, retention, admin query path 2026-07-31 12:21:45 +02:00
text-diff.test.ts Add version history UI: list, view, diff, restore (#42) 2026-07-09 08:53:42 +02:00
text-diff.ts Add version history UI: list, view, diff, restore (#42) 2026-07-09 08:53:42 +02:00
theme.test.ts #184: shared accent engine — WCAG-conforming tokens by construction 2026-07-29 08:59:27 +02:00
theme.ts #184: shared accent engine — WCAG-conforming tokens by construction 2026-07-29 08:59:27 +02:00
token-crypto.crossruntime.test.ts #188: purpose-bound token keys via HKDF, jose replaces the homegrown JWT 2026-07-30 06:41:11 +02:00
token-crypto.ts #214: OIDC Authorization Code with PKCE, Keycloak as reference IdP 2026-07-31 12:44:52 +02:00
tree.ts Page hierarchy: parentId, create-under-parent, reparent (#106) 2026-07-14 09:57:47 +02:00
users.ts #150: @-Mentions — Inline-Node, instanzweite User-Suche, Autocomplete 2026-07-20 00:56:07 +02:00
vs-nfd-profile.test.ts #243: VS_NFD_MODE and the machine-readable hardening-profile catalog 2026-07-31 18:24:04 +02:00
vs-nfd-profile.ts #232: plugin allowlist with SHA-256 hash pinning 2026-07-31 21:26:36 +02:00
watches.ts Add watches: follow pages and ponds with auto-watch preferences (#93) 2026-07-11 22:59:11 +02:00
webdav.test.ts Nextcloud backup target: admin-configured, manual + scheduled uploads, in-app restore (#103) 2026-07-12 10:39:18 +02:00
webdav.ts Nextcloud backup target: admin-configured, manual + scheduled uploads, in-app restore (#103) 2026-07-12 10:39:18 +02:00