Repository navigation
Wrap long task titles, and size the pane to the rows they take - #2
Merged
Merged
Conversation
Supersedes #1, which made the open task's title and the transcript row wrap. This keeps that change and fixes what review found around it: - The pane asked for one row per title wherever it was drawn, so a title that wrapped cut off the rows below it, the buttons among them. rowsFor (now in hooks/pane.ts) counts every text as the terminal wraps it at the width the pane is drawn in; the render hook remembers that width and opens the pane again when the rows differ. - A title and its age are one text, so the age follows the title instead of being squeezed into a column of its own; the same for the "Assigned you a task:" label in the transcript. - Every open task's title wraps, not only the selected one's: `#2` is the button that selects it, and the title wraps beside it. Saved responses wrap too, with Send now beside them. - Titles longer than 80 characters (left in the store by an older version) are drawn whole, up to 300. - The pane's rows keep their height when the tree is taller than the pane: it scrolls instead of squeezing rows into each other. Tests: unit tests for the wrapping and the row counts, kit tests that the pane re-opens with more rows when drawn narrower and that every title is drawn whole, and tests/live/test_pane.py, which draws the pane and the transcript row in a real Claude Code in tmux at 36 to 100 columns and checks that every title shows whole and the pane fits it exactly. CI runs it as a second job, then type-checks. Co-authored-by: Yurii Mazurenko <yuramazyrenko@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NWRmPXAvN9BfWZJxsAMvmf
On main the unselected tasks' ages fell into a column one character wide at 66 columns; this draws the same tasks and checks each title and age shows whole and the pane fits them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NWRmPXAvN9BfWZJxsAMvmf
A session killed after creating the store can still write its slot after the seed was read back, and the next session then finds no tasks. Opening the pane now notices that, seeds again and retries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NWRmPXAvN9BfWZJxsAMvmf
The render job failed twice with "No tasks for you right now" while the status line counted one: /my-tasks ran before the session had loaded the seeded tasks from the store. Wait for the status line first, in place of the retry the last commit added on a wrong guess. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NWRmPXAvN9BfWZJxsAMvmf
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Tzafrir · project thread
Supersedes #1 by @Yuramazyrenko, who found the problem and made the first fix: wrap the title instead of cutting it. Their change is kept here (and they are credited as co-author on the commit); this PR fixes what review found around it.
Before (PR #1, a 44-column terminal): the title wraps, but the age is squeezed into a column of its own and the pane, sized for a one-row title, cuts off everything below the why: the buttons and task #2.
After (this branch, same terminal, same tasks):
Both screens are
tmux capture-paneoutput from Claude Code 2.1.296, drawn by the newtests/live/screen.py.The six review findings
rowsFor(moved tohooks/pane.ts) now counts every text as the terminal wraps it, at the width the pane is drawn in. The render hook keeps that width and opens the pane again when the rows it needs change, so a narrower terminal gets a taller pane.flexShrink={0}on the age: at 36 columns that leaves the title an 8-column strip.#2is the button that selects the task, and the title wraps beside it. AButtonwith wrapping children clipped its last column, so the title isn't inside the button. Saved responses wrap too, with Send now beside them.assign_taskstill refuses anything over 80.Tests
Kit tests (
claude plugin test .):wrapRowsandcellsOfagainst how the terminal actually wrapped spaces, an over-long German word and Japanese text.rowsForrow counts taken from the live screens.tests/live/test_pane.pyruns a real Claude Code in tmux, with a throwaway config and a dummy API key. No model is called. It seeds tasks, opens/my-tasksat 36, 48, 64 and 100 columns, and checks:It passes on this branch. Every case fails on
main, and the fit cases fail on Wrap a long task title instead of cutting it at the pane edge #1.CI gains a
renderjob that runs the live check and thentsc -p .. Loading the plugin lays out its types, so the type-check can run after it.How
hooks/pane.tsholds the strings the pane draws (title, age, buttons, hint) along withrowsFor, so the drawing and the row count come from the same text.hooks/text.tsgainscellsOfandwrapRows, which follow the terminal's word wrap: break at spaces, keep the space at the end of the row, and hard-break a word longer than the row. The plugin's version isn't bumped here.🤖 Generated with Claude Code
https://claude.ai/code/session_01NWRmPXAvN9BfWZJxsAMvmf
Generated by Claude Code