feat(tasks): остаток времени, прогресс и состояние таймера в виджете «Идёт сейчас» - #24
Merged
Merged
Conversation
added 2 commits
August 13, 2026 15:30
The widget answered "what am I on" but not "for how long" — the thing you actually open it for — so you still had to go to the calendar. Each row now carries the remaining time, a progress bar, and the pomodoro count, with a left accent bar echoing the calendar's current-time line. The window maths moved into a private getWindow(), so the active-task filter and the progress readout are built on one definition and cannot disagree. Header is now "Идёт сейчас": the old "Текущая задача" was singular while the list can hold several rows. Rows carry a border rather than relying on bg-sidebar-accent/40 alone — in light mode that fill sat within 1.7% of the sidebar background (0.968 vs 0.985 oklch) and the rows were effectively invisible. The play button keeps its 32px visual size but expands to a 44px hit area via ::before, and the progress fill honours prefers-reduced-motion.
The row now says whether the timer is on this task — a red pulsing "идёт" while it ticks, a muted "пауза" while it is armed but stopped. This is not only a label: the play button is removed in the running state because startTask() rewinds to the first phase, so a stray click on a live task would discard the pomodoros already worked. The paused state keeps a button, which resumes via toggleTimer instead of restarting. That matters because startTask only *arms* a session — ticking starts separately — so a row lands in `paused` immediately after the widget's own play click. Dropping the button there would have made the widget unable to start a timer at all. timer-store now exposes activeTaskId; without it a row cannot tell "running" from "running on something else".
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Продолжение #22. Виджет там уже работал, но выглядел бедно и не показывал, что помодоро запущен.
Остаток времени и прогресс
Раньше строка говорила только название. Но смотрят на «текущую задачу» ради ответа «сколько ещё» — за ним всё равно приходилось идти в календарь. Теперь строка несёт остаток, долю пройденного окна и счётчик помидоров, а левая полоса делает блок похожим на линию текущего времени в календаре, а не на ещё один список.
Заголовок сменил число: «Текущая задача» врало, когда активных задач несколько.
Окно задачи переехало в приватный
getWindow(), на котором построены и фильтр активных задач, и расчёт прогресса — разойтись они теперь не могут.Состояние таймера в строке
toggleTimerstartTaskКнопка убрана в «идёт» не ради вида.
startTaskначинает сессию с первой фазы, поэтому случайный клик по идущей задаче стирал бы уже отработанные помидоры. Такая возможность существовала до этого PR.А в «паузе» кнопка обязана остаться. Это вскрылось на упавшем тесте:
startTaskтолько взводит сессию, тикать она начинает отдельно — так же ведут себя обе существующие кнопки в приложении. Значит сразу после клика по кнопке виджета строка попадает именно в «паузу», и если бы кнопка там пропадала, запустить таймер из виджета стало бы невозможно.timer-storeначал отдаватьactiveTaskId: без него строка не отличает «идёт» от «идёт по другой задаче».Контраст в светлой теме
Строки были почти невидимы:
bg-sidebar-accent/40давалoklch(0.968)против фона сайдбараoklch(0.985)— разница меньше двух процентов. Замерено в браузере, добавлен бордер. Вторичный текст проверен отдельно: контраст ≈5:1, порог проходит.Кнопка визуально осталась 32px, но тач-таргет расширен до 44×44 через
::before, чтобы не разрежать плотный сайдбар. Прогресс-бар и пульсация уважаютprefers-reduced-motion; прогресс скрыт от скринридеров, потому что текст рядом говорит то же самое.Проверено
vue-tscчисто, сборка проходитЗаметка про ветку
Коммиты изначально ушли в
feat/sidebar-current-task-widgetуже после того, как #22 был смержен, поэтому в main не попали. Здесь они вынесены в отдельную ветку и перебазированы на актуальный main.