Plan

Description

A component to display a plan

The Plan component displays a complex task with its sub-tasks and overall progress.

Samples

Running plan with partial progress

Completed plan with stop button hidden

Plan with indeterminate progress

API reference

enum

PlanStatus

public enum PlanStatus

Status of a Plan (or one of its steps / substeps).

Namespace
Tesserae
class

PlanModel

public sealed class PlanModel

Plain data-model used by SetModel to drive the component from a streaming/server-side source. All fields are optional except Steps (which must not be null).

Namespace
Tesserae

Fields

NameDescription
SearchesOptional short count shown on the right of the footer strip (e.g. "117 searches").
Field
PlanModel.Searches
public string Searches

Optional short count shown on the right of the footer strip (e.g. "117 searches").

class

PlanStepModel

public sealed class PlanStepModel

Plain data-model for a single step inside a PlanModel.

Namespace
Tesserae
class

PlanSubstepModel

public sealed class PlanSubstepModel

Plain data-model for a substep inside a PlanStepModel.

Namespace
Tesserae
class

PlanVisuals

internal static class PlanVisuals

Internal helpers shared across the Plan component: status → css class / icon / display text, progress clamping, summary derivation and step-key derivation.

Namespace
Tesserae

Methods

NameDescription
StatusClassPlan-level status class applied to the card root and used to drive the --plan-accent custom properties (e.g. tss-plan-running).
StepStatusClassStep/substep status class (e.g. is-running) that drives the timeline rail segment color, icon color and active-panel styling.
CreateStatusIconCreates the status-glyph element (a UIcons <i>) for status.
SetStatusIconPoints an existing status-glyph element at the glyph for status. Only the icon class changes, so a running spinner's CSS animation is not restarted when unrelated fields update.
RemoveStepStatusClassesRemoves every is-* status class from an element.
ClearChildrenRemoves all child nodes from an element.
FormatTimestampFormats a timestamp as MM/dd/yyyy HH:mm:ss (local time).
Method
PlanVisuals.StatusClass
public static string StatusClass(PlanStatus status)

Plan-level status class applied to the card root and used to drive the --plan-accent custom properties (e.g. tss-plan-running).

Method
PlanVisuals.StepStatusClass
public static string StepStatusClass(PlanStatus status)

Step/substep status class (e.g. is-running) that drives the timeline rail segment color, icon color and active-panel styling.

Method
PlanVisuals.CreateStatusIcon
public static HTMLElement CreateStatusIcon(PlanStatus status)

Creates the status-glyph element (a UIcons <i>) for status.

Method
PlanVisuals.SetStatusIcon
public static void SetStatusIcon(HTMLElement iconEl, PlanStatus status)

Points an existing status-glyph element at the glyph for status. Only the icon class changes, so a running spinner's CSS animation is not restarted when unrelated fields update.

Method
PlanVisuals.RemoveStepStatusClasses
public static void RemoveStepStatusClasses(HTMLElement el)

Removes every is-* status class from an element.

Method
PlanVisuals.ClearChildren
public static void ClearChildren(HTMLElement el)

Removes all child nodes from an element.

Method
PlanVisuals.FormatTimestamp
public static string FormatTimestamp(DateTimeOffset value)

Formats a timestamp as MM/dd/yyyy HH:mm:ss (local time).

class

Plan

public sealed class Plan : IComponent, IHasMarginPadding

A timeline-style display for showing a multi-step plan, with optional per-step status / progress / substeps. Can be driven imperatively via the fluent AddTask API or declaratively via SetModel; SetModel performs an in-place reconcile keyed by step/substep Id so DOM nodes are reused.

Namespace
Tesserae
Implements
IComponent, IHasMarginPadding

Constructors

NameDescription
PlanInitializes a new instance of this class.
Constructor
Plan
public Plan(string title)

Initializes a new instance of this class.

Properties

NameDescription
ModelGets the last PlanModel passed to SetModel, or null if the component has only been driven by the fluent API.
MarginGets or sets the CSS margin of the component.
PaddingGets or sets the CSS padding of the component.
Property
Plan.Model
public PlanModel Model

Gets the last PlanModel passed to SetModel, or null if the component has only been driven by the fluent API.

Property
Plan.Margin
public string Margin { get ; set ; }

Gets or sets the CSS margin of the component.

Property
Plan.Padding
public string Padding { get ; set ; }

Gets or sets the CSS padding of the component.

Methods

NameDescription
RenderRenders the component's root HTML element.
TitleGets or sets the title of the component.
HeaderCommandsSets the components shown in the header command area.
FooterMessageSets a message shown in the footer; it is rendered as a bold prefix in front of the auto-derived progress summary.
FooterCommandsSets the components shown on the right of the footer strip (the "count" slot, e.g. a "117 searches" label).
ProgressConfigures the component to progress.
IndeterminateConfigures the component to indeterminate.
StartStopButtonAdds a start / stop toggle button wired up via the supplied callback.
HideStartStopButtonHides the start stop button.
ShowStartStopButtonShows the start stop button.
StartStarts the component's operation.
StopStops the component's operation.
AddTaskAdds the given task to the component. Note: completed tasks render with the unified "success" status color (green check) instead of the previous primary-tone treatment; this matches the generalized status styling shared with SetModel.
SetModelApplies the supplied PlanModel to the component, updating the DOM in place. Steps and substeps are matched by their Id (or a derived positional key when no id is provided) so existing DOM nodes are reused across calls — animations, focus and scroll position are preserved as long as the keys are stable.
Method
Plan.Render
public HTMLElement Render()

Renders the component's root HTML element.

Method
Plan.Title
public Plan Title(string title)

Gets or sets the title of the component.

Method
Plan.HeaderCommands
public Plan HeaderCommands(params IComponent[] commands)

Sets the components shown in the header command area.

Method
Plan.FooterMessage
public Plan FooterMessage(string message)

Sets a message shown in the footer; it is rendered as a bold prefix in front of the auto-derived progress summary.

Method
Plan.FooterCommands
public Plan FooterCommands(params IComponent[] commands)

Sets the components shown on the right of the footer strip (the "count" slot, e.g. a "117 searches" label).

Method
Plan.Progress
Overload
Progress(int, int)Configures the component to progress.
Progress(float)Configures the component to progress (0..100).
Progress(int, int)
public Plan Progress(int position, int total)

Configures the component to progress.

Parameters

position int
total int
Progress(float)
public Plan Progress(float percent)

Configures the component to progress (0..100).

Parameters

percent float
Method
Plan.Indeterminate
public Plan Indeterminate()

Configures the component to indeterminate.

Method
Plan.StartStopButton
public Plan StartStopButton(Action<Button> onStartStop)

Adds a start / stop toggle button wired up via the supplied callback.

Method
Plan.HideStartStopButton
public Plan HideStartStopButton()

Hides the start stop button.

Method
Plan.ShowStartStopButton
public Plan ShowStartStopButton()

Shows the start stop button.

Method
Plan.Start
public Plan Start()

Starts the component's operation.

Method
Plan.Stop
public Plan Stop()

Stops the component's operation.

Method
Plan.AddTask
Overload
AddTask(string, bool)Adds the given task to the component. Note: completed tasks render with the unified "success" status color (green check) instead of the previous primary-tone treatment; this matches the generalized status styling shared with SetModel.
AddTask(string, PlanStatus)Adds a task with an explicit PlanStatus. Auto-generates a positional key so a later SetModel call still reconciles correctly.
AddTask(string, bool)
public Plan AddTask(string title, bool completed)

Adds the given task to the component. Note: completed tasks render with the unified "success" status color (green check) instead of the previous primary-tone treatment; this matches the generalized status styling shared with SetModel.

Parameters

title string
completed bool
AddTask(string, PlanStatus)
public Plan AddTask(string title, PlanStatus status)

Adds a task with an explicit PlanStatus. Auto-generates a positional key so a later SetModel call still reconciles correctly.

Parameters

title string
status PlanStatus
Method
Plan.SetModel
public Plan SetModel(PlanModel model)

Applies the supplied PlanModel to the component, updating the DOM in place. Steps and substeps are matched by their Id (or a derived positional key when no id is provided) so existing DOM nodes are reused across calls — animations, focus and scroll position are preserved as long as the keys are stable.

See also

© 2026 Curiosity. All rights reserved.