Skip to content

Add superadmin-configurable site messages for auth pages and dashboard - #41

Merged
panteLx merged 1 commit into
mainfrom
feat/site-messages
Aug 2, 2026
Merged

Add superadmin-configurable site messages for auth pages and dashboard#41
panteLx merged 1 commit into
mainfrom
feat/site-messages

Conversation

@panteLx

@panteLx panteLx commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Superadmins can now set a custom banner message shown on the login/register pages, and a separate one shown on the dashboard, each with its own on/off toggle
  • Managed from /admin/settings under a new "Site messages" card, gated to superadmins both client- and server-side (same pattern as the existing registrationEnabled setting)
  • Reuses the existing appSettings key-value table, no migration needed
  • Added English and German translations

Test plan

  • tsc --noEmit and eslint pass on all changed files
  • Manually verified in the browser: set both messages as superadmin, confirmed persistence in the DB, confirmed banners render on /login, /register, and / (dashboard)
  • Confirmed a non-superadmin admin doesn't see the "Site messages" card, and a direct PATCH /api/admin/settings call with a non-superadmin session is rejected with 403

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Superadmins can configure optional site-wide messages for login, registration, and dashboard pages.
    • Messages support enable/disable controls, editable text, and preserved line breaks.
    • Configured messages appear prominently on the relevant pages.
    • Added English and German translations for the new settings.
  • Bug Fixes

    • Standardized authorization so all restricted settings require superadmin access.

Lets superadmins set an optional banner on the login/register pages and
a separate one on the dashboard, each with its own on/off toggle,
directly from the admin settings page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b7e04149-b4a2-4eec-b402-3340d9b42338

📥 Commits

Reviewing files that changed from the base of the PR and between 90ef6a8 and d48870c.

📒 Files selected for processing (9)
  • app/api/admin/settings/route.ts
  • app/login/page.tsx
  • app/page.tsx
  • app/register/page.tsx
  • components/admin/admin-settings-client.tsx
  • components/site-message-banner.tsx
  • lib/services/admin-settings-service.ts
  • messages/de-DE/admin.json
  • messages/en-US/admin.json

📝 Walkthrough

Walkthrough

The PR adds superadmin-controlled login and dashboard messages. The settings form stores message text and enablement flags. Login, registration, and dashboard pages retrieve enabled messages and render them with SiteMessageBanner.

Changes

Configurable site messages

Layer / File(s) Summary
Settings defaults and access control
lib/services/admin-settings-service.ts, app/api/admin/settings/route.ts
Default settings and getters support enabled, non-empty login and dashboard messages. PATCH authorization restricts site-message settings and registration settings to superadmins.
Superadmin message configuration
components/admin/admin-settings-client.tsx, messages/en-US/admin.json, messages/de-DE/admin.json
The settings form adds enablement switches and textareas for login and dashboard messages. English and German translations define the related labels and guidance.
Message banner and page rendering
components/site-message-banner.tsx, app/login/page.tsx, app/register/page.tsx, app/page.tsx
SiteMessageBanner renders non-empty messages with preserved line breaks. Login, registration, and dashboard pages load and display their configured messages.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Superadmin
  participant AdminSettingsClient
  participant SettingsAPI as /api/admin/settings
  participant LoginPage
  participant DashboardPage
  participant SiteMessageBanner

  Superadmin->>AdminSettingsClient: edit site-message settings
  AdminSettingsClient->>SettingsAPI: PATCH settings
  LoginPage->>LoginPage: getLoginMessage()
  DashboardPage->>DashboardPage: getDashboardMessage()
  LoginPage->>SiteMessageBanner: render login message
  DashboardPage->>SiteMessageBanner: render dashboard message
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/site-messages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@panteLx
panteLx merged commit 9df417b into main Aug 2, 2026
1 of 2 checks passed
@panteLx
panteLx deleted the feat/site-messages branch August 2, 2026 20:07
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