Skip to content

feat(tasks): dock the agent's task list in a collapsible bar above the composer - #1432

Open
pedramamini wants to merge 1 commit into
rcfrom
feat/1431-todo-task-bar
Open

feat(tasks): dock the agent's task list in a collapsible bar above the composer#1432
pedramamini wants to merge 1 commit into
rcfrom
feat/1431-todo-task-bar

Conversation

@pedramamini

@pedramamini pedramamini commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Closes #1431

Targets rc.

What

Agent checklists (Claude Code / OpenCode TodoWrite, Codex update_plan) already render as an inline AgentTaskListCard in the transcript, but those cards scroll away as the conversation grows. "What is the agent working on, and how much is left" stops being answerable without scrolling back to hunt for the last update.

This pins the newest checklist for the active AI tab directly above the input box:

  • Collapsed to one line: the active task (using the agent's present-tense activeForm when it supplies one) plus a completed/total count and a progress bar.
  • Expands on click to the full list with per-task state, capped in height and scrollable so a 40-item plan can't eat the window.
  • Rewrites in place as the agent updates its plan.
  • Dismissable per checklist.

Two Display settings, both OFF by default

Setting Default Effect
showAgentTaskListBar off Renders the bar at all. The inline transcript cards are unaffected either way.
autoExpandAgentTaskListBar off Opens the bar to the full checklist every time the agent writes a new one, instead of the one-line summary. Disabled in the UI while the bar itself is off.

Both live under Settings -> Display -> Agent Task List, in a new AgentTaskListSection alongside rc's other extracted Display sections.

Expansion state has two modes on purpose, because the two settings want different things:

  • Auto-expand off: expanded/collapsed is a sticky preference (usePersistedToggle) that survives restart.
  • Auto-expand on: each new checklist opens; a manual collapse is keyed to that checklist's log entry, so the next update re-expands rather than the bar staying shut forever. No effect, no second copy of the state to re-sync.

How

The list is derived from the tab's own logs - a reverse scan (findLatestAgentTaskList) for the last checklist-shaped tool call. Agents rewrite the whole list on every update, so the last one is the current state; there is nothing to merge across entries.

That means no new capture path, no store slice, and no second copy of the state to drift from the transcript. It switches with the tab and survives app restart for free.

Detection reuses the existing shape-based extractAgentTaskList, so this stays agent-agnostic exactly like the inline card - any provider emitting a { content, status }-ish array gets it.

Notes on specific decisions

  • Subagent guard (rc-only): a checklist carrying metadata.parentToolUseId is skipped. A delegated worker keeps its own private plan and writes it last, so without the guard a Task tool call would replace the plan the user is actually following with a scratch list they never asked to see. This is the follow-up the main-targeted version of this PR flagged; it is live here because rc is where subagent nesting exists.
  • Dedup: the task rows moved into a shared AgentTaskItems, used by both the inline card and the new bar, so the two surfaces can't disagree about what a completed task looks like.
  • Dismissal is keyed off the source log entry id, not a plain boolean. Hiding the bar hides that list; the next checklist the agent writes brings it back on its own.
  • Perf: useMemo on logs plus React.memo on the component. The composer re-renders on every keystroke, but logs only changes when the agent writes, so the reverse scan stays off the typing path.
  • Completed lists stay visible (the icon turns green at 100%) rather than auto-hiding, on the reasoning that completion is exactly the moment you want to confirm what was done. The explicit dismiss covers the case where it has outlived its usefulness.

Validation

  • tsc --noEmit across all four tsconfigs: clean
  • eslint + prettier --check on every touched file: clean
  • Full suite via the pre-push hook: 1614 files, 38645 tests passing, no regressions
  • Tests updated for this retarget: 6 new cases covering the subagent guard (2 unit, 1 component) and auto-expand (opens a new list, re-expands after a manual collapse, ignores the sticky preference)

CI still needs to be green before merge - local validation is single-OS.

Summary by CodeRabbit

  • New Features

    • Added a docked agent task list above the composer in AI mode.
    • Added checklist progress, task status indicators, collapse/expand controls, dismissal, and restoration when a newer checklist appears.
    • Added Display settings to show the task list and automatically expand it for new checklists.
    • Added shared checklist rendering across task list views.
  • Bug Fixes

    • Improved checklist selection to use the latest applicable checklist while excluding private subagent tasks.
  • Tests

    • Added coverage for rendering states, filtering, persistence, dismissal, restoration, and automatic expansion.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fb6ba0e-f1da-4a8a-a9b8-2f2a1fccb7f5

📥 Commits

Reviewing files that changed from the base of the PR and between c2e7592 and 671d72b.

📒 Files selected for processing (14)
  • src/__tests__/renderer/components/AgentTaskListBar.test.tsx
  • src/__tests__/renderer/utils/agentTaskList.test.ts
  • src/renderer/components/AgentTaskItems.tsx
  • src/renderer/components/AgentTaskListBar.tsx
  • src/renderer/components/AgentTaskListCard.tsx
  • src/renderer/components/InputArea/InputArea.tsx
  • src/renderer/components/Settings/searchableSettingsDisplay.ts
  • src/renderer/components/Settings/tabs/DisplayTab/DisplayTab.tsx
  • src/renderer/components/Settings/tabs/DisplayTab/components/AgentTaskListSection.tsx
  • src/renderer/components/Settings/tabs/DisplayTab/components/index.ts
  • src/renderer/hooks/settings/useSettings.ts
  • src/renderer/stores/settingsStore.ts
  • src/renderer/utils/agentTaskList.ts
  • src/shared/settingsMetadataAppearance.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/renderer/components/AgentTaskItems.tsx
  • src/renderer/components/InputArea/InputArea.tsx
  • src/tests/renderer/utils/agentTaskList.test.ts
  • src/renderer/utils/agentTaskList.ts
  • src/renderer/components/AgentTaskListCard.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Adds a collapsible agent task-list bar above the AI composer. It extracts the newest public checklist from logs, renders task statuses, supports dismissal and auto-expansion, persists display settings, and adds tests for the new behavior.

Changes

Agent task list display

Layer / File(s) Summary
Task-list extraction and shared rendering
src/renderer/utils/agentTaskList.ts, src/renderer/components/AgentTaskItems.tsx, src/renderer/components/AgentTaskListCard.tsx, src/__tests__/renderer/utils/agentTaskList.test.ts
The renderer finds the newest public checklist, skips subagent entries, and shares task-row rendering between the card and bar. Utility tests cover extraction and filtering.
Collapsed checklist bar
src/renderer/components/AgentTaskListBar.tsx, src/renderer/components/InputArea/InputArea.tsx, src/__tests__/renderer/components/AgentTaskListBar.test.tsx
The bar displays checklist progress above the AI composer, supports expansion, dismissal, persisted state, and auto-expansion for new checklist entries. Component tests cover these states.
Settings and display integration
src/renderer/stores/settingsStore.ts, src/renderer/hooks/settings/useSettings.ts, src/shared/settingsMetadataAppearance.ts, src/renderer/components/Settings/tabs/DisplayTab/..., src/renderer/components/Settings/searchableSettingsDisplay.ts
Display settings control bar visibility and automatic expansion. The settings store persists and hydrates both values, and the Display tab exposes both toggles.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 671d7

This change adds an opt-in, dismissible task-list bar above the composer while preserving existing inline task cards; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant InputArea
  participant AgentTaskListBar
  participant findLatestAgentTaskList
  participant AgentTaskItems
  InputArea->>AgentTaskListBar: pass active tab logs and theme
  AgentTaskListBar->>findLatestAgentTaskList: scan logs for latest public checklist
  findLatestAgentTaskList-->>AgentTaskListBar: return checklist and entry ID
  AgentTaskListBar->>AgentTaskItems: render tasks when expanded
  AgentTaskItems-->>AgentTaskListBar: render status rows
Loading

Suggested reviewers: reachrazamair

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 17 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: adding a collapsible agent task-list bar above the composer.
Linked Issues check ✅ Passed The changes satisfy issue #1431 by adding a docked bar above the composer, collapsed progress summary, expandable task details, live checklist updates, task-status rendering, and completed-list visibi…
Out of Scope Changes check ✅ Passed The changes are within scope. They implement the task-list bar, shared task rendering, related display settings, checklist discovery, integration above the composer, and focused tests.
Full details: Linked Issues check

Explanation

The changes satisfy issue #1431 by adding a docked bar above the composer, collapsed progress summary, expandable task details, live checklist updates, task-status rendering, and completed-list visibility with dismissal support.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/1431-todo-task-bar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds an optional, collapsible task-list bar above the active AI tab's composer, deriving the latest checklist from existing logs and sharing task-row rendering with inline cards.

  • Adds latest-checklist extraction, collapsed progress summaries, expansion, and per-entry dismissal.
  • Integrates the bar into InputArea and adds a persisted display setting.
  • Adds utility and component coverage for rendering, updates, dismissal, and opt-out behavior.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking edge case where dismissal can leak between tabs when checklist entry IDs collide.

The feature and settings wiring are coherent, but dismissal is retained by an unscoped entry ID while the component survives tab switches.

Files Needing Attention: src/renderer/components/AgentTaskListBar.tsx

Important Files Changed

Filename Overview
src/renderer/components/AgentTaskListBar.tsx Adds the docked checklist UI; dismissal state is not explicitly scoped to the active tab.
src/renderer/utils/agentTaskList.ts Adds a reverse scan that derives the latest normalized checklist from tab logs.
src/renderer/components/InputArea/InputArea.tsx Mounts the task-list bar above the composer for AI input mode.
src/renderer/stores/settingsStore.ts Adds the default, persistence loading, and setter for the display preference.
src/renderer/components/AgentTaskItems.tsx Extracts shared task-row rendering used by both inline and docked checklist surfaces.
src/tests/renderer/components/AgentTaskListBar.test.tsx Covers primary bar behavior but does not exercise dismissal while switching between tabs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Logs[Active tab logs] --> Scan[Find latest checklist]
  Scan --> Bar[Docked task-list bar]
  Setting[Display setting] --> Bar
  Bar --> Summary[Collapsed progress summary]
  Bar --> Items[Expanded shared task items]
  ToolUpdate[New checklist entry] --> Logs
Loading

Reviews (1): Last reviewed commit: "feat(tasks): dock the agent's task list ..." | Re-trigger Greptile

);
// Keyed by the source log entry, so dismissing hides THIS list and the next
// checklist the agent writes brings the bar back on its own.
const [dismissedEntryId, setDismissedEntryId] = useState<string | null>(null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Scope dismissal to the active tab

If two AI tabs contain checklist entries with the same ID, dismissedEntryId persists across the tab switch and suppresses the second tab's checklist even though the user dismissed only the first tab's list. Key the dismissal by tab as well as entry ID, or reset it when the active tab changes.

Knowledge Base Used: Session UI and tabs

@pedramamini

Copy link
Copy Markdown
Collaborator Author

CI note: the test failure is pre-existing on main, not from this PR

The test job is red on 4 cases in src/__tests__/renderer/components/FilePreview.test.tsx > bare font-zoom keys:

AssertionError: expected <button type="button" ...(4)></button> to be null

That same file fails identically on main at 8af06a5, which is this branch's exact base (run 32806138304) - and on every main run going back to at least 2026-08-24.

Counts line up with the diff being additive-only:

Test Files Tests passed
main @ 8af06a5 1 failed / 1258 passed 1258
this PR 1 failed / 1259 passed 1259

Same one failing file, exactly +1 passing file (the new AgentTaskListBar.test.tsx). Nothing here touches FilePreview or the font-zoom path.

Other checks are green: lint-and-format, Analyze (javascript-typescript), CodeRabbit, Greptile.

…e composer

Agent checklists (Claude Code / OpenCode TodoWrite, Codex update_plan) already
render inline in the transcript, but those cards scroll away as the conversation
grows, so "what is the agent working on, and how much is left" stops being
answerable without scrolling back to hunt for the last update.

This pins the newest checklist for the active AI tab directly above the input
box: collapsed to one line (the active task plus a completed/total count and a
progress bar), expandable to the full list, rewritten in place as the agent
updates its plan, and dismissable per checklist.

The list is derived from the tab's own logs - a reverse scan for the last
checklist-shaped tool call. Agents rewrite the whole list on every update, so
the last one IS the current state; there is nothing to merge. That means no new
capture path and no second copy of the state to drift from the transcript. It
switches with the tab and survives app restart for free.

A checklist written inside a subagent (metadata.parentToolUseId) is skipped. A
delegated worker keeps its own private plan and writes it last, so without the
guard a Task tool call would replace the plan the user is following.

Both behaviors are Display settings, off by default: showAgentTaskListBar
renders the bar at all, and autoExpandAgentTaskListBar opens each new checklist
to its full list instead of the one-line summary. Under auto-expand a manual
collapse applies to that checklist only, so the next update re-expands.

The task rows moved into a shared AgentTaskItems, used by both the inline card
and the new bar, so the two surfaces can't disagree about what a completed task
looks like.

Closes #1431
@pedramamini
pedramamini force-pushed the feat/1431-todo-task-bar branch from 7259d61 to 671d72b Compare August 25, 2026 18:08
@pedramamini
pedramamini changed the base branch from main to rc August 25, 2026 18:08
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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.

Feature: Show TodoWrite todo list in collapsible bar above chat input

1 participant