Skip to content

fix(canvas): ellipsize overflowing frame labels - #102

Open
Luna Qiu (lunaqiu) wants to merge 1 commit into
microsoft:mainfrom
lunaqiu:fix/frame-label-ellipsis
Open

fix(canvas): ellipsize overflowing frame labels#102
Luna Qiu (lunaqiu) wants to merge 1 commit into
microsoft:mainfrom
lunaqiu:fix/frame-label-ellipsis

Conversation

@lunaqiu

Copy link
Copy Markdown
Contributor

Refs #101 (leaving the issue open for now).

Problem

The frame label is an <input> capped to the frame's on-screen width (overlayMaxWidth = nodeWidth * zoom) with no text-overflow, so a name wider than that cap is hard-clipped mid-character. Nothing indicates the name continues. Zooming out makes it worse: the cap shrinks with the zoom while the label stays at a fixed 12px.

Change

Add text-ellipsis to the frame label input. Chromium only paints text-overflow on an unfocused input, so the idle label truncates with while editing keeps the normal scrolling behavior.

Also corrects docs/architecture/canvas-zoom-rendering.md §4, which claimed "the input title retains access to the complete name". It never did — the title is the static t('node.editFrameName') hint.

Verification

Checked against a running dev build with a frame label forced past its cap:

State clientWidth scrollWidth text-overflow Rendering
Idle (unfocused, readOnly) 179 288 ellipsis Step 4: Lighting Reference …
Editing (focused) 179 288 ellipsis (not painted) full text, scrolls + select-all works

pnpm typecheck, pnpm format, and pnpm lint:fix are all clean.

The frame label input had no `text-overflow`, so a name wider than the frame's capped screen width was hard-clipped mid-character with no sign that more text followed. Zooming out made it worse, since the label cap tracks `nodeWidth * zoom` while the text stays 12px.

Add `text-ellipsis` to the label input. It only paints while the input is unfocused, so the idle label truncates with an ellipsis and editing still scrolls normally.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant