From 1aef1d882be558c80299d3829a1fd03491762ba6 Mon Sep 17 00:00:00 2001 From: mzspicoli Date: Wed, 26 Aug 2026 07:27:42 +0200 Subject: [PATCH] feat(timer): add opt-in visual completion flash --- frontend/src/App.jsx | 2 ++ frontend/src/components/TimerFlash.jsx | 8 ++++++ frontend/src/index.css | 13 +++++++++ frontend/src/lib/pt-br-locale.test.js | 2 +- frontend/src/locales/de.js | 1 + frontend/src/locales/es.js | 1 + frontend/src/locales/fr.js | 1 + frontend/src/locales/hi.js | 1 + frontend/src/locales/it.js | 1 + frontend/src/locales/ko.js | 1 + frontend/src/locales/pl.js | 1 + frontend/src/locales/pt-BR.js | 1 + frontend/src/locales/pt.js | 1 + frontend/src/locales/ru.js | 1 + frontend/src/locales/tr.js | 1 + frontend/src/locales/zh.js | 1 + frontend/src/store/useStore.js | 2 +- frontend/src/store/useUI.js | 10 +++++-- frontend/src/store/useUI.test.js | 39 ++++++++++++++++++++++++++ frontend/src/views/Settings.jsx | 3 ++ 20 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 frontend/src/components/TimerFlash.jsx diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 04487c7..84d9d69 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -15,6 +15,7 @@ import ErrorBoundary from './components/ErrorBoundary.jsx' import Modals from './components/Modals.jsx' import Toast from './components/Toast.jsx' import RestTimer from './components/RestTimer.jsx' +import TimerFlash from './components/TimerFlash.jsx' import Login from './views/Login.jsx' import MobileOnboarding from './views/MobileOnboarding.jsx' import Home from './views/Home.jsx' @@ -103,6 +104,7 @@ function Shell() { + ) } diff --git a/frontend/src/components/TimerFlash.jsx b/frontend/src/components/TimerFlash.jsx new file mode 100644 index 0000000..f620237 --- /dev/null +++ b/frontend/src/components/TimerFlash.jsx @@ -0,0 +1,8 @@ +import { useUI } from '../store/useUI.js' + +// A new key restarts the CSS sequence even when two timers finish close together. +// The layer never catches taps and ends transparent, so it can safely stay mounted. +export default function TimerFlash() { + const id = useUI(s => s.timerFlashId) + return id ?