Text and Boxes need flexShrink=0 where they should not shrink
Description
Sometimes it incorrectly chooses start column when rendering (or rerendering) tasks list
OpenCode version
1.0.12
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
macOS 26.0.1
Terminal
No response
This issue might be a duplicate of existing issues. Please check:
- #3423: Also relates to todo/task list display problems in OpenTUI
- #3650: Similar spacing/padding glitches that affect element positioning in TUI sessions
- #3697: Display positioning issues that occur after window resizing in OpenTUI
Feel free to ignore if none of these address your specific case.
lots of artifacts there but not sure what's going on
@thdxr @kommander When there's not enough space to go around, it seems that flex gaps, margins etc are not honored, and some elements (like <text>) get collapsed. This o here is actually part of Todo which got hidden due to lack of vertical space. But I'm guessing the renderer didn't issue the correct ANSI sequence to explicitly delete that o, and since no other text (or background color) took its place it just remained displayed.
What terminal is this? Looks like a grapheme width issue, the checkmark is just one cell, in many other terminals/fonts the checkmark is two cells, so the width calculation for the grapheme is off. What is the Unicode/raw by sequence for that checkmark?
Edit: Is there a message before this one that has any emojis/CJK chars?
@kommander Don't think this has anything to do with grapheme width necessarily. Check this out (pay attention to the Context text):
https://github.com/user-attachments/assets/7f51f1ea-2f29-40be-a744-bc2ae18f7429
After I modfiy the code to set a background color on the XX,XXX tokens text, it doesn't show up anymore:
https://github.com/user-attachments/assets/97cec708-d9fd-47d8-9e0b-8b690cca8e16
I don't see any special characters being rendered there: https://github.com/veracioux/opencode/blob/9fd672a1cb735eb7f8ec80ffbe9d7540e4687759/packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx#L52
This further confirms https://github.com/sst/opencode/issues/3775#issuecomment-3478404067 I think.
Ahh now I see what you mean. Okay that is curious. So by default all renderable yoga nodes are flexShrink = 1, so to avoid text nodes getting smashed into each other we can set flexShrink = 0 on the
@kommander Hello, I am looking at this issue, is there any point where we would want the sidebar to be scrollable, if the window is a bit small to contain it all?
My 2 cents: I think the Modified Files and Todo sections would benefit from a scrollbox because their contents can get large for long sessions
@veracioux For that I think they should have a fixed height, I can add that, but what I currently have made the whole sidebar scrollable if the window gets small.
https://github.com/user-attachments/assets/9b9feabc-44dd-46d5-9dd4-32b6167411bb
I kinda like that, that's cool
Scrollbox makes sense and would solve the shrinking issue as well
Cool, Just doing some testing, then Ill get this PR out 🫡
nice
Want to get feedback on this. Was thinking of collapsable items in the sidebar, is it needed?
https://github.com/user-attachments/assets/36dc39b9-1946-480c-a58b-369f65cfa6c5
More of design decision
i like it would want to play with some of the styling/icon but i'd take a PR
i like it would want to play with some of the styling/icon but i'd take a PR
Yeah, was thinking of making use of some icons from the opencode/ui package making it similar to the Desktop one.