feat(filaments): add label printing support for filaments#91
Draft
akira69 wants to merge 16 commits into
Draft
Conversation
e2de21a to
9a489fb
Compare
Contributor
Author
Representative screenshots, export proofs, and test checklistScreenshots from local E2E validation on the built instance at Manufacturer/logo data was prepared through the app's FilamentDB prepare flow; Bambu Lab resolved locally as manufacturer ID Export capture paths are verified at print-grade 600 DPI ( Filament Label Designer defaultFilament standard print settings with Color HexSpool Label Designer defaultSpool standard print settings with Color HexExport proofsFilament rendered label PNG proof: Filament rendered label PDF proof: Spool rendered label PNG proof: Spool rendered label PDF proof: Test checklist
|
This was referenced Jun 19, 2026
… designer - Add filaments/[id]/print.astro: single-filament label print page mirroring spools/[id]/print.astro with filament-specific defaults (height=25mm, qrSize=15mm), storage keys, and API mapping - Add filaments/print.astro: batch filament label print page mirroring spools/print.astro with filament API + filament extra fields - Add Print Label button to filaments/[id]/index.astro (builds URL params from filament API data + stores extra fields in sessionStorage) - Add Print Labels bulk action to filaments/index.astro (bulk-action-bar) - Add i18n keys: filaments.backToFilament, filaments.showFilamentId, filaments.printLabel, filaments.bulkLabel (en + de)
Add optional qrUrl field to StandardLabelData so filament print pages can specify the correct entity URL for QR codes.
… fields on print pages - Detail page writes standard fields (extruder_temp, bed_temp, diameter, density, weight, finish, price) plus system custom fields to filaman-filament-label-extra-fields sessionStorage before navigating to the print page, so no extra API fetch is needed - Single print page fallback (direct navigation): now also shows standard filament fields as selectable checkboxes alongside system custom fields; parallelizes the two API fetches; no longer early-returns when there are no system custom fields - Batch print page: always shows standard filament fields as selectable extra fields (Extruder Temp, Bed Temp, Diameter, Density, Weight, Finish, Price) in addition to system-defined custom fields
…designer Add optional presetsKey to LabelDesignerEditorOptions so each entity type can use its own preset store. Filament print pages now use 'filaman-filament-label-presets-v1'; spool pages continue using the default 'filaman-label-presets-v1'. Presets named 'Default' are seeded separately in each store.
…erEditor Remove the optional default. Every caller must now explicitly declare which preset namespace it owns: spools/[id]/print → filaman-spool-label-presets-v1 spools/print → filaman-spool-label-presets-v1 filaments/[id]/print → filaman-filament-label-presets-v1 filaments/print → filaman-filament-label-presets-v1 This makes future entity types impossible to accidentally share presets.
On first use of a spool print page after upgrade, presets stored under 'filaman-label-presets-v1' (the old shared key) are moved to 'filaman-spool-label-presets-v1' and the old key is deleted. Migration only runs when the effective key is the spool key and the destination is empty, so it is idempotent and only fires once.
- Entity-locked QR URLs in designer: spool pages encode /spools/{id},
filament pages encode /filaments/{id}
- Cross-type preset sharing with <optgroup> divider; filament pages show
spool presets section and vice versa; cross-type presets are read-only
- Entity-specific labels throughout the designer UI: token group header,
empty extra-fields state, QR pill label, section titles
- Non-system filament custom fields now included in print page sessionStorage
- Filament label defaults match spool defaults (height 40mm, QR 18mm)
- Token area Extra Fields group label uses entity-specific i18n key
- LabelDesignerSettings.info gains marginMm field (default 0) - Margin is applied as marginTop on the main info/QR row, providing vertical spacing between the title blocks and the info area - Range+number input added to LabelDesignerEditor.astro below the text-size row, matching the existing title gap control style - Editor wired in FIELD_IDS, SLIDER_PAIRS, read/apply/reset/localize - Preset save/load and reset-section button all handle the new field
Old localStorage (v<2) had height=25mm and QR=15mm from early development. Adds SETTINGS_VERSION=2; on load, any saved settings without _v>=2 are discarded so the correct defaults (60x40mm, QR=18mm) take effect.
…overage - Split DESIGNER_TOKENS into FILAMENT_TOKENS (all pages) + SPOOL_TOKENS (spool pages only), adding 5 new filament fields and 13 spool model fields - Add entityType option to LabelDesignerEditorOptions; spool pages show a dedicated 'Spool' token group (lot_number, external_id, rfid_uid, location, status, purchase_date, purchase_price, remaining/initial/empty weights, stocked_in_at, last_used_at); filament pages omit it - Extend SpoolData interface and DesignerFlatLabelData with all new fields - Wire spool model fields through buildSpoolDataFromFlatLabel and buildSpoolDataFromApiSpool so tokens resolve correctly at render time - spool/[id]/index.astro: include all spool model fields in printUrl params and efForPrint (so they appear as standard-label checkboxes too) - spool/[id]/print.astro, filament/[id]/print.astro: read new URL params - filament pages: add subtype, manufacturer_color_name, default_spool_weight_g, spool_outer_diameter_mm, spool_width_mm, spool_material to URL params - spools/print.astro (batch): add Spool Fields checkbox section for model-level fields in the standard label sidebar - Fix pre-existing TS error: info preset default was missing marginMm
36ec9a5 to
f3506e6
Compare
f3506e6 to
5683585
Compare
5683585 to
4a4cacc
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.






Summary
Adds filament label printing alongside the existing spool label workflow.
Compared to
devel, this PR adds single and batch filament print pages, reuses and hardens shared label rendering/export helpers, and keeps the standard print UI intentionally compact while giving Label Designer access to the full token set.Dependency / Merge Order
#93 and #94 are now merged into
devel, and this branch has been rebased onto that updated base.The follow-up label-paper sheet printing PR #95 is expected to stack after this PR.
What Changed
/filaments/{id}/printand/filaments/print?ids=...with standard print settings and Label Designer tabs.Print Labeland bulkPrint Labels.StandardLabelSettingsPanel, with source comments noting the reduced standard UI is intentional.BatchLabelPrintStyles.Color Hexcheckbox.Validation
npm run lintpasses with existing warnings.npm run checkpasses with existing project hints.npm run buildpasses.127.0.0.1:4322.