Skip to main content

Module view_utils

Module view_utils 

Source
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_press handler 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 s to fit within available_px pixels at the given average px_per_char rate, appending “…” when the string is shortened.