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

[PR #412] [MERGED] refactor(utils): consolidate date and file size formatting #1036

Closed
opened 2026-05-07 00:15:37 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/412
Author: @aneopsy
Created: 2/17/2026
Status: Merged
Merged: 2/18/2026
Merged by: @maziggy

Base: 0.2.1bHead: refactor-all-pages


📝 Commits (10+)

  • b477fbf Refactors date and file formatting utilities
  • 59fd7a3 Merge remote-tracking branch 'upstream/0.2.0b' into refactor-all-pages
  • 82b3d5f fix
  • 2462659 Merge branch '0.2.0b' into refactor-all-pages
  • 4af9964 Merge branch '0.2.1b' into refactor-all-pages
  • f38aced Merge branch '0.2.1b' into refactor-all-pages
  • 3a02872 Merge remote-tracking branch 'upstream/0.2.1b' into refactor-all-pages
  • d9dd15d fix(ui): storage size formatting, overdue queue items, and i18n fixes
  • 397e21e Merge branch '0.2.1b' into refactor-all-pages
  • fa4bb4f Fix missing newline at end of file.test.ts

📊 Changes

19 files changed (+659 additions, -115 deletions)

View changed files

📝 frontend/src/__tests__/components/FileManagerModal.test.tsx (+3 -3)
📝 frontend/src/__tests__/components/PrinterQueueWidget.test.tsx (+2 -2)
frontend/src/__tests__/utils/date.test.ts (+437 -0)
frontend/src/__tests__/utils/file.test.ts (+43 -0)
📝 frontend/src/components/FileManagerModal.tsx (+2 -8)
📝 frontend/src/components/GitHubBackupSettings.tsx (+3 -25)
📝 frontend/src/components/PendingUploadsPanel.tsx (+1 -6)
📝 frontend/src/components/PrinterQueueWidget.tsx (+2 -16)
📝 frontend/src/i18n/locales/de.ts (+14 -0)
📝 frontend/src/i18n/locales/en.ts (+14 -0)
📝 frontend/src/i18n/locales/fr.ts (+14 -0)
📝 frontend/src/i18n/locales/it.ts (+14 -0)
📝 frontend/src/i18n/locales/ja.ts (+14 -0)
📝 frontend/src/pages/ArchivesPage.tsx (+1 -6)
📝 frontend/src/pages/FileManagerPage.tsx (+1 -8)
📝 frontend/src/pages/ProfilesPage.tsx (+2 -19)
📝 frontend/src/pages/QueuePage.tsx (+8 -19)
📝 frontend/src/utils/date.ts (+64 -3)
frontend/src/utils/file.ts (+20 -0)

📄 Description

Description

Refactors date and file formatting utilities (frontend/src/utils)

Extracts formatting logic into dedicated utility functions to improve
code maintainability and consistency across components.

Changes:

  • Consolidate date formatting function formatRelativeTime
  • Consolidate file size formatting into single formatFileSize utility
  • Fix file size calculation errors
  • Update UI components to use new utilities
  • Change unscheduled job status from "ASAP" to "Waiting" (pending user start)
  • Use Translation in formatRelativeTime

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

Testing

  • Add comprehensive unit tests for date utilities

  • Add unit tests for file size formatting

  • I have tested this on my local machine

  • I have tested with my printer model: X1C, H2S

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

🔄 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/412 **Author:** [@aneopsy](https://github.com/aneopsy) **Created:** 2/17/2026 **Status:** ✅ Merged **Merged:** 2/18/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `0.2.1b` ← **Head:** `refactor-all-pages` --- ### 📝 Commits (10+) - [`b477fbf`](https://github.com/maziggy/bambuddy/commit/b477fbf46dca9bc88142fbd5658bba7e673077b0) Refactors date and file formatting utilities - [`59fd7a3`](https://github.com/maziggy/bambuddy/commit/59fd7a3b5c474aa1cb3902f0b59e61b701b5eea2) Merge remote-tracking branch 'upstream/0.2.0b' into refactor-all-pages - [`82b3d5f`](https://github.com/maziggy/bambuddy/commit/82b3d5f23e4591786c04990ff1cf18d94e5adfa6) fix - [`2462659`](https://github.com/maziggy/bambuddy/commit/2462659a61a3c8c8c3b276fd9928ffec3a79e377) Merge branch '0.2.0b' into refactor-all-pages - [`4af9964`](https://github.com/maziggy/bambuddy/commit/4af99641bc9cc4d07f8fefbfa59061fb48b92975) Merge branch '0.2.1b' into refactor-all-pages - [`f38aced`](https://github.com/maziggy/bambuddy/commit/f38aced4639b5f5fcf1810e4e7178d6bcb1fd3fd) Merge branch '0.2.1b' into refactor-all-pages - [`3a02872`](https://github.com/maziggy/bambuddy/commit/3a028724a8cd00413b0411a95eb1dd7e1eb6d3f0) Merge remote-tracking branch 'upstream/0.2.1b' into refactor-all-pages - [`d9dd15d`](https://github.com/maziggy/bambuddy/commit/d9dd15dbff7ccd9b350a348419d1e4905fc41cd9) fix(ui): storage size formatting, overdue queue items, and i18n fixes - [`397e21e`](https://github.com/maziggy/bambuddy/commit/397e21ec296ff3f3ee0aada480d4af1dfcf10f4d) Merge branch '0.2.1b' into refactor-all-pages - [`fa4bb4f`](https://github.com/maziggy/bambuddy/commit/fa4bb4fd5c10e5ff0d1c02e2471be952148a6d0c) Fix missing newline at end of file.test.ts ### 📊 Changes **19 files changed** (+659 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/__tests__/components/FileManagerModal.test.tsx` (+3 -3) 📝 `frontend/src/__tests__/components/PrinterQueueWidget.test.tsx` (+2 -2) ➕ `frontend/src/__tests__/utils/date.test.ts` (+437 -0) ➕ `frontend/src/__tests__/utils/file.test.ts` (+43 -0) 📝 `frontend/src/components/FileManagerModal.tsx` (+2 -8) 📝 `frontend/src/components/GitHubBackupSettings.tsx` (+3 -25) 📝 `frontend/src/components/PendingUploadsPanel.tsx` (+1 -6) 📝 `frontend/src/components/PrinterQueueWidget.tsx` (+2 -16) 📝 `frontend/src/i18n/locales/de.ts` (+14 -0) 📝 `frontend/src/i18n/locales/en.ts` (+14 -0) 📝 `frontend/src/i18n/locales/fr.ts` (+14 -0) 📝 `frontend/src/i18n/locales/it.ts` (+14 -0) 📝 `frontend/src/i18n/locales/ja.ts` (+14 -0) 📝 `frontend/src/pages/ArchivesPage.tsx` (+1 -6) 📝 `frontend/src/pages/FileManagerPage.tsx` (+1 -8) 📝 `frontend/src/pages/ProfilesPage.tsx` (+2 -19) 📝 `frontend/src/pages/QueuePage.tsx` (+8 -19) 📝 `frontend/src/utils/date.ts` (+64 -3) ➕ `frontend/src/utils/file.ts` (+20 -0) </details> ### 📄 Description ## Description Refactors date and file formatting utilities (frontend/src/utils) Extracts formatting logic into dedicated utility functions to improve code maintainability and consistency across components. Changes: - Consolidate date formatting function *formatRelativeTime* - Consolidate file size formatting into single *formatFileSize* utility - Fix file size calculation errors - Update UI components to use new utilities - Change unscheduled job status from "ASAP" to "Waiting" (pending user start) - Use Translation in *formatRelativeTime* ## Type of Change <!-- Mark the relevant option with an "x" --> - [ ] 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 - [x] Code refactoring - [ ] Performance improvement - [ ] Test addition or update ## Testing - Add comprehensive unit tests for date utilities - Add unit tests for file size formatting - [x] I have tested this on my local machine - [x] I have tested with my printer model: X1C, H2S ## Checklist - [x] My code follows the project's coding style - [x] I have commented my code where necessary - [x] I have updated the documentation (if needed) - [x] My changes generate no new warnings - [x] I have tested my changes thoroughly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:15:37 +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#1036
No description provided.