-
Notifications
You must be signed in to change notification settings - Fork 0
feat(frontend): chat UI phase 4 — todo block & approval card styling #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tendtoyj
merged 4 commits into
main
from
tendtoyj/plu-327-chat-ui-phase4-todoblock-hitlcard-utilitybuttons
Feb 10, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
73f8e89
feat(frontend): migrate write_todos to step-row todo block
tendtoyj db82421
feat(frontend): style approval card with prototype motion
tendtoyj b56cc68
chore(frontend): document utility actions animation baseline
tendtoyj 59b89a1
fix(frontend): tighten tool renderer typing and todo parser model
tendtoyj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
frontend/pluto_duck_frontend/components/ai-elements/todo-checkbox.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| "use client"; | ||
|
|
||
| import { cn } from "@/lib/utils"; | ||
| import { memo, type ComponentProps } from "react"; | ||
| import { | ||
| getTodoCheckboxContainerClass, | ||
| IN_PROGRESS_TODO_GLYPH, | ||
| type TodoCheckboxStatus, | ||
| } from "./todoCheckboxModel"; | ||
|
|
||
| export type TodoCheckboxProps = ComponentProps<"span"> & { | ||
| status?: TodoCheckboxStatus; | ||
| }; | ||
|
|
||
| export const TodoCheckbox = memo( | ||
| ({ status = "pending", className, ...props }: TodoCheckboxProps) => ( | ||
| <span | ||
| aria-hidden | ||
| className={cn( | ||
| "inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-[3px] transition-all duration-300", | ||
| getTodoCheckboxContainerClass(status), | ||
| className | ||
| )} | ||
| {...props} | ||
| > | ||
| {status === "in_progress" ? ( | ||
| <span className="text-[9px] leading-none text-muted-foreground"> | ||
| {IN_PROGRESS_TODO_GLYPH} | ||
| </span> | ||
| ) : null} | ||
| {status === "completed" ? ( | ||
| <svg | ||
| className="h-2.5 w-2.5" | ||
| fill="none" | ||
| viewBox="0 0 10 10" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path | ||
| d="M2 5.4L4.1 7.4L8 3.2" | ||
| stroke="currentColor" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| strokeWidth="1.6" | ||
| /> | ||
| </svg> | ||
| ) : null} | ||
| </span> | ||
| ) | ||
| ); | ||
|
|
||
| TodoCheckbox.displayName = "TodoCheckbox"; |
15 changes: 15 additions & 0 deletions
15
frontend/pluto_duck_frontend/components/ai-elements/todoCheckboxModel.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| export type TodoCheckboxStatus = "pending" | "in_progress" | "completed"; | ||
|
|
||
| export const IN_PROGRESS_TODO_GLYPH = "\u2734\uFE0E"; | ||
|
|
||
| export function getTodoCheckboxContainerClass( | ||
| status: TodoCheckboxStatus | ||
| ): string { | ||
| if (status === "completed") { | ||
| return "border-0 bg-muted-foreground/60 text-white"; | ||
| } | ||
| if (status === "in_progress") { | ||
| return "border-[1.5px] border-muted-foreground/50 bg-transparent"; | ||
| } | ||
| return "border-[1.5px] border-muted-foreground/30 bg-transparent"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
frontend/pluto_duck_frontend/components/chat/renderers/__tests__/todoCheckboxModel.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import assert from 'node:assert/strict'; | ||
| import test from 'node:test'; | ||
|
|
||
| import { | ||
| getTodoCheckboxContainerClass, | ||
| IN_PROGRESS_TODO_GLYPH, | ||
| } from '../../../ai-elements/todoCheckboxModel.ts'; | ||
|
|
||
| test('completed todo checkbox has no border class', () => { | ||
| const cls = getTodoCheckboxContainerClass('completed'); | ||
| assert.equal(cls.includes('border-0'), true); | ||
| assert.equal(cls.includes('border-[1.5px]'), false); | ||
| }); | ||
|
|
||
| test('in-progress todo checkbox uses border + eight pointed black star', () => { | ||
| const cls = getTodoCheckboxContainerClass('in_progress'); | ||
| assert.equal(cls.includes('border-[1.5px]'), true); | ||
| assert.equal(IN_PROGRESS_TODO_GLYPH, '✴︎'); | ||
| }); |
30 changes: 30 additions & 0 deletions
30
frontend/pluto_duck_frontend/components/chat/renderers/__tests__/toolTodoViewModel.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import assert from 'node:assert/strict'; | ||
| import test from 'node:test'; | ||
|
|
||
| import { | ||
| getToolTodoStepPhase, | ||
| getToolTodoTextClass, | ||
| shouldShowToolTodoChevron, | ||
| } from '../toolTodoViewModel.ts'; | ||
|
|
||
| test('maps tool todo state to step dot phase', () => { | ||
| assert.equal(getToolTodoStepPhase('pending'), 'running'); | ||
| assert.equal(getToolTodoStepPhase('completed'), 'complete'); | ||
| assert.equal(getToolTodoStepPhase('error'), 'error'); | ||
| }); | ||
|
|
||
| test('shows chevron only when tool todo state is completed', () => { | ||
| assert.equal(shouldShowToolTodoChevron('pending'), false); | ||
| assert.equal(shouldShowToolTodoChevron('completed'), true); | ||
| assert.equal(shouldShowToolTodoChevron('error'), false); | ||
| }); | ||
|
|
||
| test('returns text classes by todo item status', () => { | ||
| assert.equal(getToolTodoTextClass('pending'), 'text-muted-foreground'); | ||
| assert.equal(getToolTodoTextClass('in_progress'), 'text-foreground'); | ||
| assert.equal( | ||
| getToolTodoTextClass('completed'), | ||
| 'text-muted-foreground line-through' | ||
| ); | ||
| assert.equal(getToolTodoTextClass(undefined), 'text-muted-foreground'); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The migrated
write_todosview renders todos inside a plain<div>without anymax-height/scroll container, so large todo batches (or very long titles) now expand the tool row indefinitely and can push the rest of the chat off-screen; this is a regression from the previousQueueListbehavior that constrained height. Because this branch also disables collapsing while pending, users cannot mitigate oversized pending updates.Useful? React with 👍 / 👎.