Skip to content

feat(pi): add configuration options for todo widget - #1369

Open
autt-carrum wants to merge 2 commits into
backnotprop:mainfrom
autt-carrum:main
Open

feat(pi): add configuration options for todo widget#1369
autt-carrum wants to merge 2 commits into
backnotprop:mainfrom
autt-carrum:main

Conversation

@autt-carrum

Copy link
Copy Markdown

Configurable Pi progress widget

The Pi extension's plannotator-progress widget renders one line per checklist item during plan execution. Long plans crowd the terminal, and there's no way to shrink it today. This PR adds two config-only keys in ~/.plannotator/config.json that reshape the widget without touching the underlying checklist.

New settings

  • widgetStyle"default" (unchanged behavior) · "compact" (single 📋 done/total · next: <step> line, or · all done) · positive integer N (cap the widget at N item lines, preferring remaining steps and backfilling with the most recent completed ones, with a muted overflow line summarizing what was dropped: … +K more todo, … +K done, or … +K done, +M todo).
  • widgetMoveCompletedToEnd — boolean, default false. When true, the widget renders completed items after remaining ones.

Both keys are config-file only — no PLANNOTATOR_WIDGET_* env override. Invalid widgetStyle values (zero, negatives, non-integer numbers, unknown strings) silently fall back to "default" so a hand-edited config never blanks the widget.

Widget-only

The status label, the phase-entry ${todoList} template, the injected per-turn todo-status message, and the pi-todos mirror all keep reading the raw checklist in its original order. widgetMoveCompletedToEnd has no visible effect under widgetStyle: "compact" (nothing to reorder).

Changes

File Change
packages/shared/config.ts Add widgetStyle / widgetMoveCompletedToEnd to PlannotatorConfig; add resolveWidgetStyle() returning a WidgetStyle tagged union (default / compact / limit) and resolveWidgetMoveCompletedToEnd()
apps/pi-extension/index.ts Rewrite updateWidget to dispatch on style, partition and slice items for the limit path, emit the overflow line
packages/shared/config.test.ts Resolver tests: defaults, valid values, invalid fallbacks for both keys
apps/pi-extension/README.md New "Configuring the progress widget" section with JSON examples per mode
AGENTS.md Documented under Config-only settings

Test plan

  • bun test packages/shared/config.test.ts — 86 pass, 0 fail.
  • Manual: verified the compact single-line render (📋 20/20 · all done at completion) with a 20-step smoke plan.
  • Manual: verified the limit path (widgetStyle: 4, widgetMoveCompletedToEnd: true) with a 12-step plan — widget capped at 4 lines with backfilled completed items rendered below remaining ones and … +K done, +M more todo overflow.
  • Regression: with both keys omitted, widget renders exactly as today.

Backwards compatibility

Fully backwards compatible. Both keys are optional; unset config behaves identically to today.

Adds two config-only keys in ~/.plannotator/config.json that reshape
the Pi extension's plannotator-progress widget without touching the
underlying checklist:

- widgetStyle: 'default' | 'compact' | positive integer N
  * 'default' keeps the current one-line-per-item rendering.
  * 'compact' collapses the widget to a single status line
    (📋 done/total · next: <first remaining step>, or · all done).
  * A positive integer N caps the widget at N item lines, preferring
    remaining steps and backfilling with the most recent completed
    ones so the widget stays populated. Dropped items are summarized
    on a muted overflow line (… +K more todo / +K done, +M todo).
  * Invalid values (0, negatives, non-integer numbers, unknown
    strings) silently fall back to 'default' so a bad config never
    blanks the widget.

- widgetMoveCompletedToEnd: boolean (default false)
  * When true, the widget renders completed items after remaining
    ones. The underlying checklist order is unchanged, so \${todoList},
    [DONE:n] markers, the injected per-turn todo-status message, and
    the pi-todos mirror all still see the original order.
  * Has no visible effect under widgetStyle: 'compact'.

Both keys are config-file only — no PLANNOTATOR_WIDGET_* env override.
Adds resolver unit tests in packages/shared/config.test.ts covering
defaults, valid values, and invalid-value fallbacks for both keys.
Documents the pair in AGENTS.md and in apps/pi-extension/README.md
with JSON examples per style value.
feat(pi): configurable progress widget style and ordering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant