Skip to content

Text and Boxes need flexShrink=0 where they should not shrink #3775

Closed

Description

@ravshansbox

Description

Sometimes it incorrectly chooses start column when rendering (or rerendering) tasks list

Image

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 2, 2025
  2. github-actions commented on Nov 2, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. thdxr commented on Nov 2, 2025

    @thdxr
    Member

    lots of artifacts there but not sure what's going on

  4. veracioux commented on Nov 2, 2025

    @veracioux
    Contributor

    @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.

    Image
  5. kommander commented on Nov 2, 2025

    @kommander
    Contributor

    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?

  6. veracioux commented on Nov 2, 2025

    @veracioux
    Contributor

    @kommander Don't think this has anything to do with grapheme width necessarily. Check this out (pay attention to the Context text):

    Peek.2025-11-03.00-37.mp4

    After I modfiy the code to set a background color on the XX,XXX tokens text, it doesn't show up anymore:

    Peek.2025-11-03.00-35.mp4

    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 #3775 (comment) I think.

  7. kommander commented on Nov 3, 2025

    @kommander
    Contributor

    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 containers for the nodes. Then the container does not shrink and the text nodes do not overlap.

  8. changed the title [-]Task list invalid start column[/-] [+]Text and Boxes need flexShrink=0 where they should not shrink[/+] on Nov 4, 2025
  9. OpeOginni commented on Nov 5, 2025

    @OpeOginni
    Contributor

    @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?

  10. veracioux commented on Nov 5, 2025

    @veracioux
    Contributor

    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

  11. OpeOginni commented on Nov 5, 2025

    @OpeOginni
    Contributor

    @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.

    Screen.Recording.2025-11-05.at.17.37.02.mov
  12. rekram1-node commented on Nov 5, 2025

    @rekram1-node
    Contributor

    I kinda like that, that's cool

  13. kommander commented on Nov 5, 2025

    @kommander
    Contributor

    Scrollbox makes sense and would solve the shrinking issue as well

  14. OpeOginni commented on Nov 5, 2025

    @OpeOginni
    Contributor

    Cool, Just doing some testing, then Ill get this PR out 🫡

  15. assigned and unassigned on Nov 5, 2025
  16. thdxr commented on Nov 5, 2025

    @thdxr
    Member

    nice

  17. OpeOginni commented on Nov 9, 2025

    @OpeOginni
    Contributor

    Want to get feedback on this. Was thinking of collapsable items in the sidebar, is it needed?

    Screen.Recording.2025-11-09.at.16.05.36.mov

    More of design decision

  18. thdxr commented on Nov 12, 2025

    @thdxr
    Member

    i like it would want to play with some of the styling/icon but i'd take a PR

  19. OpeOginni commented on Nov 12, 2025

    @OpeOginni
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp-wantedopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions