Skip to content

chore(post-phase2): cleanup pass for support matrix, layers + dead code#89

Merged
u8array merged 2 commits into
mainfrom
chore/post-phase2-cleanup
May 23, 2026
Merged

chore(post-phase2): cleanup pass for support matrix, layers + dead code#89
u8array merged 2 commits into
mainfrom
chore/post-phase2-cleanup

Conversation

@u8array
Copy link
Copy Markdown
Owner

@u8array u8array commented May 23, 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 refactors ZPL batch export logic by introducing centralized selectors in the label store and moving the Page type definition to types/Group to minimize dependencies. It also updates ZPL command metadata to reflect support for template and variable commands and simplifies CSV import state by removing unused file references. Feedback suggests improving the robustness of the ZPL template replacement regex to handle varied line endings and addressing an inconsistency in state access within the useZplImportExport hook.

Comment thread src/lib/zplGenerator.ts
Comment thread src/hooks/useZplImportExport.ts Outdated
u8array added 2 commits May 23, 2026 16:46
Six small follow-ups from the Phase 2 reviews:

1. zplCommandSupport.ts: FN and FV were still marked 'unsupported'
   after Phase 1 merged Variables; flip both to 'supported'. Add
   DF, XF, XG, DY entries (Phase 2d batch export) which the matrix
   silently lacked, so the import report now reflects reality.

2. Move the `Page` interface out of the store and into types/Group
   alongside LabelObject. zplGenerator.ts no longer imports from
   store/, removing the only `lib -> store` edge in the Phase 2
   surface. The single remaining consumer (ZplImportModal) imports
   from types/Group directly; no compatibility shim needed.

3. Drop the dead `getImportedFile` export from csvImport.ts and the
   corresponding `lastImportedFile` slot; `rememberImport` no longer
   takes a File argument (the only field-name consumer reads from
   `pending.parsed.file` directly).

4. Extract `R:LBL.ZPL` as `BATCH_TEMPLATE_PATH` constant in
   zplGenerator.ts so the path appears once instead of twice. The
   constant's JSDoc sits above it; the function's JSDoc is attached
   to the function (was orphaned in the first pass).

5. Add `selectBatchInputs` returning `{dataset, mapping} | null` and
   derive `selectCanBatchExport` from it. The hook's batch paths
   call `selectBatchInputs(getState())` once and consume the narrowed
   pair, instead of duplicating the predicate via redundant null
   guards. Boolean selector still drives the UI's menu-enable state.

6. canBatchExport lifts from useZplImportExport's hook-local
   derivation to the store-level selector, matching the existing
   selectPreviewLocksEditor / selectLabelaryNoticeRequired pattern.
@u8array u8array force-pushed the chore/post-phase2-cleanup branch from 4fd6eb2 to 519e9e3 Compare May 23, 2026 14:47
@u8array u8array merged commit 1a15d70 into main May 23, 2026
2 checks passed
@u8array u8array deleted the chore/post-phase2-cleanup branch May 23, 2026 15: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