Skip to content

feat(filaments): add spool-count column with sort/filter support#865

Draft
akira69 wants to merge 5 commits intoDonkie:masterfrom
akira69:feat/filament-spool-count-upstream-split
Draft

feat(filaments): add spool-count column with sort/filter support#865
akira69 wants to merge 5 commits intoDonkie:masterfrom
akira69:feat/filament-spool-count-upstream-split

Conversation

@akira69
Copy link
Copy Markdown

@akira69 akira69 commented Feb 24, 2026

Summary

This PR hardens filament spool_count support so the filaments list can use it as a reliable inventory signal instead of a one-off display field.

Why

The useful part of spool_count is not just rendering a number. It needs to stay coherent across list queries, numeric filter semantics, spool relationship changes, and adjacent PRs that touch the same query plumbing.

Hardening In This PR

Backend

  • Filament list queries treat spool_count as a first-class sortable and filterable field.
  • Filament payload hydration now keeps spool_count populated on list, get, and update paths instead of leaving event payloads to drift to null or an implied 0.
  • Distinct spool-count lookup stays numeric, including 0, without needing empty-string semantics.
  • Spool relationship changes that affect counts are wired to refresh the related filament event path.
  • The spool.filament_id index migration remains in scope to keep count lookups responsive.

Frontend

  • The filament list exposes spool_count as a sortable, filterable numeric column.
  • The filter path treats 0 as the real empty-state count rather than surfacing the generic "" option.
  • The column display still normalizes missing values to 0 for safety, but the backend hydration path is now intended to keep that fallback from masking stale data.

Screenshots

Filament list with new Spool Count column visible. UI enabled to Hide/Show Spool Count column.

image

Sort by Spool Count (asc/desc).

image

Filter dropdown for Spool Count values (without "<empty>")

image

Testing Status

Targeted integration coverage was added for:

  • filament get returning spool_count
  • filament find filtering by spool_count=0
  • filament find sorting by spool_count
  • distinct values from GET /api/v1/filament/spool-count

Testing TODO

  • Run the new filament integration slice covering spool_count get/find/filter/sort/distinct-value cases.
  • Run the frontend build.
  • Manually smoke-test the filament list column, numeric filter values, and clear-filters path.

Scope Boundary

This PR stays limited to spool-count correctness, query behavior, and integration hardening for the filament list path.
Manufacturer-level count columns and other list-query UX work remain out of scope.

Issues

Merge Notes

This branch still shares nearby query-plumbing touchpoints with adjacent filament-list PRs such as #858 and #862, so rebase/conflict cleanup may still be needed depending on merge order.

@akira69 akira69 force-pushed the feat/filament-spool-count-upstream-split branch from 9d8ae57 to 0b28fca Compare February 24, 2026 18:11
@akira69 akira69 marked this pull request as ready for review February 24, 2026 19:46
@akira69 akira69 force-pushed the feat/filament-spool-count-upstream-split branch from 0b28fca to 1be3756 Compare February 26, 2026 16:44
@akira69 akira69 marked this pull request as draft February 26, 2026 16:47
@akira69 akira69 force-pushed the feat/filament-spool-count-upstream-split branch 3 times, most recently from 99f3c44 to b5613ff Compare February 26, 2026 18:50
@akira69 akira69 force-pushed the feat/filament-spool-count-upstream-split branch from b5613ff to 9938104 Compare February 27, 2026 01:39
@akira69 akira69 marked this pull request as ready for review February 27, 2026 01:41
@akira69 akira69 marked this pull request as draft February 27, 2026 20:50
@akira69 akira69 marked this pull request as ready for review March 2, 2026 06:00
@akira69 akira69 closed this Mar 2, 2026
@akira69 akira69 reopened this Mar 2, 2026
@akira69 akira69 mentioned this pull request Mar 5, 2026
@akira69 akira69 marked this pull request as draft March 14, 2026 02:20
akira69 added 2 commits March 13, 2026 22:14
- Use direct assignment instead of setattr() for spool_count attribute
- Add noqa override for C901 complexity in find() to match pattern in spool.py
- Condense multiline SQL subquery expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant