Skip to content
This repository was archived by the owner on Sep 4, 2026. It is now read-only.

feat(sidebar): make the work card's brief the plan's active step - #393

Merged
ElbertePlinio merged 1 commit into
mainfrom
feat-361-plan-brief
Jul 26, 2026
Merged

feat(sidebar): make the work card's brief the plan's active step#393
ElbertePlinio merged 1 commit into
mainfrom
feat-361-plan-brief

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

#361 PR 2 — the issue's primary gap.

The renderer existed and cardBrief was wired to it, but taskBriefText has no writer outside fixtures. workspace.ts always creates chats with taskBriefText: null; the only non-null values are VRT mocks. So the middle of every real card — the part that says what the agent is doing — was empty, and the card collapsed to mark · project · time / title · WORKING / $1.88.

The brief is the plan's active step

Per the decision recorded on the issue. This needs no new plumbing: PlanItemStatus already carries inProgress, and latestPlanForChat is the same accessor cardPlanProgress already reads for plan M/N.

That is the point. The card says step 2 of 5 in its footer and what step 2 is on this line, from one source — they cannot drift apart. taskBriefText becomes the fallback slot rather than the only source, lighting up when #210's one-liner producer lands.

Verified in the rendered app

{ title: "Sidebar waiting state", brief: "Wire the swarm survey lanes into the footer", plan: "plan 2/5" }
{ title: "PR monitoring agent flow", brief: "Wants to run: gh pr checks --watch",        plan: null      }

The card with a plan shows its actual in-progress step next to the matching tally; the card without one falls through to its one-liner. Not just asserted — read off the running app.

Sub-decisions resolved

  • Truncation → capped in the store at 120 chars, newlines flattened. The line is single-line-ellipsis in CSS anyway, so anything past that is invisible; a persisted value has no reason to be longer than what can ever be read.
  • Precedence → plan step beats a cached one-liner, made explicit in the resolver so it cannot drift.
  • All-complete plan (M === N, no inProgress) → falls through to the one-liner, then to nothing. Showing the last completed step would claim work that is already finished.

An inProgress step with only whitespace is ignored rather than rendered as a blank line, matching the locked no-placeholder rule.

Tests

8 new, verified load-bearing (removing the plan-step path fails 3):

  • in-progress step wins; beats a cached one-liner; all-complete falls through; finished-with-no-fallback shows nothing; no plan at all falls through; whitespace-only step ignored; long step flattened and capped; still works with no plan accessor.

Validation

  • bun run test:unit1619 passed
  • bunx tsc --noEmit clean; bun run lint clean
  • Rendered check above, on an isolated port

Remaining on #361

PR 3 — the model-written one-liner producer — is not here. The issue says to sequence it with #210 so one producer serves both, and building a second one here would be exactly the duplication that decision exists to prevent. The fallback slot is in place and tested for when it lands.

Refs #361

wired to it, but `taskBriefText` has no writer outside fixtures, so the middle
of every real card — the part that says what the agent is doing — was empty.

The brief is now the plan's `inProgress` step, per the decision recorded on the
issue. That needs no new plumbing: `PlanItemStatus` already carries `inProgress`
and `latestPlanForChat` is the same accessor `cardPlanProgress` already reads
for `plan M/N`. So the card says *step 2 of 5* in its footer and *what step 2
is* on this line, from one source — they cannot drift.

`taskBriefText` becomes the fallback rather than the only source, lighting up
when #210's one-liner producer lands.

Resolved sub-decisions:
- **Truncation**: capped in the store at 120 chars, and newlines flattened. The
  line is single-line-ellipsis in CSS anyway, so anything past that is
  invisible — a persisted value has no reason to be longer than what can be
  read.
- **Precedence**: plan step wins over a cached one-liner, made explicit in the
  resolver so it cannot drift.
- **All-complete plan** (M === N, no `inProgress`): falls through to the
  one-liner, then to nothing. Showing the last completed step would claim work
  that is finished.

An `inProgress` step with only whitespace is ignored rather than rendered as a
blank line, matching the locked no-placeholder rule.

Verified in the rendered app: the fixture card showing `plan 2/5` now reads
"Wire the swarm survey lanes into the footer", and the card with no plan still
falls through to its one-liner.

Refs #361
@ElbertePlinio
ElbertePlinio merged commit 93db4b7 into main Jul 26, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant