Skip to content

feat(ui): ^FB Block-Text UX revamp + editor orphan-marker hint#94

Merged
u8array merged 1 commit into
mainfrom
feat/fb-ux-refactor
May 24, 2026
Merged

feat(ui): ^FB Block-Text UX revamp + editor orphan-marker hint#94
u8array merged 1 commit into
mainfrom
feat/fb-ux-refactor

Conversation

@u8array
Copy link
Copy Markdown
Owner

@u8array u8array commented May 24, 2026

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements support for Zebra ^FB block-text, introducing a BlockTextSettings UI component, a visual wrap-guide on the canvas, and a shared utility for encoding/decoding line breaks and backslash escapes. It also refactors template marker tokenization to provide real-time validation and error highlighting for unknown variables or clock tokens. Review feedback identifies a potential ReferenceError due to a missing variable definition in TemplateContentInput, suggests refining line-count logic for empty strings, and recommends using replaceAll for more robust i18n placeholder substitution.

Comment thread src/components/Properties/TemplateContentInput.tsx
Comment thread src/components/Properties/BlockTextSettings.tsx
Comment thread src/components/Properties/BlockTextSettings.tsx Outdated
Comment thread src/components/Properties/BlockTextSettings.tsx Outdated
Surface ^FB state and validation in the Properties panel, light up
broken markers in the content editor, and visualise the wrap-width
on the canvas.

  - **Justify** picker: 4 toggle buttons (left / centre / right /
    justified) replacing the legacy `<select>`. Active mode is
    highlighted with the accent palette so it reads at a glance —
    same MS-Word pattern users already know. New JustifyButtons
    component mirrors the existing AlignButtons icon-row idiom.
  - **Validation hints** under the ^FB block:
      · red    "Block width required" when blockWidth is 0/missing
      · amber  "Content has N lines — exceeds max M, will be
                truncated by printer" when content > blockLines
      · muted  "Uses N of max M lines" when content < blockLines
    Round-trip safe: hints inform, never auto-correct. blockLines
    stays a user-set max (CSV-bound rows can legitimately vary in
    length around it).
  - **Wrap-guide line** on canvas: dashed amber vertical at the
    wrap-x for selected text fields with ^FB active. Direct visual
    feedback when adjusting blockWidth.
  - **Orphan-marker highlight** in the content editor: variable
    markers referencing an undefined Variable, or clock markers
    with an unknown token letter, render red with wavy underline
    instead of accent/info. Same colour-mirror surface, immediate
    feedback while typing.
  - **^FB `\&` round-trip fix**: text generator now translates
    in-content `\n` to the ZPL `\&` line-break marker when ^FB is
    active. The parser already reversed `\&` → `\n` on import, so
    multi-line ^FB content was importing correctly but exporting
    with literal newlines that Zebra firmware ignores. Editor edits
    now print as intended.

Canvas-colour palette adds an `accent` member alongside `selection`
so design-affordance overlays (currently the wrap guide; future
overlays welcome) read distinctly from the transformer chrome.
@u8array u8array force-pushed the feat/fb-ux-refactor branch from 3b62059 to b5276f1 Compare May 24, 2026 19:40
@u8array u8array merged commit 8c36535 into main May 24, 2026
2 checks passed
@u8array u8array deleted the feat/fb-ux-refactor branch May 24, 2026 19:44
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