chore(post-phase2): cleanup pass for support matrix, layers + dead code#89
Merged
Conversation
There was a problem hiding this comment.
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.
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.
4fd6eb2 to
519e9e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.