From 92e97a630d8f28f7e9fd1079813df4228f42601d Mon Sep 17 00:00:00 2001 From: maziggy Date: Mon, 27 Apr 2026 19:16:36 +0200 Subject: [PATCH] chore: drop noisy embedded-settings warning toast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SliceJobTrackerContext was emitting a yellow warning toast on every completed slice whose result carried `used_embedded_settings: true` (the auto-fallback path that fires when the sidecar's --load-settings triplet rejected the input). For 3MF inputs that fallback fires on essentially every slice in production. End-to-end debugging via the new sidecar stderr capture showed the BambuStudio CLI segfaults silently after one trace line ("Initializing StaticPrintConfigs") when given --load-settings over a 3MF — even with the broader strip applied. So the toast fired on ~every completed 3MF slice and added noise without an actionable path for the user. Drop the toast call, drop the now-orphan slice.fallbackUsedEmbedded i18n key from all 8 locale files. The `used_embedded_settings` flag still lands on SliceResponse / SliceArchiveResponse for tests and observability (test_library_slice_api.py:347 continues to pin it); only the user-facing toast goes. --- CHANGELOG.md | 2 ++ frontend/src/contexts/SliceJobTrackerContext.tsx | 8 +++++--- frontend/src/i18n/locales/de.ts | 1 - frontend/src/i18n/locales/en.ts | 1 - frontend/src/i18n/locales/fr.ts | 1 - frontend/src/i18n/locales/it.ts | 1 - frontend/src/i18n/locales/ja.ts | 1 - frontend/src/i18n/locales/pt-BR.ts | 1 - frontend/src/i18n/locales/zh-CN.ts | 1 - frontend/src/i18n/locales/zh-TW.ts | 1 - 10 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 427257085..fb31d605b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ All notable changes to Bambuddy will be documented in this file. - **Inventory: "Delete Tag" button renamed to "Clear RFID Tag"** ([#729](https://github.com/maziggy/bambuddy/issues/729) follow-up) — The reporter mistook the button for a taxonomy-tag delete (it actually clears the RFID tag UID/UUID off the spool record so the row can be re-attached to a different physical spool). Renaming it to "Clear RFID Tag" + the success toast to "RFID tag cleared" removes the ambiguity. No behaviour change. Localised across all 8 UI languages with full translations. - **Nozzle icon on the dual-nozzle status card** ([#1115](https://github.com/maziggy/bambuddy/issues/1115)) — the dual-nozzle active-extruder card on the printer status bar was the only card in that row without a theme icon (the Nozzle/Bed/Chamber temperature cards all carry a thermometer icon), which left the row looking visually uneven on H2D / H2S / H2C. Adds a small schematic nozzle icon (filament body + heater block + tip) above the L/R diameter labels, styled in amber-400 to match the card's active-extruder accent. SVG design contributed by @m4rtini2. +- **Slice tracker no longer shows the "embedded settings used" warning toast** — `SliceJobTrackerContext` was emitting a yellow warning toast on every completed slice whose result carried `used_embedded_settings: true` (the auto-fallback path that fires when the sidecar's `--load-settings` triplet rejected the input). For 3MF inputs that fallback fires on essentially every slice in production (BambuStudio CLI segfaults silently on `--load-settings` over 3MF, even with the broader strip applied — verified end-to-end with the new sidecar stderr capture), so the toast was firing on essentially every completed slice and adding noise without a useful action. The `used_embedded_settings` flag still lands on `SliceResponse` / `SliceArchiveResponse` for tests + observability (`test_library_slice_api.py:347` continues to pin it); only the user-facing toast goes. `slice.fallbackUsedEmbedded` removed from all 8 locale files in the same change. + - **Settings page: permission-gated instead of admin-only** — the Settings sidebar entry has always been visible to any user holding `settings:read`, but the route guard required admin role, so a non-admin with `settings:read` would see the entry, click it, and get silently redirected back to the dashboard. The route guard now matches the sidebar: any user with `settings:read` can open the page, and the individual tabs / cards continue to enforce their own per-feature permissions (`users:read`, `groups:update`, `oidc:*`, etc. — many of them admin-only, some not). Group editor routes moved to permission-based guards too (`groups:create` for `/groups/new`, `groups:update` for `/groups/:id/edit`), so permission delegation works end-to-end. Admins retain full access since admins implicitly hold every permission. ### Added diff --git a/frontend/src/contexts/SliceJobTrackerContext.tsx b/frontend/src/contexts/SliceJobTrackerContext.tsx index 7d4e2da04..52a3dd0f4 100644 --- a/frontend/src/contexts/SliceJobTrackerContext.tsx +++ b/frontend/src/contexts/SliceJobTrackerContext.tsx @@ -52,9 +52,11 @@ export function SliceJobTrackerProvider({ children }: { children: ReactNode }) { setActiveJobs((prev) => prev.filter((j) => j.id !== job.id)); if (state.status === 'completed') { - if (state.result?.used_embedded_settings) { - showToast(t('slice.fallbackUsedEmbedded'), 'warning'); - } + // `used_embedded_settings` still comes back on the result for tests + // and observability, but the warning toast that surfaced it was + // firing on essentially every slice (3MF inputs trigger the + // embedded-settings fallback as a normal path) and just added + // noise — see the trailing yellow toast complaint, removed. showToast( t('slice.completedToast', 'Sliced {{name}}', { name: job.sourceName }), 'success', diff --git a/frontend/src/i18n/locales/de.ts b/frontend/src/i18n/locales/de.ts index 58381b984..ca167db31 100644 --- a/frontend/src/i18n/locales/de.ts +++ b/frontend/src/i18n/locales/de.ts @@ -3253,7 +3253,6 @@ export default { selectPreset: '— Profil auswählen —', loadingPresets: 'Profile werden geladen…', presetsLoadFailed: 'Profile konnten nicht geladen werden. Importiere sie zuerst unter Einstellungen → Profile.', - fallbackUsedEmbedded: 'Slicer hat die gewählten Profile abgelehnt — stattdessen wurden die im Modell eingebetteten Einstellungen verwendet.', enqueuing: 'Slice-Auftrag wird übermittelt…', queued: 'In Warteschlange…', failed: 'Slicen fehlgeschlagen. Logs des Slicer-Sidecars prüfen.', diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index c7b3a3934..8e5fd479f 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -3256,7 +3256,6 @@ export default { selectPreset: '— Select a preset —', loadingPresets: 'Loading presets…', presetsLoadFailed: 'Failed to load presets. Open Settings → Profiles to import them first.', - fallbackUsedEmbedded: "Slicer rejected the chosen profiles for this model — used the file's embedded settings instead.", enqueuing: 'Submitting slice job…', queued: 'Queued…', failed: 'Slicing failed. Check the slicer sidecar logs.', diff --git a/frontend/src/i18n/locales/fr.ts b/frontend/src/i18n/locales/fr.ts index 73448a012..6f28cefc9 100644 --- a/frontend/src/i18n/locales/fr.ts +++ b/frontend/src/i18n/locales/fr.ts @@ -3175,7 +3175,6 @@ export default { selectPreset: '— Select a preset —', loadingPresets: 'Loading presets…', presetsLoadFailed: 'Failed to load presets. Open Settings → Profiles to import them first.', - fallbackUsedEmbedded: "Slicer rejected the chosen profiles for this model — used the file's embedded settings instead.", enqueuing: 'Submitting slice job…', queued: 'Queued…', failed: 'Slicing failed. Check the slicer sidecar logs.', diff --git a/frontend/src/i18n/locales/it.ts b/frontend/src/i18n/locales/it.ts index 0f3b0d2ab..dbb47ba9e 100644 --- a/frontend/src/i18n/locales/it.ts +++ b/frontend/src/i18n/locales/it.ts @@ -3174,7 +3174,6 @@ export default { selectPreset: '— Select a preset —', loadingPresets: 'Loading presets…', presetsLoadFailed: 'Failed to load presets. Open Settings → Profiles to import them first.', - fallbackUsedEmbedded: "Slicer rejected the chosen profiles for this model — used the file's embedded settings instead.", enqueuing: 'Submitting slice job…', queued: 'Queued…', failed: 'Slicing failed. Check the slicer sidecar logs.', diff --git a/frontend/src/i18n/locales/ja.ts b/frontend/src/i18n/locales/ja.ts index 9c98478ab..85cc4ee65 100644 --- a/frontend/src/i18n/locales/ja.ts +++ b/frontend/src/i18n/locales/ja.ts @@ -3213,7 +3213,6 @@ export default { selectPreset: '— Select a preset —', loadingPresets: 'Loading presets…', presetsLoadFailed: 'Failed to load presets. Open Settings → Profiles to import them first.', - fallbackUsedEmbedded: "Slicer rejected the chosen profiles for this model — used the file's embedded settings instead.", enqueuing: 'Submitting slice job…', queued: 'Queued…', failed: 'Slicing failed. Check the slicer sidecar logs.', diff --git a/frontend/src/i18n/locales/pt-BR.ts b/frontend/src/i18n/locales/pt-BR.ts index 21aeb0b79..a8a3c66fb 100644 --- a/frontend/src/i18n/locales/pt-BR.ts +++ b/frontend/src/i18n/locales/pt-BR.ts @@ -3188,7 +3188,6 @@ export default { selectPreset: '— Select a preset —', loadingPresets: 'Loading presets…', presetsLoadFailed: 'Failed to load presets. Open Settings → Profiles to import them first.', - fallbackUsedEmbedded: "Slicer rejected the chosen profiles for this model — used the file's embedded settings instead.", enqueuing: 'Submitting slice job…', queued: 'Queued…', failed: 'Slicing failed. Check the slicer sidecar logs.', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index 86b36e225..56730dd93 100644 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -3240,7 +3240,6 @@ export default { selectPreset: '— Select a preset —', loadingPresets: 'Loading presets…', presetsLoadFailed: 'Failed to load presets. Open Settings → Profiles to import them first.', - fallbackUsedEmbedded: "Slicer rejected the chosen profiles for this model — used the file's embedded settings instead.", enqueuing: 'Submitting slice job…', queued: 'Queued…', failed: 'Slicing failed. Check the slicer sidecar logs.', diff --git a/frontend/src/i18n/locales/zh-TW.ts b/frontend/src/i18n/locales/zh-TW.ts index ad9f57dda..a8c69a92d 100644 --- a/frontend/src/i18n/locales/zh-TW.ts +++ b/frontend/src/i18n/locales/zh-TW.ts @@ -3240,7 +3240,6 @@ export default { selectPreset: '— Select a preset —', loadingPresets: 'Loading presets…', presetsLoadFailed: 'Failed to load presets. Open Settings → Profiles to import them first.', - fallbackUsedEmbedded: "Slicer rejected the chosen profiles for this model — used the file's embedded settings instead.", enqueuing: 'Submitting slice job…', queued: 'Queued…', failed: 'Slicing failed. Check the slicer sidecar logs.',