Skip to content

feat(vendors/logos): add GitHub logo-pack sync workflow (no bundled assets)#872

Open
akira69 wants to merge 24 commits intoDonkie:masterfrom
akira69:feat/manufacturer-logo-github-sync-upstream-split
Open

feat(vendors/logos): add GitHub logo-pack sync workflow (no bundled assets)#872
akira69 wants to merge 24 commits intoDonkie:masterfrom
akira69:feat/manufacturer-logo-github-sync-upstream-split

Conversation

@akira69
Copy link
Copy Markdown

@akira69 akira69 commented Feb 26, 2026

Summary

This PR adds the operator workflow on top of #857:

  • refresh the shared logo pack from GitHub
  • import ZIP logo packs into the local runtime library
  • review and bulk-apply manufacturer/logo assignments
  • update a single manufacturer from the edit page
  • upload one-off web/print logo files from the edit page

Stack Context

  • #846: filament search foundation
  • #860: export-path work
  • #857: logo-aware rendering, suggestions, conversion
  • #872: GitHub/ZIP/operator workflow around those logo features

Restack Repairs In This Branch

  • Restored the dropped PR872 backend logo-pack routes/helpers.
  • Restored the dropped vendor edit-page actions:
    • Refresh Pack + Sync This Manufacturer
    • Upload Web Logo
    • Upload Print Logo
  • Carried forward the lower-stack export immutability cleanup.
  • Hardened review-found edge cases:
    • print-only ZIP imports now succeed
    • ZIP-import responses now consistently report the uploaded ZIP source
    • GitHub sync now returns structured Message errors on expected failures

Validation

Executed locally on PR872:

  • ppr 872
  • env VITE_APIURL=/api/v1 npm run build
  • uv run ruff check spoolman/api/v1/vendor.py spoolman/vendor_logos.py
  • Playwright against http://127.0.0.1:9872
  • local API verification with curl
  • targeted backend repros with pr872/.venv/bin/python

Exercised flows:

  • /settings/logos
  • /vendor/show/1
  • /vendor/edit/1
  • /vendor/edit/2
  • /vendor/edit/3
  • /spool/show/1 desktop + mobile
  • /filament/show/1
  • /spool/print?spools=1
  • /filament/print?filaments=1
  • /spool/export?spools=1
  • /filament/export?filaments=1

Exercised artifacts/repros:

  • ZIP import of a local logo-pack archive
  • print-only ZIP import repro
  • ZIP-import metadata repro with an existing GitHub-synced manifest
  • spool AML export
  • spool PNG export
  • filament AML export
  • direct web-logo upload
  • direct print-logo upload
  • post-upload manifest verification
  • post-upload GitHub-sync preservation verification

Test Checklist

  • Settings page shows the Manufacturer Logo Management workflow
  • Sync Logo Pack from Repository refreshes/checks the GitHub logo pack
  • Review dialog shows manufacturer/logo assignments with previews
  • Sync All applies reviewed assignments
  • Sync Checked applies reviewed assignments
  • ZIP logo-pack import succeeds locally
  • print-only ZIP logo-pack import succeeds locally
  • Repeated ZIP imports were rerun specifically to verify append/preserve behavior across multiple imports
  • Refresh Pack + Sync This Manufacturer populates blank fields on the edit page
  • Saving after single-manufacturer sync persists the populated logo fields
  • Direct web-logo upload works from the edit page
  • Direct print-logo upload works from the edit page
  • Uploaded files immediately appear in /vendor-logos/manifest.json
  • Uploaded custom logo files remain available after a later GitHub sync
  • Vendor show page renders saved web + print logos
  • Spool show page renders manufacturer logos on desktop and mobile
  • Filament show page renders manufacturer logos
  • Spool print preview renders manufacturer logos
  • Filament print preview renders manufacturer logos
  • Spool export dialog loads and exports AML/PNG successfully
  • Filament export dialog loads and exports AML successfully
  • Browser print dialog / physical label output was manually verified

Notes

  • The direct upload path was exercised in Playwright by setting the hidden file inputs directly, which runs the same upload onChange path as clicking the native file-picker button.
  • A pre-existing service-worker nested-route 404 (/vendor/edit/sw.js) is still visible locally, but it predates this change and is unrelated to this workflow.

@akira69 akira69 force-pushed the feat/manufacturer-logo-github-sync-upstream-split branch 2 times, most recently from 2bdc861 to 7e5a737 Compare February 26, 2026 16:31
@akira69 akira69 closed this Mar 2, 2026
@akira69 akira69 reopened this Mar 2, 2026
@akira69 akira69 marked this pull request as ready for review March 9, 2026 04:26
@akira69 akira69 force-pushed the feat/manufacturer-logo-github-sync-upstream-split branch from 9d16378 to a336f20 Compare March 10, 2026 06:08
@akira69 akira69 force-pushed the feat/manufacturer-logo-github-sync-upstream-split branch 2 times, most recently from 0f1ba3e to 239cb83 Compare March 13, 2026 22:11
@akira69 akira69 marked this pull request as draft March 15, 2026 15:17
- Extract _build_search_filters() helper to reduce McCabe complexity
- Reduces find() complexity from 13 → ~8 (under 10 limit)
- Reduces branch count from 13 → acceptable levels
- Resolves Ruff linting errors C901 + PLR0912
- Pure refactoring: behavior unchanged
- Also fixes Prettier formatting on filamentSelectModal and qrCodePrintingDialog
@akira69 akira69 force-pushed the feat/manufacturer-logo-github-sync-upstream-split branch 3 times, most recently from e1ccf31 to ca3f47a Compare March 16, 2026 20:55
akira69 added 9 commits March 16, 2026 21:33
- Wrap selectUnselectFiltered, handleSelectItem callbacks in useCallback
- Wrap handlePageChange, handlePageSizeChange, applySearchFilter in useCallback
- Reduces unnecessary re-renders of child components (pagination, checkboxes, buttons)
- Stable function references now persist across renders
…ack PR773)

- Fetch extra field definitions once at endpoint entry instead of per-request
- Eliminates redundant database calls for extra field validation
- Applies feedback from PR 773: 'get_extra_fields only needs to be run max at once per call'
- Affected endpoints: create/update for filament, spool, and vendor resources
- Reduces API layer complexity and improves performance
(cherry picked from commit dc11b7bdae1777a70a68bedfe503f988e96acd13)
…ase URL handling

Harden QR export base URL parsing to prevent template injection attacks

Per https://github.com/Donkie/Spoolman/wiki/Contribute#style
- ESLint (frontend) ✓ Fixed: control character regex
- Prettier (frontend) ✓ Fixed: 7 files formatting
- Ruff (backend) ✓
- Pre-commit hooks validated ✓
- Wrap selectUnselectFiltered, handleSelectItem callbacks in useCallback
- Reduces unnecessary re-renders of table and checkboxes
- Consistent with filament selector optimization pattern
- Stable function references improve React.memo effectiveness
akira69 added 5 commits March 16, 2026 21:56
…export

- Add manufacturer logo management (upload, delete, organization)
- Integrate logos into label print dialogs (positioning, sizing)
- Add vendor logo components and utilities
- Support logo source toggle (color/print profile)
- Add i18n strings for logo UI elements
- Extend vendor database with logo support

This commit layers vendor logo features on top of the export workflow.
All export functionality is preserved; logos are optional additions to print/export dialogs.
…export

- Add manufacturer logo management (upload, delete, organization)
- Integrate logos into label print dialogs (positioning, sizing)
- Add vendor logo components and utilities
- Support logo source toggle (color/print profile)
- Add i18n strings for logo UI elements
- Extend vendor database with logo support

This commit layers vendor logo features on top of the export workflow.
All export functionality is preserved; logos are optional additions to print/export dialogs.
- Add GitHub sync settings to download and manage vendor logos from upstream
- Bundle curated vendor logos (print and color profiles) for offline use
- Support ZIP logo pack import and selective sync
- Preserve custom vendor logo uploads across sync operations
- Add i18n strings for GitHub sync UI

This commit adds GitHub sync capabilities on top of the manufacturer logo
and export workflows. GitHub-sourced logos are kept separate from custom uploads.
@akira69 akira69 force-pushed the feat/manufacturer-logo-github-sync-upstream-split branch from ee02871 to 6dbb827 Compare March 17, 2026 02:57
- Use single debounced ?search= call, consistent with spool modal and PR846
- Remove 4-field parallel fetch loop, getAPIURL import, allSearchResults state
- Fix Ruff violations in vendor.py and vendor_logos.py
@akira69 akira69 force-pushed the feat/manufacturer-logo-github-sync-upstream-split branch from e910b37 to 992a00e Compare March 17, 2026 13:17
akira69 added 2 commits March 18, 2026 11:48
…ort button in PR872

- Rename extraFormatSettings->extraExportSettings in QRCodeExportDialog (matches callers)
- Declare and forward extraTitleSettings/extraInfoSettings in both QRCode dialogs
- Add initialSelectedIds, onExport props and Export button to FilamentSelectModal
…s helper

- manufacturerLogosSettings: merge two identical url imports into one line
- filament.py: restore _build_search_filters as standalone helper (was inlined in
  PR872; canonical form existed in PR857 base). Also drop now-unused noqa: C901,
  PLR0912 from find() since complexity moved to the extracted helper.
@akira69 akira69 marked this pull request as ready for review March 19, 2026 14:41
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