artifact_detail

Single-artifact detail view composing metadata fields and a markdown body section.

const INDENT

source

const INDENT: &str = "  ";

Indentation prefix for detail rows.

const LABEL_PAD

source

const LABEL_PAD: usize = 9;

Fixed padding width for field labels.

struct Component

source

pub struct Component

Renders the full detail view for a single artifact, including metadata and optional body content.

Field Type Description
body Option<String> Markdown body, rendered between content and closing rules; None leaves the section out.
created Option<String> Created timestamp as display text; set only in tests, None hides the row.
id String Full artifact ID; the header shows its first 8 characters.
id_prefix_len usize Number of highlighted characters in the ID header; 2 by default.
notes Vec<NoteView> Notes listed under a notes rule, in the order they were added.
tags Vec<String> Tag labels for the tags row; the row is hidden when empty.
title String Artifact title for the title row.
updated Option<String> Updated timestamp as display text; set only in tests, None hides the row.

Implements Display.

Component::new

source

pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self

Create a detail view for the artifact with the given id and title.

Parameter Type Description
id impl Into<String> the full artifact ID
title impl Into<String> the artifact title
returns Self The view, with no body, tags or notes and a 2-character ID prefix.

Component::archived

source

pub fn archived(self) -> Self

Marks this artifact as archived (currently unused in detail rendering but kept for API compat).

Parameter Type Description
returns Self The view unchanged.

Component::body

source

pub fn body(self, body: impl Into<String>) -> Self

Sets optional markdown body content to render below the metadata fields.

Parameter Type Description
body impl Into<String> the markdown source
returns Self The view with the body set.

Component::id_prefix_len

source

pub fn id_prefix_len(self, len: usize) -> Self

Sets the number of highlighted prefix characters in the artifact ID.

Parameter Type Description
len usize the prefix length
returns Self The view with the new prefix length.

Component::note

source

pub fn note(self, id: impl Into<String>, body: impl Into<String>) -> Self

Adds a note to the detail view.

Parameter Type Description
id impl Into<String> the full note ID
body impl Into<String> the note text
returns Self The view with the note appended.

Component::tags

source

pub fn tags(self, tags: Vec<String>) -> Self

Sets the tags displayed beneath the title.

Parameter Type Description
tags Vec<String> the tag labels, without the #
returns Self The view with the tags replaced.

struct NoteView

source

struct NoteView

A note attached to the artifact, as the detail view shows it.

Field Type Description
body String Note text, shown as one plain value with no markdown rendering.
id String Full note ID; its first 8 characters are shown.