Add first layer complete notification with camera snapshot (#679)

Notify users when the first layer finishes printing so they can check
  adhesion remotely. Triggers once per print when layer 2 begins
  (layer_num >= 2, capped at <= 5 to handle reconnects). Includes a
  camera snapshot attachment. Adds the on_first_layer_complete toggle
  to all notification providers, with backend/frontend/i18n support
  across all 7 locales.
This commit is contained in:
maziggy
2026-03-13 10:53:21 +01:00
parent 685d04df67
commit 0b6facc91c
26 changed files with 426 additions and 71 deletions
@@ -158,6 +158,9 @@ export function NotificationProviderCard({ provider, onEdit }: NotificationProvi
{provider.on_bed_cooled && (
<span className="px-2 py-0.5 bg-teal-500/20 text-teal-400 text-xs rounded">{t('notifications.bedCooled')}</span>
)}
{provider.on_first_layer_complete && (
<span className="px-2 py-0.5 bg-emerald-600/20 text-emerald-300 text-xs rounded">{t('notifications.firstLayer')}</span>
)}
{provider.quiet_hours_enabled && (
<span className="px-2 py-0.5 bg-indigo-500/20 text-indigo-400 text-xs rounded flex items-center gap-1">
<Moon className="w-3 h-3" />
@@ -282,6 +285,17 @@ export function NotificationProviderCard({ provider, onEdit }: NotificationProvi
/>
</div>
<div className="flex items-center justify-between">
<div>
<p className="text-sm text-white">{t('notifications.firstLayerCompleteLabel')}</p>
<p className="text-xs text-bambu-gray">{t('notifications.firstLayerCompleteDescription')}</p>
</div>
<Toggle
checked={provider.on_first_layer_complete ?? false}
onChange={(checked) => updateMutation.mutate({ on_first_layer_complete: checked })}
/>
</div>
<div className="flex items-center justify-between">
<p className="text-sm text-white">{t('notifications.printFailed')}</p>
<Toggle