fix(task-panel): improve task states hierarchy and empty state#545
fix(task-panel): improve task states hierarchy and empty state#545StanGirard wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR is a purely visual redesign of the Key changes:
The three new visible states — badge labels, progress percentage, and the new empty-state secondary text — have no corresponding test cases in Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
T[Task status] --> P{status?}
P -->|"in_progress"| R["🟦 Running badge\nbg-cc-primary/5 border\nSpinning icon\nactiveForm text shown"]
P -->|"completed"| D["🟩 Done badge\nopacity-70 bg-cc-hover/20\nCheckmark icon\nline-through subject"]
P -->|"pending / other"| Q["⬜ Queued badge\nbg-cc-bg border-cc-border/70\nEmpty circle icon"]
TL[TasksSection] --> NE{tasks.length?}
NE -->|"= 0"| ES["Empty state\n🗂 icon + 'No tasks yet'\n+ guidance text"]
NE -->|"> 0"| PH["Header: completed/total count\nProgress bar: completionPct%\nTask rows list"]
Prompt To Fix All With AIThis is a comment left during a code review.
Path: web/src/components/TaskPanel.tsx
Line: 1119-1197
Comment:
**Missing tests for new visual states**
The PR introduces three new behaviors that are entirely untested:
1. **Status badges** — `"Running"`, `"Done"`, and `"Queued"` badge labels are added to every `TaskRow`. No test in `TaskPanel.test.tsx` asserts on these strings, so a regression (e.g., renaming a label or breaking the `statusMeta` ternary) would go undetected.
2. **Progress percentage** — `completionPct` is computed and rendered in the section header (e.g., `"33%"` for 1-of-3 completed). No test verifies the correct percentage is shown.
3. **New empty-state secondary text** — `"Planned work will appear here as it streams."` appears in the redesigned empty state, but the existing test at line 507 only checks `"No tasks yet"` and not this new string.
Per the **Frontend Testing** rule, behavior changes in `web/src/**/*.tsx` require matching test coverage. Suggested additions for `TaskPanel.test.tsx`:
```tsx
it("shows status badge labels for each task state", () => {
resetStore({
sessions: new Map([["s1", { backend_type: "claude" }]]),
sessionTasks: new Map([["s1", [
{ id: "t1", status: "pending", subject: "A" },
{ id: "t2", status: "in_progress", subject: "B" },
{ id: "t3", status: "completed", subject: "C" },
]]]),
});
render(<TaskPanel sessionId="s1" />);
expect(screen.getByText("Queued")).toBeInTheDocument();
expect(screen.getByText("Running")).toBeInTheDocument();
expect(screen.getByText("Done")).toBeInTheDocument();
});
it("shows completion percentage in progress bar header", () => {
resetStore({
sessions: new Map([["s1", { backend_type: "claude" }]]),
sessionTasks: new Map([["s1", [
{ id: "t1", status: "completed", subject: "Done" },
{ id: "t2", status: "pending", subject: "Todo" },
{ id: "t3", status: "pending", subject: "Also todo" },
]]]),
});
render(<TaskPanel sessionId="s1" />);
expect(screen.getByText("33%")).toBeInTheDocument();
});
it("shows secondary guidance text in empty state", () => {
resetStore({
sessions: new Map([["s1", { backend_type: "claude" }]]),
sessionTasks: new Map(),
});
render(<TaskPanel sessionId="s1" />);
expect(screen.getByText("Planned work will appear here as it streams.")).toBeInTheDocument();
});
```
**Rule Used:** CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=666e8656-df2f-4480-b76a-67f089c8461a))
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: e8f1684 |
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="web/src/components/Playground.tsx">
<violation number="1" location="web/src/components/Playground.tsx:1305">
P3: The progress percentage/bar is hardcoded to 50%, which can disagree with the task data shown in the same mock panel.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| <span className="text-cc-muted uppercase tracking-wider"> | ||
| Progress | ||
| </span> | ||
| <span className="text-cc-fg tabular-nums font-medium"> |
There was a problem hiding this comment.
P3: The progress percentage/bar is hardcoded to 50%, which can disagree with the task data shown in the same mock panel.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At web/src/components/Playground.tsx, line 1305:
<comment>The progress percentage/bar is hardcoded to 50%, which can disagree with the task data shown in the same mock panel.</comment>
<file context>
@@ -1288,16 +1288,34 @@ export function Playground() {
+ <span className="text-cc-muted uppercase tracking-wider">
+ Progress
+ </span>
+ <span className="text-cc-fg tabular-nums font-medium">
+ 50%
+ </span>
</file context>
Summary
Why
Testing
Review provenance