Files
signed/docs/gpui-native-kit-gaps.md
T

2.2 KiB

gpui-native-kit gaps

Vendored crates/ui shortcomings recorded here instead of patched in place.

  • PanelRow (src/layout/panel.rs) seeds its split panes from window.viewport_size() during the first render frame. On some launches that size is not yet the window's final bounds, so the divider freezes at a wrong position (observed ~24% instead of the intended 50%) until a drag or a double-click reset. Seeding from the canvas-measured extent, or re-seeding while no user resize has happened, would fix it.
  • island() (src/layout/panel.rs) rounds and paints overflow_hidden, but gpui's ContentMask is rectangular only: children are never clipped to the rounded corners. Full-bleed panel content (photos, backgrounds) paints square over the island chrome and must apply the matching theme.radius.overlay itself — see the signed-out banner in signed_app.
  • The popup primitives extracted into menu.rs (trigger_toggle, anchored_overlay, focus_capture) cover the trigger-button, anchored-panel, and focus-grab surfaces. They do not cover lists: ComboboxState and CommandPaletteState keep their own entity-backed virtualized rows outside the MenuItem engine because menu rows are built per frame from a Vec, while both hold stateful selections the uniform_list drives. Any future row engine should absorb those two.
  • toast.rs and alert.rs each re-implement the same scaffolding: a store entity with push/dismiss ids, an entry wrapper, a floating stack view with fade-out. Unification was declined for now; if either gains behavior the other lacks, extract the shared store/stack shell first.
  • The toggle family (checkbox.rs, switch.rs, toggle.rs) restates the same control scaffolding three times: sizing, disabled handling, a when(checked) style fork, and an on-change handler with optimistic paint. A shared toggle base would shrink the trio.
  • StatusDot and Badge both map a *Variant enum onto the same theme tokens (primary/success/warning/destructive ramps plus muted foreground). The tables are duplicated rather than shared.
  • ControlSizing (common.rs) and the Size::*_rems methods (theme) are parallel lookup tables: one maps Size to control metrics, the other to glyph metrics. Adding a size means touching both.