Describe the Bug
When a collection is registered as a "global" via multiTenantPlugin (collections: { header: { isGlobal: true } }), clicking its entry in the admin sidebar flashes a blank, nav-less screen before the document editor appears.
It is not a full page reload — it is a soft navigation in which the collection list route commits blank (the entire admin shell/nav is torn down) for a beat, before the plugin's redirect resolves and it soft-navigates on to the document view. Non-global collections do not do this; they navigate straight to their list with the nav intact.
Root cause. An isGlobal collection's sidebar link targets the normal list route (/admin/collections/<slug>), exactly like any collection. The plugin injects GlobalViewRedirect as a global admin action, which runs during the list view's render and, for view === 'list', throws a server redirect() to the tenant's document. On a client-side (soft) navigation, a server redirect() thrown from a component that renders after the shell makes Next.js commit the list route empty (without the layout/nav) before following the redirect. That empty commit is the flash. The redirect target is a second route, so in dev it must also compile, stretching the blank frame to ~1s; in production it is briefer but still a visible blank.
Responsible code:
Affected versions: reproduced on v3 3.85.0, and the same list→document server redirect is present on main (v4) — so both are affected. It is not fixed on main.
Measurement — sampling location.pathname, nav visibility, and visible text on every animation frame while clicking a global vs. a normal collection:
GLOBAL (header/footer):
t=0 ms /admin nav=true content
t=1050 ms /admin/collections/footer nav=FALSE BLANK <-- flash
t=2179 ms /admin/collections/footer/ID nav=true content
NORMAL (pages) — no blank frame:
t=0 ms /admin nav=true content
t=2308 ms /admin/collections/pages nav=true content
Link to the code that reproduces this issue
Reproduction Steps
- Scaffold with
pnpx create-payload-app@latest -t blank.
- Add
@payloadcms/plugin-multi-tenant with a tenants collection and one collection marked isGlobal: true (e.g. header).
- Create a tenant and its single global document.
- Log into the admin and select the tenant in the tenant selector.
- Click the global's entry in the sidebar.
- Observe: the sidebar/layout disappears (blank screen) for a moment before the document editor renders. Compare with clicking a normal collection, where the nav never disappears.
Which area(s) are affected?
plugin: multi-tenant
Environment Info
Payload: 3.85.0 (list→document server redirect also present on main / v4)
Next.js: 16.2.6
Node: 22.19.0
pnpm: 11.1.3
OS: macOS (darwin arm64)
Describe the Bug
When a collection is registered as a "global" via
multiTenantPlugin(collections: { header: { isGlobal: true } }), clicking its entry in the admin sidebar flashes a blank, nav-less screen before the document editor appears.It is not a full page reload — it is a soft navigation in which the collection list route commits blank (the entire admin shell/nav is torn down) for a beat, before the plugin's redirect resolves and it soft-navigates on to the document view. Non-global collections do not do this; they navigate straight to their list with the nav intact.
Root cause. An
isGlobalcollection's sidebar link targets the normal list route (/admin/collections/<slug>), exactly like any collection. The plugin injectsGlobalViewRedirectas a global admin action, which runs during the list view's render and, forview === 'list', throws a serverredirect()to the tenant's document. On a client-side (soft) navigation, a serverredirect()thrown from a component that renders after the shell makes Next.js commit the list route empty (without the layout/nav) before following the redirect. That empty commit is the flash. The redirect target is a second route, so in dev it must also compile, stretching the blank frame to ~1s; in production it is briefer but still a visible blank.Responsible code:
GlobalViewRedirect/index.ts#L43— using the list→document route fromgetGlobalViewRedirect.ts#L105-L112.GlobalViewRedirect/index.ts#L46(server.redirect(...)) andgetGlobalViewRedirect.ts#L106.Affected versions: reproduced on v3
3.85.0, and the same list→document server redirect is present onmain(v4) — so both are affected. It is not fixed onmain.Measurement — sampling
location.pathname, nav visibility, and visible text on every animation frame while clicking a global vs. a normal collection:Link to the code that reproduces this issue
payload/packages/plugin-multi-tenant/src/components/GlobalViewRedirect/index.ts
Line 43 in 29dd43c
Reproduction Steps
pnpx create-payload-app@latest -t blank.@payloadcms/plugin-multi-tenantwith atenantscollection and one collection markedisGlobal: true(e.g.header).Which area(s) are affected?
plugin: multi-tenant
Environment Info
Payload: 3.85.0 (list→document server redirect also present on main / v4)
Next.js: 16.2.6
Node: 22.19.0
pnpm: 11.1.3
OS: macOS (darwin arm64)