Skip to content

feat(printer-settings): add modal with Tab 1 (Media & Feed) - #104

Merged
u8array merged 1 commit into
mainfrom
feat/printer-modal-tab1-media-feed
May 29, 2026
Merged

u8array merged 1 commit into
mainfrom
feat/printer-modal-tab1-media-feed

Conversation

@u8array

@u8array u8array commented May 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

@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 a new Printer Settings modal allowing users to configure hardware and feed settings, which are emitted as pure ZPL commands (^MN, ^ML, ^MF, ^XB). It includes UI components, state management in the label store, multi-language localization updates, ZPL generator/parser support, and comprehensive unit tests. The review feedback focuses on improving the robustness of the ZPL parser in zplParser.ts by using parsed parameters instead of raw strings for ^MN and ^ML commands, adding optional chaining to prevent potential runtime errors in the ^MF parser, and simplifying the WIP tab check in PrinterSettingsModal.tsx.

Comment thread src/lib/zplParser.ts Outdated
Comment thread src/lib/zplParser.ts Outdated
Comment thread src/lib/zplParser.ts
Comment thread src/components/PrinterSettings/PrinterSettingsModal.tsx
First slice of the Printer Settings Modal epic. Ships the modal
shell (vertical tab rail, instant-apply semantics, ZPL-command
annotation per field) plus Tab 1 content covering four ZPL
commands that the editor previously could not author:

  ^MN  media tracking         (continuous / web / mark / auto)
  ^ML  max label length       (dots)
  ^MF  media feed             (action at power up + after head close)
  ^XB  suppress backfeed      (toggle)

Distinctive design move: every field label carries a small
monospace ZPL-command tag docked right. Users see exactly which
command each control emits, turning the modal into a discoverable
spec reference without crowding the form.

Layout: vertical tab rail (scales to N tabs, mirrors the
Properties-Panel column-of-sections feel) with an active row
indicator (▸ + orange accent + left border). Tabs 2 to 5 render
an honest "coming soon" placeholder so the navigation tells the
truth about scope. Modal shell uses the existing DialogShell
(focus trap, body scroll lock, ARIA labelling, ESC + click-outside
close) and renders via portal so the backdrop covers the full
viewport.

Persistence: all four fields write to the existing labelConfig
store (no new printer-config store) so designs round-trip without
a migration step and the Properties-Panel slim-down follow-up
can simply move the panel's existing printer fields into the
modal without re-plumbing storage.

Parser + generator: header section in zplGenerator emits the
four commands after the existing ^MM/^MT block. The corresponding
parser handlers write to labelConfig and trim whitespace around
positional params so `^MFF,L\n^XB` resolves both ^MF slots.

Locales: new `printerSettings` block in all 32 locales (DE + EN
curated by hand, the other 30 translated by a subagent run
through the extended `update_locale_value.local.py`).

Tests: emit + parser roundtrip coverage for each command, plus
edge cases for out-of-range ^MN values and non-positive ^ML.
@u8array
u8array force-pushed the feat/printer-modal-tab1-media-feed branch from 1e70512 to d6dd048 Compare May 29, 2026 14:19
@u8array
u8array merged commit cb8abe5 into main May 29, 2026
2 checks passed
@u8array
u8array deleted the feat/printer-modal-tab1-media-feed branch May 29, 2026 14:20
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