Skip to content

Admin-configurable site banner#1591

Open
hodyhq wants to merge 1 commit into
getfider:mainfrom
hodyhq:feat/site-banner-admin-v2
Open

Admin-configurable site banner#1591
hodyhq wants to merge 1 commit into
getfider:mainfrom
hodyhq:feat/site-banner-admin-v2

Conversation

@hodyhq

@hodyhq hodyhq commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Implements https://feedback.fider.io/posts/646/admin-configurable-site-banner-above-the-page-header

Adds a tenant-scoped notice that renders above the page header for maintenance windows, releases, or incident announcements. Disabled by default — existing installs see no change.

Schema

Additive migration. Three new columns on tenants:

  • site_banner_enabled BOOL NOT NULL DEFAULT FALSE
  • site_banner_message TEXT NOT NULL DEFAULT ''
  • site_banner_variant VARCHAR(20) NOT NULL DEFAULT 'info'

Backend

  • New UpdateTenantSiteBanner action — validates variant against allowlist (info | success | warning | danger | brand) and rejects enabled banner with empty message. 500-char cap.
  • New POST /_api/admin/settings/site-banner endpoint.
  • Tenant entity carries the three fields; rendered via existing Tenant context in views/base.html immediately inside <body>.

Frontend

  • /admin/banner page: toggle, color-variant dropdown, 500-char message textarea, live preview, per-keystroke remaining counter.
  • _site-banner.scss owns the five variant palettes (info teal, success green, warning amber, danger red, brand var(--color-primary)). Responsive: tightens padding/font under 640px.
  • When disabled, the conditional in views/base.html elides the <div> entirely — no DOM cost.

Backwards compatibility

Migration is additive, all defaults are off/empty. Stock Fider installs see no change until an admin opts in.

@hodyhq hodyhq force-pushed the feat/site-banner-admin-v2 branch 2 times, most recently from fdcc1eb to 868f4ef Compare June 26, 2026 16:24
Adds a tenant-scoped notice that appears above the page header for
maintenance windows, releases, or incident announcements. Off by
default for existing installs; admin opt-in via Site Settings →
Banner.

Schema
- tenants.site_banner_enabled BOOL NOT NULL DEFAULT FALSE
- tenants.site_banner_message TEXT NOT NULL DEFAULT ''
- tenants.site_banner_variant VARCHAR(20) NOT NULL DEFAULT 'info'
- Migration is additive — no behavior change on upgrade.

Backend
- New action UpdateTenantSiteBanner validates variant against an
  allowlist (info|success|warning|danger|brand) and rejects an
  enabled banner with empty message. Max 500 chars.
- New cmd + postgres handler updates the three columns in one UPDATE.
- New POST /_api/admin/settings/site-banner endpoint.
- Tenant entity carries the three fields; rendered via existing
  Tenant context in views/base.html immediately inside <body>.

Frontend
- /admin/banner page with toggle / variant dropdown / 500-char
  message textarea / live preview / per-keystroke counter.
- _site-banner.scss owns the five variant palettes (info teal,
  success green, warning amber, danger red, brand var --color-primary).
  Responsive: tightens padding/font under 640px.
- No customer-facing render changes when disabled — the
  conditional in views/base.html elides the <div> entirely.
@hodyhq hodyhq force-pushed the feat/site-banner-admin-v2 branch from 868f4ef to 1cf903a Compare June 26, 2026 16:30
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