NAME
Developer::Dashboard::Prompt - prompt rendering for Developer Dashboard
SYNOPSIS
my $prompt = Developer::Dashboard::Prompt->new(
paths => $paths,
indicators => $indicators,
);
print $prompt->render(jobs => 1);
DESCRIPTION
This module renders the shell prompt from cached indicator state, current directory context, and git metadata. It is designed to stay fast enough for per-prompt execution.
METHODS
new
Construct a prompt renderer.
render
Return the full prompt string.
PURPOSE
This module renders the dashboard prompt fragment. It reads indicators, collector status, current cwd, job counts, and ticket context, then turns that state into the compact or extended prompt text used by shell bootstraps and prompt refresh commands.
WHY IT EXISTS
It exists because prompt rendering is a product feature with its own ordering and icon rules. Putting that logic in one module keeps bash, zsh, POSIX sh, and PowerShell prompt behavior aligned.
WHEN TO USE
Use this file when changing prompt shape, indicator ordering, icon/status rendering, compact versus extended prompt output, or the prompt command arguments exposed through dashboard ps1.
HOW TO USE
Construct it with the active paths and state stores, then call the prompt-rendering method that matches the requested mode. Shell helper scripts should consume the rendered string rather than rebuilding prompt logic in shell code.
WHAT USES IT
It is used by the dashboard ps1 helper, by generated shell bootstrap functions, by integration smoke runs that verify prompt text, and by prompt-focused regression tests.
EXAMPLES
Example 1:
perl -Ilib -MDeveloper::Dashboard::Prompt -e 1
Do a direct compile-and-load check against the module from a source checkout.
Example 2:
prove -lv t/02-indicator-collector.t
Run the focused regression tests that most directly exercise this module's behavior.
Example 3:
HARNESS_PERL_SWITCHES=-MDevel::Cover prove -lr t
Recheck the module under the repository coverage gate rather than relying on a load-only probe.
Example 4:
prove -lr t
Put any module-level change back through the entire repository suite before release.