Skip to content

fix(tui): preserve wrapped sidebar todo height - #57530

Open
ozandogrultan wants to merge 5 commits into
anomalyco:devfrom
ozandogrultan:todo-sidebar-height
Open

ozandogrultan wants to merge 5 commits into
anomalyco:devfrom
ozandogrultan:todo-sidebar-height

Conversation

@ozandogrultan

@ozandogrultan ozandogrultan commented Oct 20, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #57529

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Prevent the sidebar Todo container from flex-shrinking below its wrapped content. This keeps todo labels intact and preserves the existing gap before the next section, without adding padding.

Add one real-component renderer regression with four wrapped todos at width 40, followed by a section that can grow.

How did you verify your code works?

  • The new regression fails before the fix and passes after it.
  • Focused sidebar tests and a 10-repeat regression run pass.
  • Full TUI test suite, TUI typecheck, and root bun run check pass.
  • An isolated installed OpenCode 2.1.1 recording confirms that the same native component no longer overflows into the gap.

Screenshots / recordings

Before (left) / after (right):

Synthetic Todo layout before and after

Rendered from recorded terminal cells using synthetic data, not an OS screenshot.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fix works. I copied the new test onto the base, where 16 of its 24 cases fail: wrapped todos get squeezed and the blank row before the next section is lost. With this PR all 24 pass. The packages/tui typecheck and the test/feature-plugins tests pass too.

The public API is unchanged.

With only the built-in plugins, Todo is the last section in the sidebar, so this only shows up when a plugin adds a section after it that can grow.

The test is the one thing worth changing. It runs 24 cases (count × width × wrapped × completed) over 109 lines for a one-line layout fix. One case would cover the fix: about 4 wrapped todos at width 40, followed by a section that can grow. Or drop the test to keep the change minimal.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for cutting the test down to one case; that addresses my earlier point.

I ran the #57529 reproduction from source on the base and with this PR. It adds a plugin section that can grow after Todo and has the model write four long todos. On the base the todos get clipped and overlap, and the blank row before the next section is gone. With this PR all four todos keep their full wrapped height and the blank row stays. The new test fails on the base and passes here. The test/feature-plugins tests and the packages/tui typecheck pass.

The public API is unchanged.

No further concerns.

Before

After

This branch has not been deployed

No deployments
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.

Wrapped sidebar todos overlap and consume the next section gap

1 participant