Skip to main content

Crate buffr_ui

Crate buffr_ui 

Source
Expand description

Browser chrome — Phase 3 statusline (the rest is deferred).

See docs/ui-stack.md for the rendering decision: chrome lives in a softbuffer strip docked to the bottom of the buffr window, in the same winit window as the CEF child window above it.

This crate stays free of winit and softbuffer types in its public API — callers (apps/buffr) own surface lifecycle and pass us a raw &mut [u32] slice each frame. That keeps the unit tests trivial (build a Vec<u32>, paint, assert pixels) and avoids coupling chrome rendering to any one window backend.

Re-exports§

pub use confirm_prompt::CONFIRM_PROMPT_HEIGHT;
pub use confirm_prompt::ConfirmPrompt;
pub use confirm_prompt::ConfirmRect;
pub use confirm_prompt::rect_contains;
pub use context_menu::CONTEXT_MENU_MIN_WIDTH;
pub use context_menu::CONTEXT_MENU_PADDING_X;
pub use context_menu::CONTEXT_MENU_ROW_HEIGHT;
pub use context_menu::CONTEXT_MENU_SEP_HEIGHT;
pub use context_menu::ContextMenuEntry;
pub use context_menu::ContextMenuOverlay;
pub use download_notice::DOWNLOAD_NOTICE_HEIGHT;
pub use download_notice::DownloadNoticeKind;
pub use download_notice::DownloadNoticeStrip;
pub use input_bar::INPUT_HEIGHT;
pub use input_bar::InputBar;
pub use input_bar::MAX_SUGGESTIONS;
pub use input_bar::Palette as InputPalette;
pub use input_bar::SUGGESTION_ROW_HEIGHT;
pub use input_bar::Suggestion;
pub use input_bar::SuggestionKind;
pub use permissions_prompt::ACTION_HINT;
pub use permissions_prompt::PERMISSIONS_PROMPT_HEIGHT;
pub use permissions_prompt::PermissionsPrompt;
pub use tab_strip::FAVICON_RENDER_SIZE;
pub use tab_strip::MAX_TAB_WIDTH;
pub use tab_strip::MIN_TAB_WIDTH;
pub use tab_strip::TAB_STRIP_HEIGHT;
pub use tab_strip::TabFavicon;
pub use tab_strip::TabStrip;
pub use tab_strip::TabView;

Modules§

confirm_prompt
Generic yes/no confirmation prompt.
context_menu
Context-menu overlay widget.
download_notice
Download notification strip widget.
font
input_bar
Single-line text-input widget for the command line + omnibar.
permissions_prompt
Permissions-prompt overlay widget.
tab_strip
Tab strip — horizontal row of tab pills above the input bar / statusline.

Structs§

FindStatus
Find-in-page status. Mirrors what CEF’s OnFindResult callback hands us, projected into a pair of u32s for the right-hand statusline cell.
HintStatus
Snapshot of hint mode state. Rendered next to the cert pip when a hint session is active. Mirrors buffr_core::host::HintStatus — the indirection exists so buffr-ui doesn’t pull buffr-core as a dependency (would create a cycle).
Palette
Single source of truth for chrome colours. Built from a base accent plus a handful of semantic signals (cert state, private marker, update indicator, progress bar). The non-accent fields default to the historical fixed signals but are configurable via config.theme.*.
Statusline
Rendering input for the statusline. Re-create per frame; the widget owns nothing.

Enums§

CertState
Coarse certificate state for the URL display. Phase 3 wires only Unknown; CEF cert plumbing lands later.
Mode
Public re-export so embedders can pull Mode from one place. Coarse mode displayed in the status line. Insert is a single state here even though hjkl_engine may be in Normal/Insert/Visual internally — the page-mode FSM doesn’t care which sub-mode the embedded editor is in, only that page-level keystrokes route to BuffrHost instead of the page action dispatcher.
UpdateIndicator
Update channel indicator surfaced in the right-hand statusline cell. Mirrors buffr_core::UpdateStatus projected onto two render modes (* upd for Available, * upd? for Stale). None hides the cell entirely; the chrome doesn’t paint a placeholder.

Constants§

STATUSLINE_HEIGHT
Statusline strip height in pixels. 30 px fits a 14-px glyph row with comfortable padding above + below; matches the recommendation in docs/ui-stack.md. Bumping this requires the host window to re-layout the CEF child rect.