Context
docs/examples/ui/layout/snippets.ts imports SplitView and splitViewAddChild from perry/ui to demonstrate the split-pane layout pattern. The example compiles + links cleanly on macOS (NSSplitView) but fails on the GTK4-on-Ubuntu doc-tests CI runner with:
/usr/bin/ld: perry_llvm_*.ll:(.text+...): undefined reference to `perry_ui_splitview_create'
/usr/bin/ld: perry_llvm_*.ll:(.text+...): undefined reference to `perry_ui_splitview_add_child'
Co-blocker (alongside #217's overlay/reorder FFIs) for the gtk4 doc-tests gate on origin/main.
What's missing
| FFI |
macOS |
GTK4 mapping |
perry_ui_splitview_create |
NSSplitView widget |
gtk::Paned::new(Orientation::Horizontal) |
perry_ui_splitview_add_child |
addArrangedSubview: |
Paned::set_start_child(&child) for first call, set_end_child(&child) for second |
Implementation notes
gtk::Paned is GTK4's split-pane primitive. It supports exactly two children (start_child + end_child), unlike NSSplitView which can hold N. Most uses of SplitView in TS pass exactly 2 children, but the API allows more.
- Decision needed: cap GTK4's
splitview_add_child at 2 (third+ call → no-op or error), or nest Paneds recursively to support N children. The simplest+correct first cut is the 2-child cap, with a runtime warn if a third child arrives.
- Default orientation: macOS
NSSplitView defaults to vertical-divider (horizontal arrangement). Match that with Orientation::Horizontal on Paned.
- The handle/separator is automatic on
Paned; no need to wire a separate setOrientation API for the first cut unless it already exists on macOS.
Acceptance
Pointers
- macOS implementations: search
crates/perry-ui-macos/src/ for perry_ui_splitview_create / _add_child.
- Existing GTK4 multi-child container patterns: search
crates/perry-ui-gtk4/src/ for vstack_create / hstack_create / add_child — same shape, just Paned instead of Box.
- Failing doc-test:
docs/examples/ui/layout/snippets.ts.
Related
Estimated size
Small — ~30-50 LOC. The 2-vs-N child caveat is the only design decision worth flagging in the PR.
Context
docs/examples/ui/layout/snippets.tsimportsSplitViewandsplitViewAddChildfromperry/uito demonstrate the split-pane layout pattern. The example compiles + links cleanly on macOS (NSSplitView) but fails on the GTK4-on-Ubuntu doc-tests CI runner with:Co-blocker (alongside #217's overlay/reorder FFIs) for the gtk4 doc-tests gate on origin/main.
What's missing
perry_ui_splitview_createNSSplitViewwidgetgtk::Paned::new(Orientation::Horizontal)perry_ui_splitview_add_childaddArrangedSubview:Paned::set_start_child(&child)for first call,set_end_child(&child)for secondImplementation notes
gtk::Panedis GTK4's split-pane primitive. It supports exactly two children (start_child+end_child), unlikeNSSplitViewwhich can hold N. Most uses ofSplitViewin TS pass exactly 2 children, but the API allows more.splitview_add_childat 2 (third+ call → no-op or error), or nestPaneds recursively to support N children. The simplest+correct first cut is the 2-child cap, with a runtime warn if a third child arrives.NSSplitViewdefaults to vertical-divider (horizontal arrangement). Match that withOrientation::HorizontalonPaned.Paned; no need to wire a separatesetOrientationAPI for the first cut unless it already exists on macOS.Acceptance
#[no_mangle] pub extern "C" fnincrates/perry-ui-gtk4/src/lib.rs.splitviewrows exist incrates/perry-ui/src/styling_matrix.rs, flip the GTK4 cells fromMissingtoWired. Verify./target/release/styling-matrix --checkis clean.cargo build --release -p perry-ui-gtk4succeeds.docs/examples/ui/layout/snippets.tscompiles + links cleanly on Linux (in conjunction with GTK4: 4 widget overlay/reorder FFIs not wired — blocks docs/examples/ui/layout/snippets.ts on Linux CI #217's overlay/reorder fix).Pointers
crates/perry-ui-macos/src/forperry_ui_splitview_create/_add_child.crates/perry-ui-gtk4/src/forvstack_create/hstack_create/add_child— same shape, justPanedinstead ofBox.docs/examples/ui/layout/snippets.ts.Related
styleattribute in HTML. #185 (UI cross-platform audit)perry_ui_open_folder_dialognot wired — blocks docs/examples/ui/dialogs/snippets.ts on Linux CI #216 (sibling: GTK4 folder dialog)Estimated size
Small — ~30-50 LOC. The 2-vs-N child caveat is the only design decision worth flagging in the PR.