Skip to content

[Bug]: Branch trigger shows "Fromnew-design" instead of "From new-design" #23625

Open

Description

@guryanov-a

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open a project and start a new thread in New worktree mode.
  2. Pick a base branch whose name is about 10 characters long, for example new-design.
  3. Look at the branch trigger under the composer, or the branch row in the thread details panel.

Expected behavior

The trigger reads From new-design.

Actual behavior

The trigger reads Fromnew-design: the space after "From" is gone, in both the composer toolbar and the thread details panel.

Branch trigger showing "Fromnew-design"

Impact

Minor visual bug. The label is hard to read.

Version or commit

main @ f054d1b

Environment

macOS, desktop app

Cause

resolveBranchTriggerLabel (apps/web/src/components/BranchToolbar.logic.ts) returns the correct string, From new-design. MiddleTruncate (apps/web/src/components/ui/middle-truncate.tsx) then splits it: splitForMiddleTruncate keeps the last 10 characters by default, so the 15-character label becomes head "From " and tail "new-design". Each part renders in its own <span> inside an inline-flex whitespace-nowrap container. Flex items lay out their text on their own, so the trailing space of the head span is collapsed and never renders. Any label where the cut lands right after a space loses that space.

Introduced with the middle-truncation change in #12805.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions