pub trait Status: ThemeExt {
// Provided methods
fn step_row(
&self,
icon: impl Into<Icon>,
title: impl Into<SharedString>,
detail: Option<SharedString>,
meta: Option<SharedString>,
failed: bool,
expanded: Option<bool>,
) -> Div { ... }
fn step_output(
&self,
id: impl Into<ElementId>,
text: impl Into<SharedString>,
) -> Stateful<Div> { ... }
fn error_strip(&self, message: impl Into<SharedString>) -> Div { ... }
fn warning_strip(&self, message: impl Into<SharedString>) -> Div { ... }
fn status_bar(&self) -> Div { ... }
fn status_path(
&self,
id: impl Into<ElementId>,
path: &Path,
label: impl Into<SharedString>,
) -> Stateful<Div> { ... }
}Provided Methods§
Sourcefn step_row(
&self,
icon: impl Into<Icon>,
title: impl Into<SharedString>,
detail: Option<SharedString>,
meta: Option<SharedString>,
failed: bool,
expanded: Option<bool>,
) -> Div
fn step_row( &self, icon: impl Into<Icon>, title: impl Into<SharedString>, detail: Option<SharedString>, meta: Option<SharedString>, failed: bool, expanded: Option<bool>, ) -> Div
One operation, as a row: an icon, what it was, and how it went.
A tool call in a transcript, a step in a CI run, a file in a migration —
the shape is the same everywhere, which is why this takes strings and
not a type that knows what any of them mean. detail is the truncating
middle (a query, a path, a · 3 count), meta the right-aligned figure
that never truncates (a duration, a size, a row count).
expanded is None when there is nothing under the row, and the
chevron is simply absent — a disclosure that opens onto nothing is worse
than no disclosure. Some renders it, and the caller owns the flag.
Returns a plain Div like the rest of this module: the caller adds
.id(..) and .on_click(..) to this row, never to a wrapper around
it, or the hitbox ends up narrower than what it paints. Hover is
caller-owned (gpui panics on a second hover); the default wash is
Theme::element_hover.
Sourcefn step_output(
&self,
id: impl Into<ElementId>,
text: impl Into<SharedString>,
) -> Stateful<Div>
fn step_output( &self, id: impl Into<ElementId>, text: impl Into<SharedString>, ) -> Stateful<Div>
What a Self::step_row opens onto: its output, verbatim.
Monospaced and capped, because the thing being shown is a program’s stdout and the row it hangs off is one line tall — a 900-line stack trace pushing the next step off screen is the failure this cap exists for. Past the cap it scrolls, which is why it takes an id.
No scrollbar: the wheel reaches it regardless, and a bar would need a
ScrollHandle and a ScrollbarState from every caller for a box that
is usually four lines long. Wrap it in div().relative() with
crate::scroll::scrollbar over it if a particular one earns the bar.
A wheel over the box is the box’s, and never the page’s
(crate::scroll::contain_wheel): gpui hands one to every pane under
the pointer, and this one hangs off a row in a page that scrolls too.
Sourcefn error_strip(&self, message: impl Into<SharedString>) -> Div
fn error_strip(&self, message: impl Into<SharedString>) -> Div
The red error strip (flex items-start gap-2 rounded-xl border border-red-400/20 bg-red-400/[0.06] text-red-300/90 with a
leading TriangleAlert mt-0.5 size-4). No dismiss control; the caller
adds one as a child.
Sourcefn warning_strip(&self, message: impl Into<SharedString>) -> Div
fn warning_strip(&self, message: impl Into<SharedString>) -> Div
The amber warning strip (flex items-start gap-2 border-amber-400/20 bg-amber-400/[0.06] text-amber-200/90 with a leading TriangleAlert mt-0.5 size-3.5).
Sourcefn status_bar(&self) -> Div
fn status_bar(&self) -> Div
A pane’s bottom row: 30px under a top border, in muted Caption text.
Sourcefn status_path(
&self,
id: impl Into<ElementId>,
path: &Path,
label: impl Into<SharedString>,
) -> Stateful<Div>
fn status_path( &self, id: impl Into<ElementId>, path: &Path, label: impl Into<SharedString>, ) -> Stateful<Div>
A Self::status_bar cell showing label for path. It takes the
room left, truncates, tooltips the full path and copies it on click.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".