Review checklist
Use this list when reviewing a PR that touches
crates/ui-storybook/src/components/. Each line maps to a rule in
the presentational contract.
File scan
-
No
use leptos::reactive::*;outside acfg(test)block. -
No
RwSignal::new,signal(,Effect::new,Effect::watch,Action::newincomponents/. -
No
tauri::,invoke(,wasm_bindgen::start,web_sys::window().local_storage(). -
No
set_interval,setTimeout,gloo_timers. -
No
std::fs,std::process,tokio::spawninside components. -
No
lazy_static!,OnceCell,Lazy-style globals.
Props / API surface
-
Every visual state has a named prop (
selected,open,disabled,loading, etc.) — not a derived internal bool. -
Optional callbacks are typed
Option<Callback<T>>with#[prop(optional)]. None is the SSR-stable default. -
Long view-model structs decompose at the top of the component
so the
view!body reads as flat HTML. -
No
Option<Option<T>>from accidentally wrappingOption<Children>inSome(...).
Story coverage
-
Every new variant has at least one story in
ui_storybook::stories::all_stories(). - Stories sweep at minimum: default + active/open + disabled + empty/overflow.
- Story id is kebab-case and matches the asset HTML filename.
-
If the new component takes a
Childrenslot, at least one story exercises it.
mdBook chapter
-
New chapter under
_docs/book/src/ui/chunks/<id>.md. - Iframe embed of the default story near the top.
- States table.
- API code block.
-
At least one
admonish importantfor the non-obvious rule. - Mermaid (no ASCII) if a diagram is needed.
-
Listed in
_docs/book/src/SUMMARY.md.
Gate
-
just snapshots-uire-exports the HTML assets. -
just gateis green (fmt + check + clippy + nextest + doctest + docs + snapshots-check + mermaid-check). -
PROGRESS.mdhas a new entry with files / tests / verified lines.
Wisp / canvas region only
-
Component declares a
CanvasBackendView-style enum. - CSS fallback renders without any browser API.
-
If a Wisp asset is referenced, the PNG is committed under
_docs/book/src/assets/ui/. -
No direct
wgpuimport in the component.
Common foot-guns
-
Show when=…closure is'static— captures a bool, not a borrowedString. -
No
Some(ToChildren::to_children(...))— pass bare for optional slots. -
Component file under 100 lines per fn (clippy
too_many_lines); split the view into helpers. -
Pre-existing rustdoc intra-doc links don't reference
ComponentName::method— Leptos components are fns, not types.