feat(index-page): hoist CnIndexSidebar through CnAppRoot for correct NcAppSidebar positioning#189
Merged
Merged
Conversation
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.
Contributor
|
🎉 This PR is included in version 1.0.0-beta.29 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CnAppRootgains a reactive `cnIndexSidebarConfig` provide + a `cnHostsIndexSidebar: true` sentinel.CnIndexPageinjects 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.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
Test plan
Related