Skip to main content

ListPanelSpec

Trait ListPanelSpec 

Source
pub trait ListPanelSpec {
    type Row: SearchRow + Clone + Send + Sync + 'static;

    const TITLE: &'static str;
    const HAS_FILTER: bool = true;
    const BORDERED_INPUT: bool = false;
    const LOCAL_FILTER: bool = true;

    // Required methods
    fn submit(row: &Self::Row, tx: &AppTx);
    fn hints() -> Vec<(String, String)>;

    // Provided method
    fn context_event(_row: &Self::Row) -> Option<AppEvent> { ... }
}
Expand description

What varies between list-shaped drawer views. The panel is the depth; each view is a thin adapter of this seam.

Required Associated Constants§

Source

const TITLE: &'static str

Panel-block title.

Provided Associated Constants§

Source

const HAS_FILTER: bool = true

Whether the top row is a typed filter input (true: every key goes to the list engine; false: only navigation keys reach the list — plain letters stay free for the host, e.g. LINKS’ b/o/u).

Source

const BORDERED_INPUT: bool = false

When true, the filter is drawn as a bordered search box (like the note finder) with a right-aligned result/loading status, and the results area shows a dimmed “Searching…/No results” message. Suits server-backed views (semantic search) where the query round-trips over the network and the input deserves visual separation from the results. Default false: a bare one-row filter for the compact local drawer views (TAGS/LINKS/ OUTLINE), whose behavior is unchanged.

Source

const LOCAL_FILTER: bool = true

Whether the typed query ALSO fuzzy-filters the loaded rows locally (true, default). Set false for server-backed sources whose load already applies the query (semantic search): the server returns ranked, conceptually-relevant notes that rarely contain the query words verbatim, so a local fuzzy pass over their titles would wrongly discard nearly all of them. false keeps the input (it drives the server reload) but shows every returned row in server rank order.

Required Associated Types§

Source

type Row: SearchRow + Clone + Send + Sync + 'static

Required Methods§

Source

fn submit(row: &Self::Row, tx: &AppTx)

What Enter / click-activate does with the selected row.

Source

fn hints() -> Vec<(String, String)>

Provided Methods§

Source

fn context_event(_row: &Self::Row) -> Option<AppEvent>

The event a right-click on a row fires (rows that are real notes open the file-ops menu). None = right-click selects only.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ListPanelSpec for LinksSpec

Source§

const TITLE: &'static str = "Links"

Source§

const HAS_FILTER: bool = false

Source§

type Row = LinkEntry

Source§

impl ListPanelSpec for OutlineSpec

Source§

const TITLE: &'static str = "Outline"

Source§

type Row = OutlineEntry

Source§

impl ListPanelSpec for SemanticSpec

Source§

const TITLE: &'static str = "Semantic"

Source§

const HAS_FILTER: bool = true

Source§

const BORDERED_INPUT: bool = true

Source§

const LOCAL_FILTER: bool = false

Source§

type Row = FileListEntry

Source§

impl ListPanelSpec for TagsSpec

Source§

const TITLE: &'static str = "Tags"

Source§

type Row = TagEntry