feat: add Master/Detail pattern (v0) [WIP]#4825
Draft
ernst-dev wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4825 +/- ##
==========================================
- Coverage 97.61% 97.61% -0.01%
==========================================
Files 952 953 +1
Lines 30816 30840 +24
Branches 11318 11333 +15
==========================================
+ Hits 30081 30103 +22
- Misses 688 690 +2
Partials 47 47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
[WIP] First-cut (v0) of the Master/Detail layout pattern. Opening as a draft to
gather early feedback on the approach — this is a foundation, not a finished feature.
The Master/Detail pattern places a list/master pane (e.g. a
Table) alongside a detailpane that reflects the selected item; selecting an item updates the detail view, and the
layout collapses to a single column on narrow widths.
This v0 is delivered as a documented composition + a small internal layout helper,
rather than a new public component, because the pattern is fundamentally a composition of
existing primitives (
AppLayout,Table/Cards,KeyValuePairs, …). The only reusable,non-trivial piece — the two-column layout plus responsive collapse — is owned by the helper.
Everything here is additive and opt-in, and lives under
src/internalso it carriesno public API surface (no documenter definitions, i18n messages, or test-utils wrappers).
What's included (done in v0)
src/internal/components/master-detail-layout/— experimental internal helper:MasterDetailLayoutcomposes existing layout primitives; owns the two-column grid andthe responsive collapse to a single column (via
useContainerQuery).optional "back to list" control), otherwise the master pane.
resolveMasterDetailView(...)for the pane-visibility branching.styles.scss(+test-classes) and aREADME.mddocumenting the pattern & API.pages/master-detail/simple.page.tsx— dev/demo page: aTable(single-select) master→
KeyValuePairsdetail, insideAppLayout+ContentLayout, with an empty state.(wide layout, empty-state placeholder, no back-control in wide layout).
Remaining work (out of scope for v0 — follow-ups)
SplitPanel/drawer-based detail variant in addition to the inline detail pane.API docs) — or keeping it as a documented composition/recipe.
__integ__integration tests and visual-regression coverage.Related links, issue #, if available: n/a (see ticket-mismatch note above)
How has this been tested?
npx eslinton the new files — clean (auto-formatted with prettier).npx stylelinton the new SCSS — clean.npm run quick-build— success.jest.unit.config.js) — 8/8 passing.npm run build(full: pages, themeable, docs, size-limit, test-definitions) — success(only pre-existing entrypoint asset-size warnings, unrelated to this change).
npm start→ open the "master-detail/simple" dev page; select rows to updatethe detail pane; resize the window to observe the single-column collapse.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
useContainerQuery.Security
checkSafeUrl. — N/A, no URL handling.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.