Skip to content

Don't render tenant site chrome (title bar, light/dark switch) on the multisite dashboard - #11

Open
lindsayhi wants to merge 1 commit into
mainfrom
fix/hide-tenant-chrome-on-dashboard
Open

lindsayhi wants to merge 1 commit into
mainfrom
fix/hide-tenant-chrome-on-dashboard

Conversation

@lindsayhi

Copy link
Copy Markdown

Two pieces of tenant-site UI render on the multisite dashboard, where neither belongs.

Symptoms

1. A "Site Title" bar above the dashboard. SiteHeader renders the site title, page navigation and locale switcher on the dashboard hostname. There's no tenant global doc behind it, so it falls back to the placeholder text — the bar reads Site Title, followed by a Dashboard nav link and an English locale dropdown, sitting above the dashboard's own admin UI.

2. A light/dark switch that does nothing. SiteFooter renders the mode switch on the dashboard too. It toggles a dark class that only the tenant sites' styles respond to — the dashboard's admin UI never picks it up, so the control is visible but inert.

Why it happens

The Astro front end serves every hostname in the project through the same [...slug].astro page, dashboard included. Anything SiteHeader or SiteFooter renders unconditionally therefore lands on the dashboard, even though the dashboard is not a tenant site and has none of their content or styling behind it.

Worth noting this is specific to the Astro starter. In apostrophecms/public-demo-multisite the dashboard is a separate Apostrophe instance with its own dashboard/views/layout.html, so tenant chrome can't reach it — no equivalent change is needed there.

The change

Skip both when serving the dashboard hostname. The check lives in one shared helper (frontend/src/lib/isDashboard.js) rather than being duplicated, so a project that overrides the dashboard's short name has a single place to adjust.

23 added lines, nothing removed, no change to how tenant sites render.

Testing

Verified on a multisite instance with the dashboard and nine tenant sites: the dashboard renders its own admin UI with no title bar and no mode switch, while tenant sites keep their header, navigation, locale switcher and a working light/dark toggle. Both modified components were also checked against the Astro compiler.

One question for maintainers

The footer itself (the ApostropheCMS logo and link columns) still renders on the dashboard. That may well be intentional, so I've left it alone — happy to include it if you'd rather the dashboard had no tenant footer at all.

🤖 Generated with Claude Code

The Astro front end serves every hostname through the same [...slug].astro
page, so anything SiteHeader and SiteFooter render unconditionally also lands
on the multisite dashboard — which is not a tenant site and has none of their
content or styling behind it. Two things show up there today:

- A "Site Title" bar with page navigation and the locale switcher, sitting
  above the dashboard's own admin UI. There is no tenant global doc behind
  it, so it renders the placeholder title.
- The light/dark switch, which toggles a `dark` class that only the tenant
  sites' styles respond to. The dashboard never picks the class up, so the
  control is visible but does nothing.

Skip both when serving the dashboard hostname. The check lives in one shared
helper so a project that overrides the dashboard's short name has a single
place to adjust.
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