You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GTK4: SplitView FFIs (splitview_create, splitview_add_child) not wired — co-blocks docs/examples/ui/layout/snippets.ts on Linux CI #218
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
Both FFIs exported as #[no_mangle] pub extern "C" fn in crates/perry-ui-gtk4/src/lib.rs.
If splitview rows exist in crates/perry-ui/src/styling_matrix.rs, flip the GTK4 cells from Missing to Wired. Verify ./target/release/styling-matrix --check is clean.
Wired in v0.5.322 (commit e58ff60). New crates/perry-ui-gtk4/src/widgets/splitview.rs backed by gtk4::Paned::new(Orientation::Horizontal) (matches macOS NSSplitView's vertical-divider/side-by-side default).
splitview_create(left_width) — accepts the macOS arg for signature parity but ignores it (Paned::set_position is a separate setter the user can call if needed).
splitview_add_child — first call → set_start_child, second → set_end_child, third+ → no-op + warning.
2-vs-N caveat (per the issue's PR-body ask): GTK4 Paned supports exactly 2 children where macOS NSSplitView supports N. Users wanting >2 panes on Linux should nest SplitViews recursively. The runtime warning makes the cap discoverable when someone hits it.
docs/examples/ui/layout/snippets.ts now compiles + links + exits 0 in test mode on Linux GTK4.
Activity
fix(ui-gtk4): wire 7 missing FFIs blocking Linux doc-tests gate (v0.5…
proggeramlug commentedon Apr 27, 2026
Wired in v0.5.322 (commit e58ff60). New
crates/perry-ui-gtk4/src/widgets/splitview.rsbacked bygtk4::Paned::new(Orientation::Horizontal)(matches macOSNSSplitView's vertical-divider/side-by-side default).splitview_create(left_width)— accepts the macOS arg for signature parity but ignores it (Paned::set_positionis a separate setter the user can call if needed).splitview_add_child— first call →set_start_child, second →set_end_child, third+ → no-op + warning.2-vs-N caveat (per the issue's PR-body ask): GTK4
Panedsupports exactly 2 children where macOSNSSplitViewsupports N. Users wanting >2 panes on Linux should nest SplitViews recursively. The runtime warning makes the cap discoverable when someone hits it.docs/examples/ui/layout/snippets.tsnow compiles + links + exits 0 in test mode on Linux GTK4.