Skip to content

fix: keep todo dock collapsed while todos exist#297

Merged
Astro-Han merged 2 commits into
devfrom
codex/fix-todo-dock-persistence
Apr 28, 2026
Merged

fix: keep todo dock collapsed while todos exist#297
Astro-Han merged 2 commits into
devfrom
codex/fix-todo-dock-persistence

Conversation

@Astro-Han

Copy link
Copy Markdown
Owner

Summary

Keep the session Todo dock mounted whenever the current session still has todo data, and make the dock start collapsed by default.

Why

The Todo dock was tied to the session live state, so it disappeared as soon as the turn ended. It also opened by default, which consumed space above the composer. The new behavior keeps existing todos available after the turn ends while showing only the compact collapsed row unless the user expands it.

Related Issue

No issue. The behavior was narrow and confirmed directly in code before implementation.

How To Verify

bun install --frozen-lockfile
bun --cwd packages/app test src/pages/session/composer/session-composer-state.test.ts
bun --cwd packages/app playwright test e2e/session/session-composer-dock.spec.ts --grep "todo dock"
bun --cwd packages/app typecheck
git diff --check

Screenshots or Recordings

Not attached. The focused E2E covers the visible collapsed, expanded, and post-turn states through the Todo dock probe.

Checklist

  • I linked the related issue, or stated why there is no issue
  • This PR has type, scope, and priority labels, or I requested maintainer labeling
  • I listed the relevant verification steps, including tests when behavior changed
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for desktop, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, or generated/local file changes when relevant
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

@Astro-Han Astro-Han added bug Something isn't working P2 Medium priority app Application behavior and product flows labels Apr 28, 2026
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 20 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 83c045f0-37a1-43aa-9f5f-2ca982d8e706

📥 Commits

Reviewing files that changed from the base of the PR and between 98b70fd and 9628a49.

📒 Files selected for processing (7)
  • packages/app/e2e/session/session-composer-dock.spec.ts
  • packages/app/src/pages/session/composer/session-composer-region.tsx
  • packages/app/src/pages/session/composer/session-composer-state.test.ts
  • packages/app/src/pages/session/composer/session-composer-state.ts
  • packages/app/src/pages/session/composer/session-todo-dock.tsx
  • packages/app/src/testing/session-composer.ts
  • packages/opencode/script/seed-e2e.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-todo-dock-persistence

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request simplifies the session composer's dock state management by removing the 'closing' and 'clear' states, ensuring the dock remains open as long as todos exist. The todoState logic is streamlined to return only 'hide' or 'open' based on the task count, and the dock's default state is now set to collapsed. Feedback was provided to remove unused hardcoded parameters when calling todoState to clean up the implementation.

Comment thread packages/app/src/pages/session/composer/session-composer-state.ts Outdated
@Astro-Han

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Astro-Han

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review Summary

The change correctly simplifies the todo dock lifecycle, but several issues remain — ranging from dead code to potential product behavior regressions.

P0 — Must Fix

  • todoState is a trivial identity function (count > 0 ? "open" : "hide"). It provides zero abstraction value and adds indirection. Inline it into the effect or delete it entirely.

P1 — Should Fix

  • test.live is orphaned dead code. ComposerDriverState.live is no longer consumed anywhere after live memo removal. Clean up testing/session-composer.ts to avoid misleading future test authors.
  • No mechanism to clear stale todos. The clear() function that wiped orphaned todos is gone. If a model leaves todos behind, they persist forever. Confirm this is intentional and document it in code comments if so.

P2 — Consider Fixing

  • todoState export still exists with a single test consumer. After inlining, the unit test can assert the trivial logic directly. Remove the export to reduce surface area.
  • Collapsed state is not remembered. collapsed: true resets on every mount. Consider persisting user preference (e.g., localStorage) so expanding the dock isn't lost on navigation.
  • expectClosed() may be dead code in E2E. The test now uses expectCollapsed() at the end. Verify expectClosed() is still used elsewhere; if not, remove it.

P3 — Nit

  • Commit history could be squashed. The second commit ("simplify todo dock state input") is a fixup of the first. Per AGENTS.md, this should be a fixup! commit autosquashed before merge.

Comment thread packages/app/src/pages/session/composer/session-composer-state.ts Outdated
Comment thread packages/app/src/pages/session/composer/session-composer-state.ts
Comment thread packages/app/src/pages/session/composer/session-composer-region.tsx
Comment thread packages/app/src/pages/session/composer/session-todo-dock.tsx
Comment thread packages/app/e2e/session/session-composer-dock.spec.ts
Comment thread packages/app/src/pages/session/composer/session-composer-state.ts
Comment thread packages/app/src/pages/session/composer/session-composer-state.ts
Comment thread packages/app/src/pages/session/composer/session-composer-state.ts
@Astro-Han Astro-Han force-pushed the codex/fix-todo-dock-persistence branch from 2d4e16f to 6babbd7 Compare April 28, 2026 12:54
@Astro-Han Astro-Han merged commit ecdca39 into dev Apr 28, 2026
23 checks passed
@Astro-Han Astro-Han deleted the codex/fix-todo-dock-persistence branch April 28, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P2 Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant