Skip to content

[Bug]: the chat agent's text annotation is not fitted to its text, and wraps out of its box in 9:16 #1159

Closed

Description

@EtienneLescot

Found during the v2.1.0 release-candidate e2e pass (macOS 26.5 arm64, CI build of release/v2.1.0 @ 9c55596, results row in #1131).

Repro

In the chat panel, in one turn: "add a title 'Demo OpenScreen' from 0:01 to 0:04, then switch the format to vertical 9:16". The agent calls addAnnotation, then setAspectRatio.

Stored annotation

type text, content "Demo OpenScreen", position x 2.33 %, y 45.33 %, size 95.34 % x 9.33 %, fontSize 64, Inter bold, centred, plate rgba(0,0,0,0.7), space "frame".

Actual

In the preview and in the exported 1080x1920 frame at 3.0 s only "Demo" shows; "OpenScreen" wraps onto a second line outside the box.

Expected

The box fitted to the text, as the inspector sizes it, and the title kept on its line across the format change.

Cause

The agent's tools run in the main process, where measureTextBlock (src/lib/ai-edition/annotations/placement.ts) has no OffscreenCanvas and falls back to an average advance of 0.56 em. Inter bold "Demo OpenScreen" at 64 px is 586.5 px wide (hmtx advances of public/fonts/Inter-Bold.ttf); the estimate is 537.6 px. The stored numbers match the estimate exactly: 30.17 % of a 16:9 frame (579 px, leaving 554 px inside the plate for 587 px of words), height 9.33 % (1.25 em line), then scaled by 16/9 / 9/16 to 95.34 % by refitFrameAnnotations, which keeps a text box's shape rather than refitting it. So the box was already too narrow in 16:9, and at 64 px the title cannot fit a portrait frame's width on one line at all (628 px of box for 607.5 px of frame at the reference height).

Platform: all (the measurement runs in the main process on every OS).

Activity

  1. added
    status: fixed in mainWork is merged into main but may not be in a downloadable release yet.
    status: pending releaseMerged change is waiting for a packaged desktop release.
    on Oct 12, 2026
  2. added this to the Next Release milestone on Oct 12, 2026
  3. github-actions commented on Oct 12, 2026

    @github-actions
    Contributor

    Fixed by #1160 and merged into main.

    This change is assigned to the Next Release release milestone and is not necessarily available in the latest downloadable desktop release yet. It is currently marked as status: pending release until a packaged release containing it is published.

  4. added a commit that references this issue on Oct 13, 2026
    2a6379b
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

    bugSomething isn't workingstatus: fixed in mainWork is merged into main but may not be in a downloadable release yet.status: pending releaseMerged change is waiting for a packaged desktop release.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions