From 37e7366b53b3d46edf3bc91296c5ed4e36024df8 Mon Sep 17 00:00:00 2001 From: Continue Agent Date: Wed, 17 Sep 2025 01:44:25 +0000 Subject: [PATCH 1/2] Highlight first incomplete item in CLI checklist display - Added visual highlighting (cyan color and bold text) for the first incomplete checkbox item - This helps users quickly identify what task is currently in progress - Added comprehensive test coverage for the ChecklistDisplay component Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- .../ui/components/ChecklistDisplay.test.tsx | 63 +++++++++++++++++++ .../src/ui/components/ChecklistDisplay.tsx | 15 ++++- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 extensions/cli/src/ui/components/ChecklistDisplay.test.tsx diff --git a/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx b/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx new file mode 100644 index 000000000..fe7ddf4a0 --- /dev/null +++ b/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx @@ -0,0 +1,63 @@ +import { render } from "ink-testing-library"; +import React from "react"; + +import { ChecklistDisplay } from "./ChecklistDisplay.js"; + +describe("ChecklistDisplay", () => { + it("should highlight the first incomplete item", () => { + const content = `Task list status: +- [x] Completed task +- [ ] First incomplete task +- [ ] Second incomplete task`; + + const { lastFrame } = render(); + const output = lastFrame(); + + // The output should contain the checkbox symbols and text + expect(output).toContain("✓"); + expect(output).toContain("○"); + expect(output).toContain("Completed task"); + expect(output).toContain("First incomplete task"); + expect(output).toContain("Second incomplete task"); + }); + + it("should handle empty checklist", () => { + const content = "Task list status:"; + + const { lastFrame } = render(); + const output = lastFrame(); + + expect(output).toBeDefined(); + }); + + it("should handle all completed tasks", () => { + const content = `Task list status: +- [x] Completed task 1 +- [x] Completed task 2`; + + const { lastFrame } = render(); + const output = lastFrame(); + + expect(output).toContain("✓"); + expect(output).toContain("Completed task 1"); + expect(output).toContain("Completed task 2"); + }); + + it("should handle mixed content with headers", () => { + const content = `Task list status: +## Important Tasks +- [x] Done task +- [ ] Todo task + +## Other Tasks +- [ ] Another todo`; + + const { lastFrame } = render(); + const output = lastFrame(); + + expect(output).toContain("Important Tasks"); + expect(output).toContain("Other Tasks"); + expect(output).toContain("✓"); + expect(output).toContain("○"); + }); +}); \ No newline at end of file diff --git a/extensions/cli/src/ui/components/ChecklistDisplay.tsx b/extensions/cli/src/ui/components/ChecklistDisplay.tsx index 926a4193f..4e823397d 100644 --- a/extensions/cli/src/ui/components/ChecklistDisplay.tsx +++ b/extensions/cli/src/ui/components/ChecklistDisplay.tsx @@ -13,6 +13,17 @@ export const ChecklistDisplay: React.FC = ({ }) => { const lines = content.split("\n"); + // Find the index of the first incomplete checkbox item + let firstIncompleteIndex = -1; + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + const checkboxMatch = line.match(/^(\s*)-\s*\[([ x])\]\s*(.*)$/); + if (checkboxMatch && checkboxMatch[2] === " ") { + firstIncompleteIndex = i; + break; + } + } + return ( {lines.map((line, index) => { @@ -25,6 +36,7 @@ export const ChecklistDisplay: React.FC = ({ if (checkboxMatch) { const [, indent, status, taskText] = checkboxMatch; const isCompleted = status === "x"; + const isFirstIncomplete = index === firstIncompleteIndex; return ( @@ -34,8 +46,9 @@ export const ChecklistDisplay: React.FC = ({ {taskText} From 87396a4a6ca0e6e51b6ffda28e9bae4bd8303ec9 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 23 Sep 2025 17:49:00 -0700 Subject: [PATCH 2/2] fix: prettier --- extensions/cli/src/ui/components/ChecklistDisplay.test.tsx | 2 +- extensions/cli/src/ui/components/ChecklistDisplay.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx b/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx index fe7ddf4a0..dbbe0245c 100644 --- a/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx +++ b/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx @@ -60,4 +60,4 @@ describe("ChecklistDisplay", () => { expect(output).toContain("✓"); expect(output).toContain("○"); }); -}); \ No newline at end of file +}); diff --git a/extensions/cli/src/ui/components/ChecklistDisplay.tsx b/extensions/cli/src/ui/components/ChecklistDisplay.tsx index 4e823397d..458e3a7cb 100644 --- a/extensions/cli/src/ui/components/ChecklistDisplay.tsx +++ b/extensions/cli/src/ui/components/ChecklistDisplay.tsx @@ -46,7 +46,9 @@ export const ChecklistDisplay: React.FC = ({