search_results

Grouped search results view rendering task, artifact, and iteration sections.

struct Component

source

pub struct Component

Complete search results view with grouped sections and summary.

Field Type Description
artifact_prefix_lens Vec<usize> Highlighted ID length for each artifact, index-aligned with artifacts.
artifacts Vec<artifact::Model> Matching artifacts, listed in the artifacts section.
expanded bool Whether each hit shows its description or body.
iteration_prefix_lens Vec<usize> Highlighted ID length for each iteration, index-aligned with iterations.
iterations Vec<iteration::Model> Matching iterations, listed in the iterations section.
query String Search text, echoed in the summary line.
task_prefix_lens Vec<usize> Highlighted ID length for each task, index-aligned with tasks.
tasks Vec<task::Model> Matching tasks, listed in the tasks section.

Implements Display.

Component::new

source

pub fn new(
    query: String,
    tasks: Vec<task::Model>,
    artifacts: Vec<artifact::Model>,
    iterations: Vec<iteration::Model>,
    task_prefix_lens: Vec<usize>,
    artifact_prefix_lens: Vec<usize>,
    iteration_prefix_lens: Vec<usize>,
) -> Self

Create a new search results view with per-ID prefix lengths.

Parameter Type Description
query String the search text, echoed in the summary
tasks Vec<task::Model> the matching tasks
artifacts Vec<artifact::Model> the matching artifacts
iterations Vec<iteration::Model> the matching iterations
task_prefix_lens Vec<usize> one prefix length per task; a task with no length is not shown, but still counted in the totals
artifact_prefix_lens Vec<usize> one prefix length per artifact; an artifact with no length is not shown, but still counted in the totals
iteration_prefix_lens Vec<usize> one prefix length per iteration; an iteration with no length is not shown, but still counted in the totals
returns Self A collapsed results view.

Component::expanded

source

pub fn expanded(self, expanded: bool) -> Self

Enable expanded mode to show full description/body per result.

Parameter Type Description
expanded bool whether each hit shows its description or body
returns Self The view with the mode set.

Component::total

source

fn total(&self) -> usize

Count the hits across the three sections.

Parameter Type Description
returns usize The number of tasks, artifacts and iterations together.