Skip to content

chore(deploy): sync prod with main - #126

Merged
u8array merged 8 commits into
prodfrom
chore/deploy-sync-prod
Jun 3, 2026
Merged

u8array merged 8 commits into
prodfrom
chore/deploy-sync-prod

Conversation

@u8array

@u8array u8array commented Jun 3, 2026 •

Copy link
Copy Markdown
Owner

No description provided.

u8array added 8 commits June 4, 2026 00:10
^BS supplement digits previously scaled linearly via moduleWidth * 10,
overshooting Labelary's actual output and pushing the text far above
the bars on resize. Labelary uses Zebra Font 0 in discrete magnification
steps; measured glyph ink height (dots) and gap-to-bar (dots) at 8 dpmm:

  mw 1   -> font  7, gap 2
  mw 2   -> font 14, gap 4
  mw 3-7 -> font 21, gap 3
  mw 8+  -> font 44, gap 5

Encode the steps as a table-driven helper (upcSuppFontDots /
upcSuppAboveGapDots / upcSuppTextZoneDots) and extend HriBehavior so
fontDots and aboveGapDots can be moduleWidth-dependent functions. ^BS
plugs those helpers into its registry entry. BarcodeObject inflates the
ink-height table value by 1/0.583 (Courier New Bold cap-height ratio)
so the Konva fontSize em-square renders glyphs at the spec ink height,
and shifts the text down by 0.22 em to compensate for Courier's empty
em-bottom padding. Other 1D barcodes still use the legacy em-based
moduleWidth * 10 path and are unaffected.

Also pass includetext=false to bwip-js for ean2/ean5: the renderer
otherwise baked the HRI into the bitmap alongside our Konva overlay,
producing two text instances that overlapped at mw=2 and diverged
visibly once the overlay scaled to a different font size.
Roadmap-Korrektur: ^FP ist kein "text along path" sondern ein
Field-Layout-Modifier fuer CJK vertical / RTL reverse glyph stacking
(Zebra Spec). Implementiert Parser + Generator-Roundtrip; Canvas-Render
und UI folgen in separaten Commits.

- TextProps: optional fpDirection ('H'|'V'|'R') und fpCharGap (dots)
- Parser-Handler ^FP{d},{g}; per-field state, reset bei ^FS analog ^FR
- Generator emittiert ^FPd,g nur bei non-default zwischen Anker und Font
- Tests: parser-edge-cases (FPV/FPR/FP,g/unknown letter/leak), generator
  emit-when-non-default + roundtrip
- unsupported.ts: FP no-op entfernt (echter Handler uebernimmt)
- Roadmap-Label korrigiert
Projects ^FP onto the Konva text node so the editor matches Labelary's
preview without a font-metrics refactor:

- V splits the content into one glyph per line via inserted '\n'; Konva
  renders the lines at the default 1.0 lineHeight, matching Labelary
- R reverses the glyph order on the same line
- gap maps to Konva's letterSpacing in px; suppressed in V mode because
  Labelary ignores the V gap on the printer
- ^FR reverse-text branch + standard branch share the same fpContent
  derivation so both paths stay in sync

Visual roundtrip against Labelary verified for FPV, FPR and FPH,20 at
8 dpmm. Block-text bbox metrics are unchanged for now (V's stacked
glyph column still uses the horizontal ink width); a tighter bbox is
a separate follow-up if the misalignment turns into a real complaint.
Labelary places a ^FPR-reversed block such that its left edge lands
at FO − (totalAdvance − fontHeight × 0.8). PrintLab ZPL Bold advance
widths are calibrated to Zebra CG Triumvirate Bold (see
assets/fonts/NOTICE.md), so anchoring on a fontHeight-based padding
rather than the per-glyph probe of the rightmost char keeps the
block-left lined up with Labelary independent of which char happens
to be reversed into the rightmost slot.

Previous attempts anchored on A's right edge, which matched the
right edge but pushed the visible left edge ~13 dot inside the
Labelary block. Verified against a Labelary pixel scan: at fontH=50
content "ABC", block-left at dot 207.7 vs Labelary's 208 (±0.3 dot).

- fpShiftXPx via Konva.Text probe for total render width + fontH×0.8
  padding for the anchor offset
- Plumbed through ^FR reverse-text branch and TextFieldContent
  (BaseTextProps.offsetXPx)
User-editable surface for ^FP now that the parser/generator/canvas
round-trip lands. The settings live behind an `Advanced (CJK / RTL)`
disclosure in the text property panel, auto-expanded only when the
field already uses ^FP so the common case stays uncluttered.

- FpSettings sub-panel: SVG-icon segmented control (H → / V ↓ / R ←)
  + numeric inter-character gap input; mirrors JustifyButtons styling
- text.panel disclosure pinned below the existing Invert toggle;
  state seeded from current props so existing FP fields surface
- Unset semantics: switching to H or zeroing the gap drops the
  prop so generator stops emitting ^FP — keeps round-trips clean
- 6 locale keys × 32 locales via add_locale_key.local.py
Frontend-design pass on the ^FP settings panel addresses the six
concrete findings:

- Position: disclosure now sits between RotationSelect and the
  Invert toggle. ^FP and Rotation both govern glyph flow; Invert is
  a pixel effect, separate mental category.
- Label de-jargonized across all 32 locales: "Field direction
  (CJK / RTL)" -> "Vertical / right-to-left text" (locale-native
  equivalents); the niche acronym CJK is dropped.
- Char-gap input is disabled when V is selected because Labelary
  ignores the gap in vertical layout; a localised tooltip explains
  why so the disabled state is not silent.
- The "H or gap=0 -> undefined" normalization moves into the
  text registry's new `normalizeChanges` hook so every prop-write
  path (panel, import, paste, future bulk edits) ends up with the
  same shape — round-trip stays clean without the panel having to
  know the schema invariant.
- Direction icons follow Material Symbols' canonical
  `format_textdirection_*` idiom: short strokes representing text
  lines, plus a flow-direction arrow (→ for H, ↓ for V, ← for R).
- Char-gap NumberInput is full-width again, dropping the unbalanced
  half-width wrapper that read as cut-off without a 2-col partner.

Adds locale key `fpCharGapVHint` for the V-disabled tooltip.
Adds the two persistent-config Setup-Script commands users typically
reach for at the end of a provisioning script: ^KP (LCD password)
and ^JU (save/recall/factory action).

- PrinterProfile schema: setPassword (4-digit regex) +
  configurationUpdate (S/R/N/F enum; F kept in schema for round-trip
  fidelity but the UI's only path to send it is via import)
- Parser handlers in setupScript.ts; FP-style enum guard for ^JU;
  ^KP value validated against the same regex
- unsupported.ts: JU noop removed (handler now owns it)
- Generator: ^KP emits with literal 4-digit string; ^JU lives last
  in SETUP_SCRIPT_EMITTERS so ^JUS commits everything written before
  it in the same block, per Zebra's "one ^JU per file, last" guidance
- IdentityTab: password input with a draft-state mirror so progressive
  typing isn't filtered out before reaching 4 digits, plus an enum
  dropdown for the configuration action
- 8 locale keys × 32 locales via add_locale_key.local.py
- Roadmap: ^JU and ^KP flipped to [x]
- Tests: round-trip of ^KP/^JU values, schema rejection of malformed
  passwords, generator emit order anchoring ^JUS at the end
Bumps the total to 97/202 and ticks Fields (+1 for ^FP), Identity
& access (+1 for ^KP, now full 3/3), and Print quality (+1 for ^JU)
to match the roadmap. No content beyond the three category rows and
the headline total changed.
@u8array
u8array force-pushed the chore/deploy-sync-prod branch from 57af0d2 to 62f502d Compare June 3, 2026 22:10

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

Copy link
Copy Markdown

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 introduces support for several ZPL commands, including ^FP (vertical/reverse text layout), ^BT (TLC39 barcode composite rendering), ^KP (front-panel password), ^JU (configuration update), and ^CC/^CT/^CD (changing command prefixes and delimiters). It updates the parser, generator, canvas rendering, UI settings panels, and localized strings to support these features. The feedback highlights a state synchronization issue in the front-panel password input where an incomplete draft can persist in the UI without being committed, and suggests adding an onBlur handler to reset the draft to the stored password when focus is lost.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/components/PrinterSettings/IdentityTab.tsx
@u8array
u8array merged commit d1dc6a7 into prod Jun 3, 2026
2 checks passed
@u8array
u8array deleted the chore/deploy-sync-prod branch June 3, 2026 22:13
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