1# llimphi-widget-rag-sidebar
2
3The **reusable chrome** of a dockable sidebar (the "rag sidebar"): the bar with a
4**hierarchical search box** + a **mutable control**, the uniform panel
5**header**, and the layout **multiswitch popover**.
6
7Render-only and `Msg`-agnostic. The widget does NOT know the domain: the host
8(pata, wawa-panel, any app) supplies
9
10- the rail's **teeth** (through `llimphi_widget_dock_rail`, separately),
11- the **body** of the open panel (a `View<Msg>` already painted by the host),
12- the multiswitch **groups** (each a `segmented` with its callback),
13
14and the widget paints the uniform chrome around them. That way **one single
15owner** paints the header/search/control across every app, instead of each one
16re-deriving it.
17
18(Not to be confused with `pata-llimphi/src/rag.rs`, which is a concrete *tooth* —
19asking your mail through RAG. Here "rag" is the sidebar's name.)
20
21```ignore
22let body = my_panel(...); // the host paints the body
23let spec = RagSidebarSpec {
24 title: "Files".into(), no_header: false, accessory: Some(toggle), body,
25 search: nav.search.clone(), search_focused: nav.focused, search_hits: hits,
26 on_search_focus: Arc::new(|f| Msg::SearchFocus(f)),
27 control_open: nav.control_open, t, on_control_toggle: Msg::ControlToggle,
28 groups: vec![RagSwitchGroup::new("Rail", &["Inside","Outside"], outside as usize,
29 move |i| Msg::SetOutside(i==1))],
30};
31rag_drawer_view(spec, w, h, &RagSidebarPalette::from_theme(&theme))
32```
33
34---
35
36Part of **llimphi** — see [llimphi](../../README.md).
README.md
llimphi-widget-rag-sidebar
The reusable chrome of a dockable sidebar (the "rag sidebar"): the bar with a
hierarchical search box + a mutable control, the uniform panel
header, and the layout multiswitch popover.
Render-only and Msg-agnostic. The widget does NOT know the domain: the host
(pata, wawa-panel, any app) supplies
- the rail's teeth (through
llimphi_widget_dock_rail, separately),
- the body of the open panel (a
View<Msg> already painted by the host),
- the multiswitch groups (each a
segmented with its callback),
and the widget paints the uniform chrome around them. That way one single
owner paints the header/search/control across every app, instead of each one
re-deriving it.
(Not to be confused with pata-llimphi/src/rag.rs, which is a concrete tooth —
asking your mail through RAG. Here "rag" is the sidebar's name.)
let body = my_panel(...); // the host paints the body
let spec = RagSidebarSpec {
title: "Files".into(), no_header: false, accessory: Some(toggle), body,
search: nav.search.clone(), search_focused: nav.focused, search_hits: hits,
on_search_focus: Arc::new(|f| Msg::SearchFocus(f)),
control_open: nav.control_open, t, on_control_toggle: Msg::ControlToggle,
groups: vec![RagSwitchGroup::new("Rail", &["Inside","Outside"], outside as usize,
move |i| Msg::SetOutside(i==1))],
};
rag_drawer_view(spec, w, h, &RagSidebarPalette::from_theme(&theme))
Part of llimphi — see llimphi.