Skip to content

feat(preview): show print orientation (^PO) and mirror (^PM) as printed - #9

Merged
glenntosco merged 3 commits into
mainfrom
claude/project-thread-5e0lug-print-orientation
Oct 24, 2026
Merged

glenntosco merged 3 commits into
mainfrom
claude/project-thread-5e0lug-print-orientation

Conversation

@glenntosco

Copy link
Copy Markdown
Collaborator

Requested by Glenn · project thread

What changed and why

Assessment item 13. Stacks on the pt-BR/fr-CA PR (→ #7 → #6 → #5). Merge in order.

The Preview window now shows a label the way the printer puts it on the media when it is set to print upside down (^POI) or mirrored (^PMY). It opens on "As printed", says in one sentence why the picture is turned, and has an "As designed" switch. The design canvas stays upright for editing; the status bar names the difference ("Prints upside down" / "Prints mirrored").

  • Rendering: RenderLabel.Inverted / Mirrored flip the whole drawing about the label centre in LabelRenderer.Draw. Only LabelDocumentAdapter.AsPrinted sets them; ToRenderLabel stays upright.
  • App: new PreviewViewModel (switch, note, redraw event), PreviewCache.RenderPrinted(..., asPrinted), switch row shown only for ^POI / ^PMY labels, status-bar badge.
  • Exports (PNG/JPEG/PDF) and the MCP preview stay as designed: exports are artwork, not a picture of the printer's output (written up in docs/decisions.md).
  • ^PM was already modelled (MirrorImage), so it is previewed the same way. Import of ^POI / ^PON / ^PMY already worked; now covered by tests.
  • Command catalogue: ^PO / ^PM preview set to Exact; docs/zpl-coverage.md regenerated.
  • 14 strings in en, es, pt-BR and fr-CA; CHANGELOG, README (en/es), decisions.

How it was tested

  • PrintOrientationPreviewTests: pixel-for-pixel 180° turn, mirror and both; block position at scale 1 and 2; adapter only flips through AsPrinted; PNG export stays upright; import of ^POI, ^POi, ^PON, none; inverted + mirrored round trip; new golden label_print_inverted.zpl.
  • PreviewViewModelTests: defaults, redraw and change notifications, note text for each case, radio write-back of false does not flip the choice, bitmap bounds, no switch for a normal label, status badge, canvas stays upright.
  • Solution builds with 0 warnings; Core/Rendering cases also ran in a Linux scratch harness. App tests run on Windows CI.

Checklist

  • Build passes; tests run on Windows CI
  • New behavior has tests (golden file added)
  • New text in all four resx files
  • No network calls or telemetry; light theme only
  • No new dependencies
  • CHANGELOG.md updated
  • Hygiene check passes

Notes

  • The canvas is deliberately never rotated; editing an upside-down label would be confusing.
  • The WPF layout of the switch row and badge has not been seen on screen yet.

Generated by Claude Code

The Preview window opens on "As printed" for a label set to ^POI or ^PMY, explains why the picture is turned and offers an "As designed" switch. The renderer flips the whole label inside LabelRenderer.Draw; only LabelDocumentAdapter.AsPrinted sets it, so the canvas and PNG/JPEG/PDF exports stay as designed. The status bar names a label that prints upside down or mirrored. Adds renderer pixel tests, importer round-trip tests, a golden file and view-model tests; marks ^PO and ^PM as previewed in the command catalogue.
pt-BR and fr-CA for the 14 keys of the As printed / As designed preview
and the status bar note.
@glenntosco
glenntosco force-pushed the claude/project-thread-5e0lug-print-orientation branch from c90ef3a to 759552b Compare October 24, 2026 14:15
@glenntosco
glenntosco changed the base branch from claude/project-thread-5e0lug-localization to main October 24, 2026 14:37
@glenntosco
glenntosco merged commit d66e3a5 into main Oct 24, 2026
6 checks passed
glenntosco added a commit that referenced this pull request Oct 27, 2026
feat(preview): show print orientation (^PO) and mirror (^PM) as printed
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.

2 participants