1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[PR #968] [MERGED] Feature: Collapsible folders for printer filters #1148

Closed
opened 2026-05-07 00:16:17 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/968
Author: @cadtoolbox
Created: 4/14/2026
Status: Merged
Merged: 4/15/2026
Merged by: @maziggy

Base: devHead: feature_printer-folders


📝 Commits (10+)

  • 9ab8ffd Feature: Collapsible folders for printer filters
  • fd9d42c Feature: Collapsible folders for printer filters
  • d4b0524 Rebased + PR comments
  • a401620 Feature: Collapsible grouped sections for printer filters
  • f5929e0 Merge branch 'dev' into feature_printer-folders
  • 20518d0 Merge branch 'dev' into feature_printer-folders
  • 9d7b393 Merge branch 'dev' into feature_printer-folders
  • 812d965 Merge branch 'dev' into feature_printer-folders
  • a90f628 Updated for PR #968 Comments
  • a6af07c Merge branch 'dev' into feature_printer-folders

📊 Changes

3 files changed (+198 additions, -82 deletions)

View changed files

📝 frontend/src/components/BulkPrinterToolbar.tsx (+1 -1)
📝 frontend/src/components/Collapsible.tsx (+34 -12)
📝 frontend/src/pages/PrintersPage.tsx (+163 -69)

📄 Description

Description

Name sort: flat grid (unchanged)
Status/Model/Location sort: grouped sections with chevron toggle, click header to collapse/expand
Collapse state persists across page refreshes via localStorage
All sections start expanded by default

Fixes #966

Documentation

Companion docs PRs (delete lines that don't apply):

Pick one:

  • Docs PR(s) linked above
  • No docs update required — reason: No feature changes

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

[Collapsible.tsx] — Added controlled mode support:

New optional open and onToggle props
When open is provided, parent controls the state; otherwise uses internal state (backwards-compatible)
[PrintersPage.tsx] — Four changes:

Constants (line ~990): STATUS_GROUP_ORDER (priority order for status groups) and STATUS_GROUP_META (maps each status to its i18n label key and dot color class)

State & callbacks (line ~5647, ~6101):

collapsedSections state persisted to localStorage (printerCollapsedSections)
toggleSectionCollapse() to toggle a section's collapsed state
selectByModel() for bulk-selecting all printers in a model group
Generalized groupedPrinters useMemo (line ~6119): Now activates for status, model, and location sorts (not just location). Status grouping reads from the query cache using the same classification logic as the existing status sort.

Unified grouped rendering (line ~6381): All three group types use with controlled open/close. Status groups appear in fixed priority order (error, printing, paused, finished, idle, offline) with matching colored dots. "Select All" buttons use e.stopPropagation() to avoid toggling collapse.

Screenshots

2026-04-14_04-12-42

Testing

  • I have tested this on my local machine
  • I have tested with my printer model:

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/968 **Author:** [@cadtoolbox](https://github.com/cadtoolbox) **Created:** 4/14/2026 **Status:** ✅ Merged **Merged:** 4/15/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `dev` ← **Head:** `feature_printer-folders` --- ### 📝 Commits (10+) - [`9ab8ffd`](https://github.com/maziggy/bambuddy/commit/9ab8ffdbe67b467fa7781adaeaca55a83b6e674b) Feature: Collapsible folders for printer filters - [`fd9d42c`](https://github.com/maziggy/bambuddy/commit/fd9d42c1dec6a0e79db9767d37a6752f6bae14c1) Feature: Collapsible folders for printer filters - [`d4b0524`](https://github.com/maziggy/bambuddy/commit/d4b0524b9074f22d79d4cc8988b8ffcb679fd7ca) Rebased + PR comments - [`a401620`](https://github.com/maziggy/bambuddy/commit/a4016204f11a8b6e95f5dc236e402bf589f26728) Feature: Collapsible grouped sections for printer filters - [`f5929e0`](https://github.com/maziggy/bambuddy/commit/f5929e0fed28b4b47e12854399fb19012b384dad) Merge branch 'dev' into feature_printer-folders - [`20518d0`](https://github.com/maziggy/bambuddy/commit/20518d0e944a16ba708400e25a64e86655ec020b) Merge branch 'dev' into feature_printer-folders - [`9d7b393`](https://github.com/maziggy/bambuddy/commit/9d7b393c5ef55f92198071858d94df24b3307739) Merge branch 'dev' into feature_printer-folders - [`812d965`](https://github.com/maziggy/bambuddy/commit/812d96558579cbbd7c01a68ccc47bfda5fbc8a40) Merge branch 'dev' into feature_printer-folders - [`a90f628`](https://github.com/maziggy/bambuddy/commit/a90f6281a4957dad922bef0f92361a9c886ad2e7) Updated for PR #968 Comments - [`a6af07c`](https://github.com/maziggy/bambuddy/commit/a6af07ca79001d30ee4c63bc297ab21d3bc46f8b) Merge branch 'dev' into feature_printer-folders ### 📊 Changes **3 files changed** (+198 additions, -82 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/BulkPrinterToolbar.tsx` (+1 -1) 📝 `frontend/src/components/Collapsible.tsx` (+34 -12) 📝 `frontend/src/pages/PrintersPage.tsx` (+163 -69) </details> ### 📄 Description ## Description <!-- Provide a brief description of your changes --> Name sort: flat grid (unchanged) Status/Model/Location sort: grouped sections with chevron toggle, click header to collapse/expand Collapse state persists across page refreshes via localStorage All sections start expanded by default ## Related Issue <!-- Link to the issue this PR addresses (if applicable) --> Fixes #966 ## Documentation <!-- If this PR changes user-visible behavior, config keys, ports, CLI flags, URLs, or installation steps, link matching PRs in the docs repos below. Internal refactors, bug fixes with no observable change, and test-only changes are exempt — just check the "not required" box and say why. See CONTRIBUTING.md → Documentation Requirements for the full rules. --> **Companion docs PRs** (delete lines that don't apply): **Pick one**: - [ ] Docs PR(s) linked above - [X] No docs update required — reason: No feature changes ## Type of Change <!-- Mark the relevant option with an "x" --> - [ ] Bug fix (non-breaking change that fixes an issue) - [X] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test addition or update ## Changes Made <!-- List the specific changes made in this PR --> [Collapsible.tsx] — Added controlled mode support: New optional open and onToggle props When open is provided, parent controls the state; otherwise uses internal state (backwards-compatible) [PrintersPage.tsx] — Four changes: Constants (line ~990): STATUS_GROUP_ORDER (priority order for status groups) and STATUS_GROUP_META (maps each status to its i18n label key and dot color class) State & callbacks (line ~5647, ~6101): collapsedSections state persisted to localStorage (printerCollapsedSections) toggleSectionCollapse() to toggle a section's collapsed state selectByModel() for bulk-selecting all printers in a model group Generalized groupedPrinters useMemo (line ~6119): Now activates for status, model, and location sorts (not just location). Status grouping reads from the query cache using the same classification logic as the existing status sort. Unified grouped rendering (line ~6381): All three group types use <Collapsible> with controlled open/close. Status groups appear in fixed priority order (error, printing, paused, finished, idle, offline) with matching colored dots. "Select All" buttons use e.stopPropagation() to avoid toggling collapse. ## Screenshots <!-- If applicable, add screenshots to demonstrate your changes --> <img width="2448" height="574" alt="2026-04-14_04-12-42" src="https://github.com/user-attachments/assets/75f2038c-8cb5-4765-b99e-363a1161c00f" /> ## Testing <!-- Describe how you tested your changes --> - [X] I have tested this on my local machine - [ ] I have tested with my printer model: <!-- e.g., X1C, P1S, A1 --> ## Checklist - [X] My code follows the project's coding style - [X] I have commented my code where necessary - [X] My changes generate no new warnings - [X] I have tested my changes thoroughly ## Additional Notes <!-- Add any additional information that reviewers should know --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:16:17 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#1148
No description provided.