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
public enum PlanStatusStatus of a Plan (or one of its steps / substeps).
- Namespace
- Tesserae
public sealed class PlanModelPlain 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
| Name | Description |
|---|---|
| Searches | Optional short count shown on the right of the footer strip (e.g. "117 searches"). |
public sealed class PlanStepModelPlain data-model for a single step inside a PlanModel.
- Namespace
- Tesserae
public sealed class PlanSubstepModelPlain data-model for a substep inside a PlanStepModel.
- Namespace
- Tesserae
internal static class PlanVisualsInternal helpers shared across the Plan component: status → css class / icon / display text, progress clamping, summary derivation and step-key derivation.
- Namespace
- Tesserae
Methods
| Name | Description |
|---|---|
| StatusClass | Plan-level status class applied to the card root and used to drive the --plan-accent custom properties (e.g. tss-plan-running). |
| StepStatusClass | Step/substep status class (e.g. is-running) that drives the timeline rail segment color, icon color and active-panel styling. |
| CreateStatusIcon | Creates the status-glyph element (a UIcons <i>) for status. |
| SetStatusIcon | 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. |
| RemoveStepStatusClasses | Removes every is-* status class from an element. |
| ClearChildren | Removes all child nodes from an element. |
| FormatTimestamp | Formats a timestamp as MM/dd/yyyy HH:mm:ss (local time). |
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).
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.
public static HTMLElement CreateStatusIcon(PlanStatus status)Creates the status-glyph element (a UIcons <i>) for status.
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.
public static void RemoveStepStatusClasses(HTMLElement el)Removes every is-* status class from an element.
public static void ClearChildren(HTMLElement el)Removes all child nodes from an element.
public sealed class Plan : IComponent, IHasMarginPaddingA 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
| Name | Description |
|---|---|
| Plan | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| Model | Gets the last PlanModel passed to SetModel, or null if the component has only been driven by the fluent API. |
| Margin | Gets or sets the CSS margin of the component. |
| Padding | Gets or sets the CSS padding of the component. |
public PlanModel ModelGets the last PlanModel passed to SetModel, or null if the component has only been driven by the fluent API.
public string Margin { get ; set ; }Gets or sets the CSS margin of the component.
Methods
| Name | Description |
|---|---|
| Render | Renders the component's root HTML element. |
| Title | Gets or sets the title of the component. |
| HeaderCommands | Sets the components shown in the header command area. |
| FooterMessage | Sets a message shown in the footer; it is rendered as a bold prefix in front of the auto-derived progress summary. |
| FooterCommands | Sets the components shown on the right of the footer strip (the "count" slot, e.g. a "117 searches" label). |
| Progress | Configures the component to progress. |
| Indeterminate | Configures the component to indeterminate. |
| StartStopButton | Adds a start / stop toggle button wired up via the supplied callback. |
| HideStartStopButton | Hides the start stop button. |
| ShowStartStopButton | Shows the start stop button. |
| Start | Starts the component's operation. |
| Stop | Stops the component's operation. |
| AddTask | 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. |
| SetModel | 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. |
public Plan HeaderCommands(params IComponent[] commands)Sets the components shown in the header command area.
| Overload | |
|---|---|
| Progress(int, int) | Configures the component to progress. |
| Progress(float) | Configures the component to progress (0..100). |
public Plan StartStopButton(Action<Button> onStartStop)Adds a start / stop toggle button wired up via the supplied callback.
| 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
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.