Expand description
Shared view utilities for the GitKraft GUI.
Helpers in this module are used by multiple feature views and are kept here to avoid duplication and make them easy to test in isolation.
Functions§
- centered_
placeholder - A centered placeholder with an icon and a label, used for empty/loading states.
- collapsible_
header - A collapsible section header with a chevron, label, count, and toggle message. Used for “Local (N)” / “Remote (N)” in the branches sidebar.
- context_
menu_ header - Header label for a context menu panel.
- context_
menu_ separator - Thin horizontal separator line for context menus.
- empty_
list_ hint - Centered muted text shown when a list has no items.
- on_
press_ maybe - Conditionally attach an
on_presshandler to a button. - surface_
panel - Wrap content in a full-size container with the surface background style.
- thin_
scrollbar - Standard thin vertical scrollbar direction used across all sidebar panels.
- toolbar_
btn - A toolbar button with an icon and label text. Used in the header toolbar for Refresh, Open, Close, etc.
- truncate_
to_ fit - Truncate
sto fit withinavailable_pxpixels at the given averagepx_per_charrate, appending “…” when the string is shortened.