Skip to content

Color Annotation template: token cell text overflows fixed-width cell for long token names #8

Description

@svetlinata

Summary

The Color Annotation template's token cell (#state-name) holds a HUG-width TEXT node inside a FIXED 280px table cell. Long token names — e.g. button/secondary/border (#0B1A3F) — overflow horizontally into the adjacent Notes column instead of wrapping.

Where

uSpecDocs template library → Color Annotation template component → token/state-name cell.

Reproduction

  1. Run create-color for any component whose token names exceed ~30 characters (nested token paths with an inline hex suffix are the common case).
  2. Instantiate the Color Annotation template and set #state-name to a long token string.
  3. The TEXT node keeps textAutoResize: WIDTH_AND_HEIGHT (hug), so it widens past its 280px parent cell and visually collides with the next column.

Expected

Long token names wrap within the cell.

Fix that works (verified in production use)

On the #state-name TEXT node inside the template:

textNode.textAutoResize = 'HEIGHT';
textNode.layoutSizingHorizontal = 'FILL';

We've applied this at render time across ~100 annotation frames (3 component batches) as a client-side workaround; fixing the template itself would make the workaround unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions