Skip to content

feat(manufacturers): add manufacturer logo support#28

Closed
akira69 wants to merge 3 commits intoFire-Devils:develfrom
akira69:fd/pr4-manufacturer-logos
Closed

feat(manufacturers): add manufacturer logo support#28
akira69 wants to merge 3 commits intoFire-Devils:develfrom
akira69:fd/pr4-manufacturer-logos

Conversation

@akira69
Copy link
Copy Markdown
Contributor

@akira69 akira69 commented Apr 4, 2026

Summary

Adds manufacturer logo support to FilaMan as a standalone PR based on main, independent from the export and printing branches.

This PR adds backend logo storage/import/clear support, serves stored manufacturer logo files, exposes the new manufacturer logo fields in API responses, and surfaces manufacturer logos across the manufacturers, filament, and spool UI.

Logos are handled as copied local assets. Remote URLs are used only as transient import sources and are not persisted as manufacturer state. The upload/import pipeline validates supported image formats, enforces a bounded file size, and uses safer remote fetch handling before storing the asset locally.

This upstream PR intentionally contains only the three feature commits from the fork PR and supersedes the earlier closed upstream attempt (#21).

Base / Branch Context

  • Target repo: Fire-Devils/filaman-system
  • Base branch: main
  • Head branch: akira69:fd/pr4-manufacturer-logos
  • Standalone upstream PR, not stacked on other filaman-system branches

Why

  • Manufacturer branding is useful on spool and filament detail pages, printed workflows, and day-to-day browsing.
  • The manufacturers screen needed first-class upload/import/clear flows rather than requiring manual data or filesystem work.
  • The spool detail hero benefits from richer multicolor rendering so multi-color filaments are visually distinguishable at a glance.

Implementation

  • Backend manufacturer logo support:
    • local manufacturer logo file storage with supported-image validation and size limits
    • URL import endpoint that safely fetches a remote image, copies it into local storage, and rejects unsafe or malformed sources
    • logo clear/delete flow with safer file lifecycle cleanup
    • served logo URLs in API responses
  • Manufacturer management UI:
    • manufacturer table logo column with wide-logo rendering and text fallback
    • modal preview, local upload, remote import, stored file path display, and clear-logo flow
    • shared logo rendering helper for consistent image and fallback presentation
    • clearer recovery messaging when manufacturer details save but a logo upload/import step fails
  • Filament and spool UI integration:
    • filament detail hero bar with manufacturer logo treatment
    • filament edit manufacturer preview
    • spool detail hero bar with manufacturer logo treatment
    • spool edit filament/manufacturer preview
  • Spool multicolor hero treatment:
    • uses all filament colors in the hero card instead of tinting from only the first color
    • gradient multi-color style renders horizontal bands
    • striped multi-color style renders vertical bands
  • Hero bar responsiveness polish:
    • long filament names wrap instead of truncating with ellipses
    • hero text uses available space up to the logo pill
    • sidebar auto-collapses earlier on narrower desktop widths so the hero bar stays usable before stacking
  • Automated backend coverage:
    • logo upload persistence and stored-file serving
    • invalid image byte rejection
    • oversized logo rejection
    • unsafe URL rejection for localhost/private-style sources and credentialed URLs

Code Quality / Validation

  • Backend compile check passed with backend/.venv/bin/python -m compileall app
  • Frontend build passed with cp ../version.txt ./version.txt && npm run build && rm -f ./version.txt
  • Backend regression tests passed with backend/.venv/bin/python -m pytest tests/test_filaments.py
  • Targeted logo tests passed with backend/.venv/bin/python -m pytest tests/test_filaments.py -k 'logo'
  • Authenticated API smoke tests covered login, manufacturer create, remote logo import, stored logo fetch, and clear-logo behavior
  • Browser verification covered:
    • remote preview
    • local upload preview
    • stored file path display
    • clear-logo reset
    • manufacturer table image and text fallback rendering
    • filament detail hero rendering
    • filament edit preview switching
    • spool detail hero rendering
    • spool multicolor hero rendering for both striped and gradient variants
    • spool hero wrapping without ellipses
    • earlier sidebar collapse before narrow-layout stacking

Test Checklist

  • Backend automated tests cover valid upload/serve, invalid bytes, oversize rejection, and unsafe URL rejection
  • Backend URL import succeeds and stores a local logo file
  • Create a manufacturer with a logo imported from URL and verify preview appears in the modal
  • Upload a local logo file for a manufacturer and verify the stored file path updates
  • Clear a manufacturer logo and verify both preview and stored path are removed
  • Confirm manufacturer table rows show wide logos without boxed thumbnails
  • Confirm manufacturers without logos show the styled text fallback
  • Confirm filament detail shows the manufacturer logo correctly in the top manufacturer bar
  • Confirm filament edit updates the manufacturer logo preview when the manufacturer changes
  • Confirm spool detail shows the selected filament manufacturer logo correctly in the top filament bar
  • Confirm striped multi-color spool heroes render all colors as vertical bands
  • Confirm gradient multi-color spool heroes render all colors as horizontal bands
  • Confirm spool hero text wraps instead of truncating with ...
  • Confirm the sidebar collapses before the spool hero is forced into the narrow stacked layout
  • Confirm spool edit updates the manufacturer logo preview when the filament changes
  • Confirm manufacturer modal scrolling stays inside the modal rather than scrolling the page behind it

The spool edit change-preview interaction remains unchecked because the available seeded spool fixture only exposed one filament option during live verification.

Screenshots

Manufacturer overview with real logos

Manufacturers overview with real logos

Manufacturer modal upload preview

Manufacturer modal upload preview

Filament detail hero

Filament detail hero with manufacturer logo

Filament edit manufacturer preview

Filament edit manufacturer preview

Spool detail hero, striped multi-color

Striped multi-color spool hero

Spool detail hero, gradient multi-color

Gradient multi-color spool hero

Spool edit manufacturer preview

Spool edit manufacturer preview

@ManuelW77 ManuelW77 changed the base branch from main to devel April 4, 2026 09:36
@ManuelW77
Copy link
Copy Markdown
Contributor

I'll check this later, because i'm working on a database for manufacturers and brands, wo send his data, logo, spools etc to a dataset. this will be implemented to filaman.

@akira69
Copy link
Copy Markdown
Contributor Author

akira69 commented Apr 4, 2026

@ManuelW77 I should have written a discussion point, my intention was to later provide an import action via plug-in using this GitHub repo: https://github.com/MarksMakerSpace/filament-profiles

Maybe you don't need to repeat this work of maintaining a database. Or you can use this as a basis and fork from it.

I did a whole bunch of work for spoolman including exactly this, but I can't get traction there. You've already been 100x more receptive! Looking forward to help add features!

I did that work at Donkie/Spoolman/pull/872

here's a video of that sync action working
image

  • I made it so that you can review all the manufacturer logos (if you wish) before sync
  • I made it so one could also upload their own .zip with the same review flow
  • I also made a function to auto-generate a print-logo from an uploaded color logo

--> this would work well as a plugin I think.

@akira69 akira69 mentioned this pull request Apr 4, 2026
14 tasks
@ManuelW77
Copy link
Copy Markdown
Contributor

Thanks for your work but brand logos are included since 1.2.0 in an other way.
With 1.2.0 the FilaMan Filament Database is introduced, which sync Logos and more from the central Database.

@ManuelW77 ManuelW77 closed this Apr 9, 2026
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