Skip to content

feat(index-page): hoist CnIndexSidebar through CnAppRoot for correct NcAppSidebar positioning#189

Merged
rubenvdlinde merged 1 commit into
betafrom
feat/index-sidebar-hoist
May 10, 2026
Merged

feat(index-page): hoist CnIndexSidebar through CnAppRoot for correct NcAppSidebar positioning#189
rubenvdlinde merged 1 commit into
betafrom
feat/index-sidebar-hoist

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

  • CnAppRoot gains a reactive `cnIndexSidebarConfig` provide + a `cnHostsIndexSidebar: true` sentinel.
  • CnIndexPage injects both: when a CnAppRoot ancestor exists, it publishes its embedded `CnIndexSidebar` (component + props + listeners) into the holder via `mounted` / watcher / `beforeDestroy` instead of rendering inline. CnAppRoot mounts the sidebar as a sibling of the `#sidebar` slot, at NcContent level.
  • Apps mounting `CnIndexPage` standalone (without `CnAppRoot`) keep the legacy inline path — the inject defaults select that branch.

Why

`NcAppSidebar` (the right-side slide-out) must be a direct child of `NcContent` to render correctly. The pre-existing inline render put it inside `NcAppContent`, which made it fall back to in-flow layout — visible as the wide left column on `/apps/decidesk/meetings` index pages. The hoist is the only fix that doesn't require every consumer to teleport their own sidebar.

Compat

  • Existing `#sidebar` slot consumers unchanged — the hoisted sidebar renders alongside, not as a replacement.
  • Existing `cnPageSidebarComponent` (per-page registry-resolved sidebar) unchanged — it still drives the `#sidebar` slot's default content.
  • Legacy CnIndexPage standalone usage unchanged — `cnHostsIndexSidebar` defaults to `false` so the inline render is preserved.

Test plan

  • 8 new tests in `CnIndexPageSidebarHoist.spec.js` cover: publication on mount, suppression of inline render under hoist, holder clearance on disable / show:false / unmount, reactive prop updates, and listener re-emission.
  • All 18 tests in `CnIndexPageSidebar.spec.js` (legacy inline path) still pass — no regression.
  • Full suite 863 / 863 (one pre-existing CnMapWidget leaflet-missing failure is unrelated).
  • `npm run check:docs` green.
  • CI green.
  • Visual check via decidesk's meetings index page once that PR ships.

Related

  • Companion: PR #186 — manifest-driven `dataSource` for stats-block + chart widgets (also targets beta).

CnIndexPage's auto-mounted CnIndexSidebar (the index-page filter +
columns + facets panel) was rendered inline inside the cn-index-page
wrapper, which sits inside NcAppContent. NcAppSidebar must be a
DIRECT child of NcContent to render as the proper right-side
overlay; nested deeper it falls back to in-flow layout (the wide
left column users were seeing on /apps/decidesk/meetings).

CnAppRoot now provides a reactive 'cnIndexSidebarConfig' holder plus
a 'cnHostsIndexSidebar: true' sentinel via provide/inject. CnIndexPage
detects the host on mount, publishes its sidebar config (component +
props + listeners) into the holder, and skips the inline render. The
hoisted component mounts at NcContent level — sibling of the
consumer's '#sidebar' slot, so existing slot content
(e.g. CnObjectSidebar for detail pages) keeps working unchanged.

Apps mounting CnIndexPage standalone (without CnAppRoot) still see
the legacy inline rendering: the inject defaults to a no-op holder
and 'cnHostsIndexSidebar' defaults to false. No consumer changes
required.

Tests: 8 new in CnIndexPageSidebarHoist.spec.js cover both paths
(hoist active vs legacy inline) plus reactive prop updates and
listener re-emission. Full suite at 863/863.
@rubenvdlinde rubenvdlinde merged commit ba9d7ff into beta May 10, 2026
2 of 3 checks passed
@rubenvdlinde rubenvdlinde deleted the feat/index-sidebar-hoist branch May 10, 2026 15:07
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0-beta.29 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant