Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
544db9cb04 | ||
|
|
84b2bbf0a6 | ||
|
|
ea052f64b8 | ||
|
|
cde8334c73 |
44
CHANGELOG.md
44
CHANGELOG.md
@@ -6,6 +6,42 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.6.5] — 2026-06-07
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Главный экран переосмыслен как обзор действий: верхний заголовок теперь
|
||||||
|
показывает текущее состояние (`пора сделать`, `следующее`, `встреча`,
|
||||||
|
`пауза`, `план под контролем`) вместо абстрактного “Сегодня”.
|
||||||
|
- Добавлены тесты для Windows autostart и для того, что Discord не считается
|
||||||
|
активной встречей.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Пункт главной навигации переименован с “Сегодня” на “Обзор”.
|
||||||
|
- Тексты meeting auto-pause стали нейтральнее: “Встреча активна”, без
|
||||||
|
формулировки “Не дёргаем — ты на встрече”.
|
||||||
|
- Discord убран из списка приложений, которые ставят напоминания на паузу.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Исправлена проверка `Запускать с Windows`: чтение login item теперь использует
|
||||||
|
тот же `path` и `--hidden`, что и запись через `setLoginItemSettings`.
|
||||||
|
|
||||||
|
## [0.6.4] — 2026-06-07
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- На страницах `Упражнения`, `Питание`, `Игры`, `Челленджи` и `Настройки`
|
||||||
|
добавлены верхние сводные карточки: активные элементы, нагрузка, цели,
|
||||||
|
ближайшее питание, состояние игровых интеграций и ключевые настройки.
|
||||||
|
- Добавлен общий `PageScaffold` для единых заголовков и insight-карточек в renderer.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Видимый бренд в интерфейсе сменен с “Не Залипай” на “Разомнись”.
|
||||||
|
- README, title, release notes и описание пакета обновлены под новое название.
|
||||||
|
|
||||||
## [0.6.3] — 2026-06-07
|
## [0.6.3] — 2026-06-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -118,7 +154,7 @@ clearHistory/import`, Dashboard на него подписан.
|
|||||||
с success-зелёным цветом, а не запутанный обратный отсчёт до завтра.
|
с success-зелёным цветом, а не запутанный обратный отсчёт до завтра.
|
||||||
- **Авто-пауза на ВКС видна в Dashboard.** Раньше fires пропускались
|
- **Авто-пауза на ВКС видна в Dashboard.** Раньше fires пропускались
|
||||||
молча — пользователь не понимал почему через 12 мин ничего не пришло.
|
молча — пользователь не понимал почему через 12 мин ничего не пришло.
|
||||||
Сейчас info-баннер «Не дёргаем — ты на встрече» с указанием закрыть
|
Сейчас info-баннер активной встречи с указанием закрыть
|
||||||
Zoom/Teams/etc.
|
Zoom/Teams/etc.
|
||||||
- **Native `window.confirm()` → iOS-style ConfirmModal** в restore-операции.
|
- **Native `window.confirm()` → iOS-style ConfirmModal** в restore-операции.
|
||||||
Раньше всплывал серый системный диалог.
|
Раньше всплывал серый системный диалог.
|
||||||
@@ -175,7 +211,7 @@ clearHistory/import`, Dashboard на него подписан.
|
|||||||
Когда total reps за сегодня (с actualReps) ≥ dailyGoal → scheduler
|
Когда total reps за сегодня (с actualReps) ≥ dailyGoal → scheduler
|
||||||
переносит fire на завтра. История = source of truth.
|
переносит fire на завтра. История = source of truth.
|
||||||
- **Авто-пауза на ВКС** (#5) — сканирует процессы tasklist'ом раз в
|
- **Авто-пауза на ВКС** (#5) — сканирует процессы tasklist'ом раз в
|
||||||
30с: Zoom/Teams (старый+new)/Discord/Webex/Slack/Skype/Meet/Whereby/
|
30с: Zoom/Teams (старый+new)/Webex/Slack/Skype/Meet/Whereby/
|
||||||
GoToMeeting. Если запущен — fires не выполняются.
|
GoToMeeting. Если запущен — fires не выполняются.
|
||||||
- **Адаптивный шедулер** (#2) — opt-in флаг в exercise editor.
|
- **Адаптивный шедулер** (#2) — opt-in флаг в exercise editor.
|
||||||
Heuristic-модель строит hour-of-day success rate по 30 дням истории
|
Heuristic-модель строит hour-of-day success rate по 30 дням истории
|
||||||
@@ -491,7 +527,9 @@ days=[Mon..Fri]` теперь правильно проверяется день
|
|||||||
иконки), системный трей, автозапуск с Windows, native-уведомления,
|
иконки), системный трей, автозапуск с Windows, native-уведомления,
|
||||||
NSIS-инсталлятор, auto-update через electron-updater.
|
NSIS-инсталлятор, auto-update через electron-updater.
|
||||||
|
|
||||||
[Unreleased]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.6.3...HEAD
|
[Unreleased]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.6.5...HEAD
|
||||||
|
[0.6.5]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.6.4...v0.6.5
|
||||||
|
[0.6.4]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.6.3...v0.6.4
|
||||||
[0.6.3]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.6.2...v0.6.3
|
[0.6.3]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.6.2...v0.6.3
|
||||||
[0.6.2]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.5.8...v0.6.2
|
[0.6.2]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/compare/v0.5.8...v0.6.2
|
||||||
[0.5.8]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/releases/tag/v0.5.8
|
[0.5.8]: https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/releases/tag/v0.5.8
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -1,9 +1,9 @@
|
|||||||
# Не Залипай — Exercise Reminder
|
# Разомнись — Exercise Reminder
|
||||||
|
|
||||||
Windows desktop приложение, которое помогает не залипать за компьютером: держит план дня, напоминает размяться, ведёт недельные челленджи и превращает Dota 2 статистику после матча в игровые долги.
|
Windows desktop приложение, которое помогает делать короткие перерывы без потери фокуса: держит план дня, напоминает размяться, ведёт недельные челленджи и превращает Dota 2 статистику после матча в игровые долги.
|
||||||
|
|
||||||
[](https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/releases/latest)
|
[](https://git.xn--90adajar8af4h.xn--p1ai/AnRil/laude/releases/latest)
|
||||||
[]()
|
[]()
|
||||||
[]()
|
[]()
|
||||||
|
|
||||||
## Что внутри
|
## Что внутри
|
||||||
@@ -11,7 +11,7 @@ Windows desktop приложение, которое помогает не за
|
|||||||
- **Гибкие напоминания** — любое количество упражнений, интервал от минуты до часов, разные иконки.
|
- **Гибкие напоминания** — любое количество упражнений, интервал от минуты до часов, разные иконки.
|
||||||
- **Питание** — отдельная вкладка с приёмами пищи по времени суток (завтрак/обед/ужин/перекусы), выбор дней недели, пресеты быстрого добавления. Напоминания по настенным часам, а не по интервалу.
|
- **Питание** — отдельная вкладка с приёмами пищи по времени суток (завтрак/обед/ужин/перекусы), выбор дней недели, пресеты быстрого добавления. Напоминания по настенным часам, а не по интервалу.
|
||||||
- **История и стрики** — heatmap-календарь активности, ежедневный счётчик, серия дней подряд.
|
- **История и стрики** — heatmap-календарь активности, ежедневный счётчик, серия дней подряд.
|
||||||
- **Сегодня** — главный экран с планом дня, уровнем, недельными мини-челленджами и игровым долгом.
|
- **Обзор** — главный экран с ближайшим действием, планом дня, уровнем, недельными мини-челленджами и игровым долгом.
|
||||||
- **Тихие часы** — окно времени когда напоминания подавляются (например `22:00 → 08:00`), с выбором дней недели.
|
- **Тихие часы** — окно времени когда напоминания подавляются (например `22:00 → 08:00`), с выбором дней недели.
|
||||||
- **Сделал частично** — степпер `−/+` в окне напоминания: если ты сделал 5 из 10, в историю запишется честное число.
|
- **Сделал частично** — степпер `−/+` в окне напоминания: если ты сделал 5 из 10, в историю запишется честное число.
|
||||||
- **Игровая интеграция (Dota 2)** — Game State Integration читает статистику матча, после Победа/Поражение показывает экран с «причитающимися» повторениями (например `10 смертей × 3 = 30 приседаний`).
|
- **Игровая интеграция (Dota 2)** — Game State Integration читает статистику матча, после Победа/Поражение показывает экран с «причитающимися» повторениями (например `10 смертей × 3 = 30 приседаний`).
|
||||||
@@ -79,15 +79,16 @@ src/main/store.test.ts (12)
|
|||||||
src/renderer/src/lib/achievements.test.ts (10)
|
src/renderer/src/lib/achievements.test.ts (10)
|
||||||
src/shared/release-notes.test.ts (9)
|
src/shared/release-notes.test.ts (9)
|
||||||
src/shared/meals.test.ts (8)
|
src/shared/meals.test.ts (8)
|
||||||
src/main/meeting-detect.test.ts (7)
|
src/main/meeting-detect.test.ts (8)
|
||||||
src/shared/quiet-hours.test.ts (7)
|
src/shared/quiet-hours.test.ts (7)
|
||||||
src/main/adaptive.test.ts (6)
|
src/main/adaptive.test.ts (6)
|
||||||
src/renderer/src/lib/day-plan.test.ts (6)
|
src/renderer/src/lib/day-plan.test.ts (6)
|
||||||
src/shared/types.test.ts (4)
|
src/shared/types.test.ts (4)
|
||||||
src/renderer/src/lib/icon-choices.test.ts (4)
|
src/renderer/src/lib/icon-choices.test.ts (4)
|
||||||
src/renderer/src/lib/momentum.test.ts (3)
|
src/renderer/src/lib/momentum.test.ts (3)
|
||||||
|
src/main/autostart.test.ts (3)
|
||||||
──────────────────────────────────────────
|
──────────────────────────────────────────
|
||||||
241 ✓
|
245 ✓
|
||||||
```
|
```
|
||||||
|
|
||||||
Покрытие: IPC-валидация (упражнения/челленджи/приёмы пищи), persistence (миграции, карантин битого JSON, history cap), scheduler-гейтинг (тихие часы, ВКС-пауза, daily-goal), планирование приёмов пищи по времени суток (DST-safe), детект ВКС, история/стрики (DST), тихие часы (wrap), парсер VDF для Steam-конфигов, достижения, i18n с плюрализацией RU/EN, дефолты shared-типов.
|
Покрытие: IPC-валидация (упражнения/челленджи/приёмы пищи), persistence (миграции, карантин битого JSON, history cap), scheduler-гейтинг (тихие часы, ВКС-пауза, daily-goal), планирование приёмов пищи по времени суток (DST-safe), детект ВКС, история/стрики (DST), тихие часы (wrap), парсер VDF для Steam-конфигов, достижения, i18n с плюрализацией RU/EN, дефолты shared-типов.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "laude",
|
"name": "laude",
|
||||||
"version": "0.6.3",
|
"version": "0.6.5",
|
||||||
"description": "Не Залипай — Windows desktop rhythm and exercise reminder",
|
"description": "Разомнись — Windows desktop break and exercise reminder",
|
||||||
"main": "out/main/index.js",
|
"main": "out/main/index.js",
|
||||||
"author": "AnRil",
|
"author": "AnRil",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
73
src/main/autostart.test.ts
Normal file
73
src/main/autostart.test.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
|
const h = vi.hoisted(() => ({
|
||||||
|
app: {
|
||||||
|
setLoginItemSettings: vi.fn(),
|
||||||
|
getLoginItemSettings: vi.fn(() => ({ openAtLogin: false })),
|
||||||
|
wasOpenedAsHidden: false
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
vi.mock('electron', () => ({ app: h.app }))
|
||||||
|
|
||||||
|
const originalPlatform = process.platform
|
||||||
|
|
||||||
|
function setPlatform(platform: NodeJS.Platform): void {
|
||||||
|
Object.defineProperty(process, 'platform', {
|
||||||
|
value: platform,
|
||||||
|
configurable: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function load(): Promise<typeof import('./autostart')> {
|
||||||
|
vi.resetModules()
|
||||||
|
return import('./autostart')
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
setPlatform('win32')
|
||||||
|
h.app.setLoginItemSettings.mockClear()
|
||||||
|
h.app.getLoginItemSettings.mockReset()
|
||||||
|
h.app.getLoginItemSettings.mockReturnValue({ openAtLogin: false })
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
setPlatform(originalPlatform)
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('autostart', () => {
|
||||||
|
it('writes Windows login item with the hidden startup argument', async () => {
|
||||||
|
const { setAutostart } = await load()
|
||||||
|
|
||||||
|
setAutostart(true)
|
||||||
|
|
||||||
|
expect(h.app.setLoginItemSettings).toHaveBeenCalledWith({
|
||||||
|
openAtLogin: true,
|
||||||
|
openAsHidden: true,
|
||||||
|
path: process.execPath,
|
||||||
|
args: ['--hidden']
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('reads Windows login item using the same path and args', async () => {
|
||||||
|
h.app.getLoginItemSettings.mockReturnValue({ openAtLogin: true })
|
||||||
|
const { isAutostartEnabled } = await load()
|
||||||
|
|
||||||
|
expect(isAutostartEnabled()).toBe(true)
|
||||||
|
expect(h.app.getLoginItemSettings).toHaveBeenCalledWith({
|
||||||
|
path: process.execPath,
|
||||||
|
args: ['--hidden']
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('does nothing on non-Windows platforms', async () => {
|
||||||
|
setPlatform('linux')
|
||||||
|
const { setAutostart, isAutostartEnabled } = await load()
|
||||||
|
|
||||||
|
setAutostart(true)
|
||||||
|
|
||||||
|
expect(isAutostartEnabled()).toBe(false)
|
||||||
|
expect(h.app.setLoginItemSettings).not.toHaveBeenCalled()
|
||||||
|
expect(h.app.getLoginItemSettings).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -1,19 +1,29 @@
|
|||||||
import { app } from 'electron'
|
import { app } from 'electron'
|
||||||
|
|
||||||
const HIDDEN_FLAG = '--hidden'
|
const HIDDEN_FLAG = '--hidden'
|
||||||
|
type LoginItemOptions = NonNullable<
|
||||||
|
Parameters<typeof app.getLoginItemSettings>[0]
|
||||||
|
>
|
||||||
|
|
||||||
|
function loginItemOptions(): LoginItemOptions {
|
||||||
|
return {
|
||||||
|
path: process.execPath,
|
||||||
|
args: [HIDDEN_FLAG]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function setAutostart(enabled: boolean): void {
|
export function setAutostart(enabled: boolean): void {
|
||||||
if (process.platform !== 'win32') return
|
if (process.platform !== 'win32') return
|
||||||
app.setLoginItemSettings({
|
app.setLoginItemSettings({
|
||||||
|
...loginItemOptions(),
|
||||||
openAtLogin: enabled,
|
openAtLogin: enabled,
|
||||||
path: process.execPath,
|
openAsHidden: true
|
||||||
args: [HIDDEN_FLAG]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAutostartEnabled(): boolean {
|
export function isAutostartEnabled(): boolean {
|
||||||
if (process.platform !== 'win32') return false
|
if (process.platform !== 'win32') return false
|
||||||
return app.getLoginItemSettings().openAtLogin
|
return app.getLoginItemSettings(loginItemOptions()).openAtLogin
|
||||||
}
|
}
|
||||||
|
|
||||||
export function wasStartedHidden(): boolean {
|
export function wasStartedHidden(): boolean {
|
||||||
|
|||||||
@@ -84,13 +84,19 @@ describe('isMeetingActive', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('кэширует результат в пределах CACHE_MS (exec вызывается один раз)', async () => {
|
it('кэширует результат в пределах CACHE_MS (exec вызывается один раз)', async () => {
|
||||||
h.execImpl = (_c, _o, cb) => cb(null, { stdout: csv('discord.exe') })
|
h.execImpl = (_c, _o, cb) => cb(null, { stdout: csv('zoom.exe') })
|
||||||
const { isMeetingActive } = await load()
|
const { isMeetingActive } = await load()
|
||||||
await isMeetingActive()
|
await isMeetingActive()
|
||||||
await isMeetingActive()
|
await isMeetingActive()
|
||||||
expect(h.calls).toBe(1)
|
expect(h.calls).toBe(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('не считает Discord встречей', async () => {
|
||||||
|
h.execImpl = (_c, _o, cb) => cb(null, { stdout: csv('discord.exe') })
|
||||||
|
const { isMeetingActive } = await load()
|
||||||
|
expect(await isMeetingActive()).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
it('при падении tasklist возвращает false и логирует warn', async () => {
|
it('при падении tasklist возвращает false и логирует warn', async () => {
|
||||||
h.execImpl = (_c, _o, cb) => cb(new Error('ETIMEDOUT'))
|
h.execImpl = (_c, _o, cb) => cb(new Error('ETIMEDOUT'))
|
||||||
const { isMeetingActive } = await load()
|
const { isMeetingActive } = await load()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Эвристическое обнаружение «человек на ВКС» по списку запущенных процессов.
|
* Эвристическое обнаружение «человек на ВКС» по списку запущенных процессов.
|
||||||
*
|
*
|
||||||
* Идея: если запущен Zoom/Teams/Discord/Meet/Webex — пользователь скорее
|
* Идея: если запущен Zoom/Teams/Meet/Webex — пользователь скорее
|
||||||
* всего на встрече или собирается зайти. Останавливаем напоминания, чтобы
|
* всего на встрече или собирается зайти. Останавливаем напоминания, чтобы
|
||||||
* не прерывать. После «снятия» процессов возобновляем.
|
* не прерывать. После «снятия» процессов возобновляем.
|
||||||
*
|
*
|
||||||
@@ -36,7 +36,6 @@ const MEETING_PROCESSES = new Set([
|
|||||||
'zoom.exe',
|
'zoom.exe',
|
||||||
'teams.exe',
|
'teams.exe',
|
||||||
'ms-teams.exe', // новые Teams 2.0
|
'ms-teams.exe', // новые Teams 2.0
|
||||||
'discord.exe',
|
|
||||||
'webex.exe',
|
'webex.exe',
|
||||||
'webexmta.exe',
|
'webexmta.exe',
|
||||||
'meet.exe', // Google Meet desktop (редкость)
|
'meet.exe', // Google Meet desktop (редкость)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
content="default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' data:; script-src 'self'; connect-src 'self'; base-uri 'self'; frame-ancestors 'none'"
|
content="default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' data:; script-src 'self'; connect-src 'self'; base-uri 'self'; frame-ancestors 'none'"
|
||||||
/>
|
/>
|
||||||
<title>Не Залипай</title>
|
<title>Разомнись</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
103
src/renderer/src/components/PageScaffold.tsx
Normal file
103
src/renderer/src/components/PageScaffold.tsx
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import type { ReactNode } from 'react'
|
||||||
|
|
||||||
|
type Tone = 'accent' | 'success' | 'warning' | 'info' | 'muted'
|
||||||
|
|
||||||
|
export function PageHeader({
|
||||||
|
kicker,
|
||||||
|
title,
|
||||||
|
subtitle,
|
||||||
|
action
|
||||||
|
}: {
|
||||||
|
kicker: string
|
||||||
|
title: string
|
||||||
|
subtitle?: string
|
||||||
|
action?: ReactNode
|
||||||
|
}): JSX.Element {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-6">
|
||||||
|
<div className="min-w-0">
|
||||||
|
<div className="text-[14px] text-text/65 font-semibold">{kicker}</div>
|
||||||
|
<h1 className="font-serif text-[34px] sm:text-[40px] leading-[1.02] tracking-tight mt-1 font-bold">
|
||||||
|
{title}
|
||||||
|
</h1>
|
||||||
|
{subtitle && (
|
||||||
|
<p className="text-[15px] text-text/65 mt-2 font-medium leading-relaxed max-w-2xl">
|
||||||
|
{subtitle}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{action && <div className="shrink-0">{action}</div>}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function InsightGrid({
|
||||||
|
children,
|
||||||
|
className = ''
|
||||||
|
}: {
|
||||||
|
children: ReactNode
|
||||||
|
className?: string
|
||||||
|
}): JSX.Element {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={['grid grid-cols-1 sm:grid-cols-3 gap-3 mb-8', className].join(
|
||||||
|
' '
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function InsightCard({
|
||||||
|
icon,
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
hint,
|
||||||
|
tone = 'accent'
|
||||||
|
}: {
|
||||||
|
icon: ReactNode
|
||||||
|
label: string
|
||||||
|
value: string
|
||||||
|
hint?: string
|
||||||
|
tone?: Tone
|
||||||
|
}): JSX.Element {
|
||||||
|
const iconClass =
|
||||||
|
tone === 'accent'
|
||||||
|
? 'bg-accent text-white'
|
||||||
|
: tone === 'success'
|
||||||
|
? 'bg-success text-white'
|
||||||
|
: tone === 'warning'
|
||||||
|
? 'bg-warning text-white'
|
||||||
|
: tone === 'info'
|
||||||
|
? 'bg-info text-white'
|
||||||
|
: 'bg-text/12 text-text/55'
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="bg-surface rounded-2xl p-4 shadow-card dark:ring-0.5 dark:ring-hairline/30 min-w-0">
|
||||||
|
<div className="flex items-start gap-3">
|
||||||
|
<div
|
||||||
|
className={[
|
||||||
|
'w-9 h-9 rounded-xl grid place-items-center shrink-0',
|
||||||
|
iconClass
|
||||||
|
].join(' ')}
|
||||||
|
>
|
||||||
|
{icon}
|
||||||
|
</div>
|
||||||
|
<div className="min-w-0">
|
||||||
|
<div className="text-[12px] uppercase tracking-[0.06em] text-text/50 font-bold truncate">
|
||||||
|
{label}
|
||||||
|
</div>
|
||||||
|
<div className="font-display text-[22px] font-bold leading-none mt-1 truncate">
|
||||||
|
{value}
|
||||||
|
</div>
|
||||||
|
{hint && (
|
||||||
|
<div className="text-[13px] text-text/58 mt-2 leading-snug">
|
||||||
|
{hint}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -162,7 +162,7 @@ function SidebarContent({ onNav }: { onNav?: () => void }): JSX.Element {
|
|||||||
<>
|
<>
|
||||||
<div className="px-5 pt-7 pb-6">
|
<div className="px-5 pt-7 pb-6">
|
||||||
<div className="font-serif text-[36px] leading-none tracking-tight font-bold">
|
<div className="font-serif text-[36px] leading-none tracking-tight font-bold">
|
||||||
Не Залипай
|
Разомнись
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[13px] text-text/55 mt-2 font-medium">
|
<div className="text-[13px] text-text/55 mt-2 font-medium">
|
||||||
{t('sidebar.slogan')}
|
{t('sidebar.slogan')}
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ export type Dict = Record<string, string>
|
|||||||
|
|
||||||
export const ru: Dict = {
|
export const ru: Dict = {
|
||||||
// Sidebar / nav
|
// Sidebar / nav
|
||||||
'nav.today': 'Сегодня',
|
'nav.today': 'Обзор',
|
||||||
'nav.exercises': 'Упражнения',
|
'nav.exercises': 'Упражнения',
|
||||||
'nav.meals': 'Питание',
|
'nav.meals': 'Питание',
|
||||||
'nav.games': 'Игры',
|
'nav.games': 'Игры',
|
||||||
'nav.challenges': 'Челленджи',
|
'nav.challenges': 'Челленджи',
|
||||||
'nav.settings': 'Настройки',
|
'nav.settings': 'Настройки',
|
||||||
'sidebar.slogan': 'Держи ритм за компом',
|
'sidebar.slogan': 'Лёгкий перерыв без потери фокуса',
|
||||||
'sidebar.status_tracking': 'Активность отслеживается',
|
'sidebar.status_tracking': 'Активность отслеживается',
|
||||||
'titlebar.menu_aria': 'Меню',
|
'titlebar.menu_aria': 'Меню',
|
||||||
'titlebar.minimize_aria': 'Свернуть',
|
'titlebar.minimize_aria': 'Свернуть',
|
||||||
@@ -26,7 +26,7 @@ export const ru: Dict = {
|
|||||||
'titlebar.restore_aria': 'Восстановить размер',
|
'titlebar.restore_aria': 'Восстановить размер',
|
||||||
'titlebar.tray_aria': 'В трей',
|
'titlebar.tray_aria': 'В трей',
|
||||||
'titlebar.close_aria': 'Закрыть',
|
'titlebar.close_aria': 'Закрыть',
|
||||||
'titlebar.app_title': 'Не Залипай',
|
'titlebar.app_title': 'Разомнись',
|
||||||
|
|
||||||
// Common buttons / actions
|
// Common buttons / actions
|
||||||
'btn.add': 'Добавить',
|
'btn.add': 'Добавить',
|
||||||
@@ -60,11 +60,34 @@ export const ru: Dict = {
|
|||||||
'btn.retry': 'Повторить',
|
'btn.retry': 'Повторить',
|
||||||
|
|
||||||
// Dashboard
|
// Dashboard
|
||||||
'dashboard.kicker': 'Тренировка дня',
|
'dashboard.kicker': 'План перерывов',
|
||||||
'dashboard.title': 'Сегодня',
|
'dashboard.title': 'Что важно сейчас',
|
||||||
|
'dashboard.header.date': 'План на {date}',
|
||||||
|
'dashboard.header.status.paused': 'пауза',
|
||||||
|
'dashboard.header.status.meeting': 'встреча',
|
||||||
|
'dashboard.header.status.due': 'ждёт действия',
|
||||||
|
'dashboard.header.status.running': 'в работе',
|
||||||
|
'dashboard.header.status.clear': 'спокойно',
|
||||||
|
'dashboard.header.title.paused': 'Напоминания на паузе',
|
||||||
|
'dashboard.header.subtitle.paused':
|
||||||
|
'Запусти их снова, когда будешь готов вернуться к коротким перерывам.',
|
||||||
|
'dashboard.header.title.meeting': 'Встреча активна',
|
||||||
|
'dashboard.header.subtitle.meeting':
|
||||||
|
'Пауза на встречах включена. Напоминания продолжатся, когда звонок закончится.',
|
||||||
|
'dashboard.header.title.due': 'Пора сделать: {name}',
|
||||||
|
'dashboard.header.subtitle.due':
|
||||||
|
'{kind} · {meta}. Это ближайшее действие по плану.',
|
||||||
|
'dashboard.header.title.next': 'Следующее: {name}',
|
||||||
|
'dashboard.header.subtitle.next': '{kind} · {meta} · {time}',
|
||||||
|
'dashboard.header.title.empty': 'Настрой первый перерыв',
|
||||||
|
'dashboard.header.subtitle.empty':
|
||||||
|
'Добавь упражнение или питание, чтобы приложение собрало понятный план дня.',
|
||||||
|
'dashboard.header.title.clear': 'План под контролем',
|
||||||
|
'dashboard.header.subtitle.clear':
|
||||||
|
'Срочных действий нет. Ниже видно цели, ритм недели и игровые долги.',
|
||||||
'dashboard.stat.active': 'Активных',
|
'dashboard.stat.active': 'Активных',
|
||||||
'dashboard.stat.active.of': 'из {total}',
|
'dashboard.stat.active.of': 'из {total}',
|
||||||
'dashboard.stat.today_done': 'Сегодня',
|
'dashboard.stat.today_done': 'Сделано',
|
||||||
'dashboard.stat.today_done.subtitle': 'повторов за день',
|
'dashboard.stat.today_done.subtitle': 'повторов за день',
|
||||||
'dashboard.stat.streak': 'Стрик',
|
'dashboard.stat.streak': 'Стрик',
|
||||||
'dashboard.stat.streak.subtitle': '{n} дн. подряд',
|
'dashboard.stat.streak.subtitle': '{n} дн. подряд',
|
||||||
@@ -82,11 +105,11 @@ export const ru: Dict = {
|
|||||||
'нужно закрыть Steam и снова открыть',
|
'нужно закрыть Steam и снова открыть',
|
||||||
'dashboard.paused.title': 'Напоминания на паузе',
|
'dashboard.paused.title': 'Напоминания на паузе',
|
||||||
'dashboard.paused.hint': 'Возобнови, чтобы продолжить отсчёт',
|
'dashboard.paused.hint': 'Возобнови, чтобы продолжить отсчёт',
|
||||||
'dashboard.meeting.title': 'Не дёргаем — ты на встрече',
|
'dashboard.meeting.title': 'Встреча активна',
|
||||||
'dashboard.meeting.hint':
|
'dashboard.meeting.hint':
|
||||||
'Запущен Zoom / Teams / Discord / Webex / Slack-huddle. Напоминания возобновятся когда закроешь.',
|
'Запущен Zoom / Teams / Webex / Slack-huddle. Напоминания возобновятся, когда встреча закончится.',
|
||||||
'dashboard.plan.title': 'План дня',
|
'dashboard.plan.title': 'Ближайший шаг',
|
||||||
'dashboard.plan.subtitle': 'Следующее действие и дневные цели',
|
'dashboard.plan.subtitle': 'Что сделать сейчас, дневные цели и питание',
|
||||||
'dashboard.plan.due_count': '{n} ждёт',
|
'dashboard.plan.due_count': '{n} ждёт',
|
||||||
'dashboard.plan.all_caught_up': 'всё спокойно',
|
'dashboard.plan.all_caught_up': 'всё спокойно',
|
||||||
'dashboard.plan.next_action': 'Следующее действие',
|
'dashboard.plan.next_action': 'Следующее действие',
|
||||||
@@ -145,7 +168,7 @@ export const ru: Dict = {
|
|||||||
'momentum.quest.week_reps.desc': 'набери тысячу повторов за неделю',
|
'momentum.quest.week_reps.desc': 'набери тысячу повторов за неделю',
|
||||||
'momentum.quest.match_debt.title': 'Закрыть катки',
|
'momentum.quest.match_debt.title': 'Закрыть катки',
|
||||||
'momentum.quest.match_debt.desc': 'закрой 3 игровых долга за неделю',
|
'momentum.quest.match_debt.desc': 'закрой 3 игровых долга за неделю',
|
||||||
'momentum.quest.today_anchor.title': 'Сегодня не ноль',
|
'momentum.quest.today_anchor.title': 'День не ноль',
|
||||||
'momentum.quest.today_anchor.desc': 'сделай хотя бы одно действие сегодня',
|
'momentum.quest.today_anchor.desc': 'сделай хотя бы одно действие сегодня',
|
||||||
'momentum.game.kicker': 'После катки',
|
'momentum.game.kicker': 'После катки',
|
||||||
'momentum.game.title': 'Игровой долг',
|
'momentum.game.title': 'Игровой долг',
|
||||||
@@ -165,6 +188,15 @@ export const ru: Dict = {
|
|||||||
// Exercises
|
// Exercises
|
||||||
'exercises.kicker': 'Программа',
|
'exercises.kicker': 'Программа',
|
||||||
'exercises.title': 'Упражнения',
|
'exercises.title': 'Упражнения',
|
||||||
|
'exercises.subtitle':
|
||||||
|
'Собери короткие действия, которые легко сделать между задачами.',
|
||||||
|
'exercises.insight.active': 'Активно',
|
||||||
|
'exercises.insight.active.hint': 'Напоминания, которые сейчас работают',
|
||||||
|
'exercises.insight.load': 'Нагрузка',
|
||||||
|
'exercises.insight.load.value': '{n} раз',
|
||||||
|
'exercises.insight.load.hint': 'Сумма повторов за один полный круг',
|
||||||
|
'exercises.insight.goals': 'Цели',
|
||||||
|
'exercises.insight.goals.hint': 'Упражнения с дневной нормой',
|
||||||
'exercises.section.active': 'Активные · {n}',
|
'exercises.section.active': 'Активные · {n}',
|
||||||
'exercises.section.disabled': 'Выключенные · {n}',
|
'exercises.section.disabled': 'Выключенные · {n}',
|
||||||
'exercises.row.meta': '{reps} раз · {interval}',
|
'exercises.row.meta': '{reps} раз · {interval}',
|
||||||
@@ -173,6 +205,13 @@ export const ru: Dict = {
|
|||||||
// Meals (приёмы пищи)
|
// Meals (приёмы пищи)
|
||||||
'meals.kicker': 'Режим питания',
|
'meals.kicker': 'Режим питания',
|
||||||
'meals.title': 'Питание',
|
'meals.title': 'Питание',
|
||||||
|
'meals.subtitle': 'Держи еду в расписании, чтобы не выпадать из ритма.',
|
||||||
|
'meals.insight.active': 'Активно',
|
||||||
|
'meals.insight.active.hint': 'Приёмы пищи с включённым напоминанием',
|
||||||
|
'meals.insight.next': 'Следующее',
|
||||||
|
'meals.insight.next.hint': 'Ближайшее время сегодня',
|
||||||
|
'meals.insight.presets': 'Пресеты',
|
||||||
|
'meals.insight.presets.hint': 'Быстрые варианты для старта',
|
||||||
'meals.presets': 'Быстрое добавление',
|
'meals.presets': 'Быстрое добавление',
|
||||||
'meals.schedule': 'Расписание',
|
'meals.schedule': 'Расписание',
|
||||||
'meals.section.active': 'Активные · {n}',
|
'meals.section.active': 'Активные · {n}',
|
||||||
@@ -214,6 +253,13 @@ export const ru: Dict = {
|
|||||||
'challenges.title': 'Челленджи',
|
'challenges.title': 'Челленджи',
|
||||||
'challenges.subtitle': 'Повторов = {formula}',
|
'challenges.subtitle': 'Повторов = {formula}',
|
||||||
'challenges.subtitle.formula': 'статистика × коэффициент',
|
'challenges.subtitle.formula': 'статистика × коэффициент',
|
||||||
|
'challenges.insight.active': 'Активно',
|
||||||
|
'challenges.insight.active.hint': 'Правила, которые начисляют долг',
|
||||||
|
'challenges.insight.games': 'Игры',
|
||||||
|
'challenges.insight.games.hint': 'Включённые игровые интеграции',
|
||||||
|
'challenges.insight.debt': 'Тест долга',
|
||||||
|
'challenges.insight.debt.value': '{n} раз',
|
||||||
|
'challenges.insight.debt.hint': 'Если каждое правило поймает 5 событий',
|
||||||
'challenges.warning.no_games':
|
'challenges.warning.no_games':
|
||||||
'Челленджи срабатывают после матча. Подключи игру во вкладке «Игры».',
|
'Челленджи срабатывают после матча. Подключи игру во вкладке «Игры».',
|
||||||
'challenges.section.all': 'Все · {n}',
|
'challenges.section.all': 'Все · {n}',
|
||||||
@@ -239,6 +285,13 @@ export const ru: Dict = {
|
|||||||
'games.subtitle': 'Подключи игру — челленджи сработают сразу после матча',
|
'games.subtitle': 'Подключи игру — челленджи сработают сразу после матча',
|
||||||
'games.subtitle.live': '{n} live',
|
'games.subtitle.live': '{n} live',
|
||||||
'games.section.supported': 'Поддерживаемые',
|
'games.section.supported': 'Поддерживаемые',
|
||||||
|
'games.insight.supported': 'Поддержка',
|
||||||
|
'games.insight.supported.hint': 'Игры, которые умеет отслеживать приложение',
|
||||||
|
'games.insight.connected': 'Подключено',
|
||||||
|
'games.insight.connected.hint': 'Интеграции с установленной GSI',
|
||||||
|
'games.insight.live': 'Сигнал',
|
||||||
|
'games.insight.live.hint': 'Live или ожидание перезапуска Steam',
|
||||||
|
'games.insight.queued': '{n} в очереди',
|
||||||
'games.scanning': 'Сканируем установленные игры…',
|
'games.scanning': 'Сканируем установленные игры…',
|
||||||
'games.queued.body':
|
'games.queued.body':
|
||||||
'Steam запущен. Параметр {opt} пропишется автоматически при следующем закрытии Steam.',
|
'Steam запущен. Параметр {opt} пропишется автоматически при следующем закрытии Steam.',
|
||||||
@@ -255,6 +308,12 @@ export const ru: Dict = {
|
|||||||
// Settings
|
// Settings
|
||||||
'settings.kicker': 'Конфигурация',
|
'settings.kicker': 'Конфигурация',
|
||||||
'settings.title': 'Настройки',
|
'settings.title': 'Настройки',
|
||||||
|
'settings.insight.mode': 'Уведомления',
|
||||||
|
'settings.insight.mode.hint': 'Как приложение говорит о перерыве',
|
||||||
|
'settings.insight.theme': 'Тема',
|
||||||
|
'settings.insight.theme.hint': 'Визуальный режим интерфейса',
|
||||||
|
'settings.insight.language': 'Язык',
|
||||||
|
'settings.insight.language.hint': 'Применяется без перезапуска',
|
||||||
'settings.section.reminders': 'Напоминания',
|
'settings.section.reminders': 'Напоминания',
|
||||||
'settings.section.quiet': 'Тихие часы',
|
'settings.section.quiet': 'Тихие часы',
|
||||||
'settings.section.window': 'Окно и трей',
|
'settings.section.window': 'Окно и трей',
|
||||||
@@ -312,7 +371,7 @@ export const ru: Dict = {
|
|||||||
'Диктор произносит название упражнения и количество — полезно когда фокус на коде.',
|
'Диктор произносит название упражнения и количество — полезно когда фокус на коде.',
|
||||||
'settings.meeting_pause.label': 'Пауза на встречах',
|
'settings.meeting_pause.label': 'Пауза на встречах',
|
||||||
'settings.meeting_pause.hint':
|
'settings.meeting_pause.hint':
|
||||||
'Не дёргать, если запущен Zoom / Teams / Discord / Webex / Slack-huddle.',
|
'Ставить напоминания на паузу, если запущен Zoom / Teams / Webex / Slack-huddle.',
|
||||||
'settings.snooze.label': '«Отложить» на',
|
'settings.snooze.label': '«Отложить» на',
|
||||||
'settings.snooze.hint': 'Сколько минут добавлять при отложении',
|
'settings.snooze.hint': 'Сколько минут добавлять при отложении',
|
||||||
'settings.snooze.1': '1 минута',
|
'settings.snooze.1': '1 минута',
|
||||||
@@ -465,13 +524,13 @@ export const ru: Dict = {
|
|||||||
|
|
||||||
export const en: Dict = {
|
export const en: Dict = {
|
||||||
// Sidebar / nav
|
// Sidebar / nav
|
||||||
'nav.today': 'Today',
|
'nav.today': 'Overview',
|
||||||
'nav.exercises': 'Exercises',
|
'nav.exercises': 'Exercises',
|
||||||
'nav.meals': 'Meals',
|
'nav.meals': 'Meals',
|
||||||
'nav.games': 'Games',
|
'nav.games': 'Games',
|
||||||
'nav.challenges': 'Challenges',
|
'nav.challenges': 'Challenges',
|
||||||
'nav.settings': 'Settings',
|
'nav.settings': 'Settings',
|
||||||
'sidebar.slogan': 'Keep your PC rhythm',
|
'sidebar.slogan': 'A small break without losing focus',
|
||||||
'sidebar.status_tracking': 'Activity tracking is on',
|
'sidebar.status_tracking': 'Activity tracking is on',
|
||||||
'titlebar.menu_aria': 'Menu',
|
'titlebar.menu_aria': 'Menu',
|
||||||
'titlebar.minimize_aria': 'Minimize',
|
'titlebar.minimize_aria': 'Minimize',
|
||||||
@@ -479,7 +538,7 @@ export const en: Dict = {
|
|||||||
'titlebar.restore_aria': 'Restore size',
|
'titlebar.restore_aria': 'Restore size',
|
||||||
'titlebar.tray_aria': 'To tray',
|
'titlebar.tray_aria': 'To tray',
|
||||||
'titlebar.close_aria': 'Close',
|
'titlebar.close_aria': 'Close',
|
||||||
'titlebar.app_title': 'Ne Zalipay',
|
'titlebar.app_title': 'Razomnis',
|
||||||
|
|
||||||
// Common buttons
|
// Common buttons
|
||||||
'btn.add': 'Add',
|
'btn.add': 'Add',
|
||||||
@@ -513,11 +572,34 @@ export const en: Dict = {
|
|||||||
'btn.retry': 'Retry',
|
'btn.retry': 'Retry',
|
||||||
|
|
||||||
// Dashboard
|
// Dashboard
|
||||||
'dashboard.kicker': 'Daily training',
|
'dashboard.kicker': 'Break plan',
|
||||||
'dashboard.title': 'Today',
|
'dashboard.title': 'What matters now',
|
||||||
|
'dashboard.header.date': 'Plan for {date}',
|
||||||
|
'dashboard.header.status.paused': 'paused',
|
||||||
|
'dashboard.header.status.meeting': 'meeting',
|
||||||
|
'dashboard.header.status.due': 'action due',
|
||||||
|
'dashboard.header.status.running': 'running',
|
||||||
|
'dashboard.header.status.clear': 'clear',
|
||||||
|
'dashboard.header.title.paused': 'Reminders are paused',
|
||||||
|
'dashboard.header.subtitle.paused':
|
||||||
|
'Start them again when you are ready to return to short breaks.',
|
||||||
|
'dashboard.header.title.meeting': 'Meeting active',
|
||||||
|
'dashboard.header.subtitle.meeting':
|
||||||
|
'Meeting pause is enabled. Reminders will continue when the call ends.',
|
||||||
|
'dashboard.header.title.due': 'Time to do: {name}',
|
||||||
|
'dashboard.header.subtitle.due':
|
||||||
|
'{kind} · {meta}. This is the closest action in the plan.',
|
||||||
|
'dashboard.header.title.next': 'Next: {name}',
|
||||||
|
'dashboard.header.subtitle.next': '{kind} · {meta} · {time}',
|
||||||
|
'dashboard.header.title.empty': 'Set up your first break',
|
||||||
|
'dashboard.header.subtitle.empty':
|
||||||
|
'Add an exercise or meal so the app can build a clear day plan.',
|
||||||
|
'dashboard.header.title.clear': 'Plan under control',
|
||||||
|
'dashboard.header.subtitle.clear':
|
||||||
|
'No urgent actions. Goals, weekly rhythm and game debts are below.',
|
||||||
'dashboard.stat.active': 'Active',
|
'dashboard.stat.active': 'Active',
|
||||||
'dashboard.stat.active.of': 'of {total}',
|
'dashboard.stat.active.of': 'of {total}',
|
||||||
'dashboard.stat.today_done': 'Today',
|
'dashboard.stat.today_done': 'Done',
|
||||||
'dashboard.stat.today_done.subtitle': 'reps logged',
|
'dashboard.stat.today_done.subtitle': 'reps logged',
|
||||||
'dashboard.stat.streak': 'Streak',
|
'dashboard.stat.streak': 'Streak',
|
||||||
'dashboard.stat.streak.subtitle': '{n} days in a row',
|
'dashboard.stat.streak.subtitle': '{n} days in a row',
|
||||||
@@ -533,12 +615,12 @@ export const en: Dict = {
|
|||||||
'dashboard.stat.tracking.subtitle_off': 'disabled',
|
'dashboard.stat.tracking.subtitle_off': 'disabled',
|
||||||
'dashboard.stat.tracking.subtitle_pending': 'close & reopen Steam',
|
'dashboard.stat.tracking.subtitle_pending': 'close & reopen Steam',
|
||||||
'dashboard.paused.title': 'Reminders paused',
|
'dashboard.paused.title': 'Reminders paused',
|
||||||
'dashboard.meeting.title': "You're in a meeting — won't interrupt",
|
'dashboard.meeting.title': 'Meeting active',
|
||||||
'dashboard.meeting.hint':
|
'dashboard.meeting.hint':
|
||||||
'Zoom / Teams / Discord / Webex / Slack-huddle is running. Reminders resume when you close it.',
|
'Zoom / Teams / Webex / Slack-huddle is running. Reminders resume when the meeting ends.',
|
||||||
'dashboard.paused.hint': 'Resume to continue countdown',
|
'dashboard.paused.hint': 'Resume to continue countdown',
|
||||||
'dashboard.plan.title': 'Day plan',
|
'dashboard.plan.title': 'Closest step',
|
||||||
'dashboard.plan.subtitle': 'Next action and daily goals',
|
'dashboard.plan.subtitle': 'What to do now, daily goals and meals',
|
||||||
'dashboard.plan.due_count': '{n} due',
|
'dashboard.plan.due_count': '{n} due',
|
||||||
'dashboard.plan.all_caught_up': 'all clear',
|
'dashboard.plan.all_caught_up': 'all clear',
|
||||||
'dashboard.plan.next_action': 'Next action',
|
'dashboard.plan.next_action': 'Next action',
|
||||||
@@ -597,7 +679,7 @@ export const en: Dict = {
|
|||||||
'momentum.quest.week_reps.desc': 'reach one thousand reps this week',
|
'momentum.quest.week_reps.desc': 'reach one thousand reps this week',
|
||||||
'momentum.quest.match_debt.title': 'Close matches',
|
'momentum.quest.match_debt.title': 'Close matches',
|
||||||
'momentum.quest.match_debt.desc': 'close 3 game debts this week',
|
'momentum.quest.match_debt.desc': 'close 3 game debts this week',
|
||||||
'momentum.quest.today_anchor.title': 'Today is not zero',
|
'momentum.quest.today_anchor.title': 'Non-zero day',
|
||||||
'momentum.quest.today_anchor.desc': 'complete at least one action today',
|
'momentum.quest.today_anchor.desc': 'complete at least one action today',
|
||||||
'momentum.game.kicker': 'After match',
|
'momentum.game.kicker': 'After match',
|
||||||
'momentum.game.title': 'Game debt',
|
'momentum.game.title': 'Game debt',
|
||||||
@@ -617,6 +699,15 @@ export const en: Dict = {
|
|||||||
// Exercises
|
// Exercises
|
||||||
'exercises.kicker': 'Program',
|
'exercises.kicker': 'Program',
|
||||||
'exercises.title': 'Exercises',
|
'exercises.title': 'Exercises',
|
||||||
|
'exercises.subtitle':
|
||||||
|
'Build short actions that are easy to do between tasks.',
|
||||||
|
'exercises.insight.active': 'Active',
|
||||||
|
'exercises.insight.active.hint': 'Reminders currently running',
|
||||||
|
'exercises.insight.load': 'Load',
|
||||||
|
'exercises.insight.load.value': '{n} reps',
|
||||||
|
'exercises.insight.load.hint': 'Total reps in one full cycle',
|
||||||
|
'exercises.insight.goals': 'Goals',
|
||||||
|
'exercises.insight.goals.hint': 'Exercises with a daily target',
|
||||||
'exercises.section.active': 'Active · {n}',
|
'exercises.section.active': 'Active · {n}',
|
||||||
'exercises.section.disabled': 'Disabled · {n}',
|
'exercises.section.disabled': 'Disabled · {n}',
|
||||||
'exercises.row.meta': '{reps} reps · {interval}',
|
'exercises.row.meta': '{reps} reps · {interval}',
|
||||||
@@ -625,6 +716,13 @@ export const en: Dict = {
|
|||||||
// Meals
|
// Meals
|
||||||
'meals.kicker': 'Eating schedule',
|
'meals.kicker': 'Eating schedule',
|
||||||
'meals.title': 'Meals',
|
'meals.title': 'Meals',
|
||||||
|
'meals.subtitle': 'Keep food on the schedule so the day stays steady.',
|
||||||
|
'meals.insight.active': 'Active',
|
||||||
|
'meals.insight.active.hint': 'Meals with enabled reminders',
|
||||||
|
'meals.insight.next': 'Next',
|
||||||
|
'meals.insight.next.hint': 'Closest time today',
|
||||||
|
'meals.insight.presets': 'Presets',
|
||||||
|
'meals.insight.presets.hint': 'Fast starter options',
|
||||||
'meals.presets': 'Quick add',
|
'meals.presets': 'Quick add',
|
||||||
'meals.schedule': 'Schedule',
|
'meals.schedule': 'Schedule',
|
||||||
'meals.section.active': 'Active · {n}',
|
'meals.section.active': 'Active · {n}',
|
||||||
@@ -666,6 +764,13 @@ export const en: Dict = {
|
|||||||
'challenges.title': 'Challenges',
|
'challenges.title': 'Challenges',
|
||||||
'challenges.subtitle': 'Reps = {formula}',
|
'challenges.subtitle': 'Reps = {formula}',
|
||||||
'challenges.subtitle.formula': 'stat × multiplier',
|
'challenges.subtitle.formula': 'stat × multiplier',
|
||||||
|
'challenges.insight.active': 'Active',
|
||||||
|
'challenges.insight.active.hint': 'Rules that can add debt',
|
||||||
|
'challenges.insight.games': 'Games',
|
||||||
|
'challenges.insight.games.hint': 'Enabled game integrations',
|
||||||
|
'challenges.insight.debt': 'Debt test',
|
||||||
|
'challenges.insight.debt.value': '{n} reps',
|
||||||
|
'challenges.insight.debt.hint': 'If each rule catches 5 events',
|
||||||
'challenges.warning.no_games':
|
'challenges.warning.no_games':
|
||||||
'Challenges trigger after a match. Connect a game in the Games tab.',
|
'Challenges trigger after a match. Connect a game in the Games tab.',
|
||||||
'challenges.section.all': 'All · {n}',
|
'challenges.section.all': 'All · {n}',
|
||||||
@@ -691,6 +796,13 @@ export const en: Dict = {
|
|||||||
'games.subtitle': 'Connect a game — challenges fire right after the match',
|
'games.subtitle': 'Connect a game — challenges fire right after the match',
|
||||||
'games.subtitle.live': '{n} live',
|
'games.subtitle.live': '{n} live',
|
||||||
'games.section.supported': 'Supported',
|
'games.section.supported': 'Supported',
|
||||||
|
'games.insight.supported': 'Support',
|
||||||
|
'games.insight.supported.hint': 'Games this app knows how to track',
|
||||||
|
'games.insight.connected': 'Connected',
|
||||||
|
'games.insight.connected.hint': 'Integrations with installed GSI',
|
||||||
|
'games.insight.live': 'Signal',
|
||||||
|
'games.insight.live.hint': 'Live or waiting for Steam restart',
|
||||||
|
'games.insight.queued': '{n} queued',
|
||||||
'games.scanning': 'Scanning installed games…',
|
'games.scanning': 'Scanning installed games…',
|
||||||
'games.queued.body':
|
'games.queued.body':
|
||||||
'Steam is running. The {opt} option will be added automatically next time Steam closes.',
|
'Steam is running. The {opt} option will be added automatically next time Steam closes.',
|
||||||
@@ -707,6 +819,12 @@ export const en: Dict = {
|
|||||||
// Settings
|
// Settings
|
||||||
'settings.kicker': 'Configuration',
|
'settings.kicker': 'Configuration',
|
||||||
'settings.title': 'Settings',
|
'settings.title': 'Settings',
|
||||||
|
'settings.insight.mode': 'Notifications',
|
||||||
|
'settings.insight.mode.hint': 'How the app talks about a break',
|
||||||
|
'settings.insight.theme': 'Theme',
|
||||||
|
'settings.insight.theme.hint': 'Visual interface mode',
|
||||||
|
'settings.insight.language': 'Language',
|
||||||
|
'settings.insight.language.hint': 'Applied without restart',
|
||||||
'settings.section.reminders': 'Reminders',
|
'settings.section.reminders': 'Reminders',
|
||||||
'settings.section.quiet': 'Quiet hours',
|
'settings.section.quiet': 'Quiet hours',
|
||||||
'settings.section.window': 'Window & tray',
|
'settings.section.window': 'Window & tray',
|
||||||
@@ -764,7 +882,7 @@ export const en: Dict = {
|
|||||||
'Speaks the exercise name and count — useful when your eyes are on the code.',
|
'Speaks the exercise name and count — useful when your eyes are on the code.',
|
||||||
'settings.meeting_pause.label': 'Pause during meetings',
|
'settings.meeting_pause.label': 'Pause during meetings',
|
||||||
'settings.meeting_pause.hint':
|
'settings.meeting_pause.hint':
|
||||||
'Skip reminders when Zoom / Teams / Discord / Webex / Slack-huddle is running.',
|
'Pause reminders when Zoom / Teams / Webex / Slack-huddle is running.',
|
||||||
'settings.snooze.label': '“Snooze” for',
|
'settings.snooze.label': '“Snooze” for',
|
||||||
'settings.snooze.hint': 'How many minutes to postpone',
|
'settings.snooze.hint': 'How many minutes to postpone',
|
||||||
'settings.snooze.1': '1 minute',
|
'settings.snooze.1': '1 minute',
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { Plus, ChevronRight, AlertTriangle, Gamepad2 } from 'lucide-react'
|
import {
|
||||||
|
AlertTriangle,
|
||||||
|
BadgeCheck,
|
||||||
|
ChevronRight,
|
||||||
|
Gamepad2,
|
||||||
|
Plus,
|
||||||
|
Swords
|
||||||
|
} from 'lucide-react'
|
||||||
import { useAppStore } from '../store/appStore'
|
import { useAppStore } from '../store/appStore'
|
||||||
import { Button } from '../components/ui/Button'
|
import { Button } from '../components/ui/Button'
|
||||||
|
import { InsightCard, InsightGrid } from '../components/PageScaffold'
|
||||||
import { Switch } from '../components/ui/Switch'
|
import { Switch } from '../components/ui/Switch'
|
||||||
import { Modal } from '../components/ui/Modal'
|
import { Modal } from '../components/ui/Modal'
|
||||||
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
||||||
@@ -49,6 +57,12 @@ export default function ChallengesPage(): JSX.Element {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const noGamesActive = games.length > 0 && !games.some((g) => g.enabled)
|
const noGamesActive = games.length > 0 && !games.some((g) => g.enabled)
|
||||||
|
const activeChallenges = challenges.filter((c) => c.enabled)
|
||||||
|
const enabledGames = games.filter((g) => g.enabled).length
|
||||||
|
const previewDebt = activeChallenges.reduce(
|
||||||
|
(sum, challenge) => sum + Math.round(5 * challenge.multiplier),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto">
|
<div className="h-full overflow-y-auto">
|
||||||
@@ -88,6 +102,30 @@ export default function ChallengesPage(): JSX.Element {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<InsightGrid>
|
||||||
|
<InsightCard
|
||||||
|
icon={<BadgeCheck size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('challenges.insight.active')}
|
||||||
|
value={`${activeChallenges.length}/${challenges.length}`}
|
||||||
|
hint={t('challenges.insight.active.hint')}
|
||||||
|
tone={activeChallenges.length > 0 ? 'success' : 'muted'}
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Gamepad2 size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('challenges.insight.games')}
|
||||||
|
value={`${enabledGames}`}
|
||||||
|
hint={t('challenges.insight.games.hint')}
|
||||||
|
tone={enabledGames > 0 ? 'info' : 'warning'}
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Swords size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('challenges.insight.debt')}
|
||||||
|
value={t('challenges.insight.debt.value', { n: previewDebt })}
|
||||||
|
hint={t('challenges.insight.debt.hint')}
|
||||||
|
tone={previewDebt > 0 ? 'warning' : 'muted'}
|
||||||
|
/>
|
||||||
|
</InsightGrid>
|
||||||
|
|
||||||
{challenges.length > 0 ? (
|
{challenges.length > 0 ? (
|
||||||
<>
|
<>
|
||||||
<SectionHeader
|
<SectionHeader
|
||||||
|
|||||||
@@ -187,18 +187,39 @@ export default function Dashboard(): JSX.Element {
|
|||||||
lang === 'en' ? 'en-US' : 'ru-RU',
|
lang === 'en' ? 'en-US' : 'ru-RU',
|
||||||
{ weekday: 'long', day: 'numeric', month: 'long' }
|
{ weekday: 'long', day: 'numeric', month: 'long' }
|
||||||
)
|
)
|
||||||
|
const header = dashboardHeaderCopy({
|
||||||
|
plan,
|
||||||
|
paused,
|
||||||
|
meetingPaused,
|
||||||
|
hasSetup: exercises.length > 0 || meals.length > 0,
|
||||||
|
lang,
|
||||||
|
t
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto">
|
<div className="h-full overflow-y-auto">
|
||||||
<div className="max-w-5xl mx-auto px-4 sm:px-6 lg:px-10 pt-8 pb-12">
|
<div className="max-w-5xl mx-auto px-4 sm:px-6 lg:px-10 pt-8 pb-12">
|
||||||
<div className="flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-8">
|
<div className="flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-6">
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<div className="text-[14px] text-text/65 font-semibold capitalize">
|
<div className="text-[14px] text-text/65 font-semibold capitalize">
|
||||||
{today}
|
{t('dashboard.header.date', { date: today })}
|
||||||
</div>
|
</div>
|
||||||
<h1 className="font-serif text-[34px] sm:text-[40px] leading-[1.02] tracking-tight mt-1 font-bold">
|
<div className="mt-2 flex flex-wrap items-center gap-3">
|
||||||
{t('dashboard.title')}
|
<h1 className="font-serif text-[34px] sm:text-[40px] leading-[1.02] tracking-tight font-bold">
|
||||||
|
{header.title}
|
||||||
</h1>
|
</h1>
|
||||||
|
<span
|
||||||
|
className={[
|
||||||
|
'h-7 px-3 rounded-full inline-flex items-center text-[12px] font-bold uppercase tracking-[0.06em]',
|
||||||
|
dashboardStatusClass(header.tone)
|
||||||
|
].join(' ')}
|
||||||
|
>
|
||||||
|
{header.status}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p className="text-[15px] text-text/65 mt-2 font-medium leading-relaxed max-w-2xl">
|
||||||
|
{header.subtitle}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Button variant="tinted" onClick={togglePause}>
|
<Button variant="tinted" onClick={togglePause}>
|
||||||
@@ -414,6 +435,95 @@ export default function Dashboard(): JSX.Element {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DashboardHeaderTone = 'accent' | 'success' | 'warning' | 'info' | 'muted'
|
||||||
|
|
||||||
|
function dashboardHeaderCopy({
|
||||||
|
plan,
|
||||||
|
paused,
|
||||||
|
meetingPaused,
|
||||||
|
hasSetup,
|
||||||
|
lang,
|
||||||
|
t
|
||||||
|
}: {
|
||||||
|
plan: TodayPlan
|
||||||
|
paused: boolean
|
||||||
|
meetingPaused: boolean
|
||||||
|
hasSetup: boolean
|
||||||
|
lang: Language
|
||||||
|
t: TFn
|
||||||
|
}): {
|
||||||
|
title: string
|
||||||
|
subtitle: string
|
||||||
|
status: string
|
||||||
|
tone: DashboardHeaderTone
|
||||||
|
} {
|
||||||
|
if (paused) {
|
||||||
|
return {
|
||||||
|
title: t('dashboard.header.title.paused'),
|
||||||
|
subtitle: t('dashboard.header.subtitle.paused'),
|
||||||
|
status: t('dashboard.header.status.paused'),
|
||||||
|
tone: 'muted'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (meetingPaused) {
|
||||||
|
return {
|
||||||
|
title: t('dashboard.header.title.meeting'),
|
||||||
|
subtitle: t('dashboard.header.subtitle.meeting'),
|
||||||
|
status: t('dashboard.header.status.meeting'),
|
||||||
|
tone: 'info'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasSetup) {
|
||||||
|
return {
|
||||||
|
title: t('dashboard.header.title.empty'),
|
||||||
|
subtitle: t('dashboard.header.subtitle.empty'),
|
||||||
|
status: t('dashboard.header.status.clear'),
|
||||||
|
tone: 'warning'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextItem = plan.nextItem
|
||||||
|
if (nextItem) {
|
||||||
|
const payload = {
|
||||||
|
name: nextItem.name,
|
||||||
|
kind: t(`dashboard.plan.kind.${nextItem.kind}`),
|
||||||
|
meta: planItemMeta(nextItem, t),
|
||||||
|
time: planItemTiming(nextItem, false, lang, t)
|
||||||
|
}
|
||||||
|
if (nextItem.due) {
|
||||||
|
return {
|
||||||
|
title: t('dashboard.header.title.due', payload),
|
||||||
|
subtitle: t('dashboard.header.subtitle.due', payload),
|
||||||
|
status: t('dashboard.header.status.due'),
|
||||||
|
tone: 'accent'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
title: t('dashboard.header.title.next', payload),
|
||||||
|
subtitle: t('dashboard.header.subtitle.next', payload),
|
||||||
|
status: t('dashboard.header.status.running'),
|
||||||
|
tone: 'success'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: t('dashboard.header.title.clear'),
|
||||||
|
subtitle: t('dashboard.header.subtitle.clear'),
|
||||||
|
status: t('dashboard.header.status.clear'),
|
||||||
|
tone: 'success'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function dashboardStatusClass(tone: DashboardHeaderTone): string {
|
||||||
|
if (tone === 'accent') return 'bg-accent/12 text-accent'
|
||||||
|
if (tone === 'success') return 'bg-success/12 text-success'
|
||||||
|
if (tone === 'warning') return 'bg-warning/12 text-warning'
|
||||||
|
if (tone === 'info') return 'bg-info/12 text-info'
|
||||||
|
return 'bg-text/10 text-text/55'
|
||||||
|
}
|
||||||
|
|
||||||
function MomentumPanel({
|
function MomentumPanel({
|
||||||
momentum,
|
momentum,
|
||||||
gamesLive,
|
gamesLive,
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { Plus, ChevronRight } from 'lucide-react'
|
import { Activity, ChevronRight, Dumbbell, Plus, Target } from 'lucide-react'
|
||||||
import { useAppStore } from '../store/appStore'
|
import { useAppStore } from '../store/appStore'
|
||||||
import { ExerciseEditor } from '../components/ExerciseEditor'
|
import { ExerciseEditor } from '../components/ExerciseEditor'
|
||||||
|
import {
|
||||||
|
InsightCard,
|
||||||
|
InsightGrid,
|
||||||
|
PageHeader
|
||||||
|
} from '../components/PageScaffold'
|
||||||
import { Button } from '../components/ui/Button'
|
import { Button } from '../components/ui/Button'
|
||||||
import { Switch } from '../components/ui/Switch'
|
import { Switch } from '../components/ui/Switch'
|
||||||
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
||||||
@@ -18,19 +23,17 @@ export default function Exercises(): JSX.Element {
|
|||||||
|
|
||||||
const enabled = exercises.filter((e) => e.enabled)
|
const enabled = exercises.filter((e) => e.enabled)
|
||||||
const disabled = exercises.filter((e) => !e.enabled)
|
const disabled = exercises.filter((e) => !e.enabled)
|
||||||
|
const goalCount = exercises.filter((e) => e.dailyGoal !== undefined).length
|
||||||
|
const totalReps = enabled.reduce((sum, e) => sum + e.reps, 0)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto">
|
<div className="h-full overflow-y-auto">
|
||||||
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-10 pt-8 pb-12">
|
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-10 pt-8 pb-12">
|
||||||
<div className="flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-8">
|
<PageHeader
|
||||||
<div>
|
kicker={t('exercises.kicker')}
|
||||||
<div className="text-[14px] text-text/65 font-semibold">
|
title={t('exercises.title')}
|
||||||
{t('exercises.kicker')}
|
subtitle={t('exercises.subtitle')}
|
||||||
</div>
|
action={
|
||||||
<h1 className="font-serif text-[34px] sm:text-[40px] leading-[1.02] tracking-tight mt-1 font-bold">
|
|
||||||
{t('exercises.title')}
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEditing(null)
|
setEditing(null)
|
||||||
@@ -39,7 +42,32 @@ export default function Exercises(): JSX.Element {
|
|||||||
>
|
>
|
||||||
<Plus size={15} strokeWidth={2.5} /> {t('btn.add')}
|
<Plus size={15} strokeWidth={2.5} /> {t('btn.add')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<InsightGrid>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Activity size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('exercises.insight.active')}
|
||||||
|
value={`${enabled.length}/${exercises.length}`}
|
||||||
|
hint={t('exercises.insight.active.hint')}
|
||||||
|
tone={enabled.length > 0 ? 'success' : 'muted'}
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Dumbbell size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('exercises.insight.load')}
|
||||||
|
value={t('exercises.insight.load.value', { n: totalReps })}
|
||||||
|
hint={t('exercises.insight.load.hint')}
|
||||||
|
tone="accent"
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Target size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('exercises.insight.goals')}
|
||||||
|
value={`${goalCount}`}
|
||||||
|
hint={t('exercises.insight.goals.hint')}
|
||||||
|
tone={goalCount > 0 ? 'info' : 'muted'}
|
||||||
|
/>
|
||||||
|
</InsightGrid>
|
||||||
|
|
||||||
{enabled.length > 0 && (
|
{enabled.length > 0 && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
AlertTriangle
|
AlertTriangle
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
|
import { InsightCard, InsightGrid } from '../components/PageScaffold'
|
||||||
import { Button } from '../components/ui/Button'
|
import { Button } from '../components/ui/Button'
|
||||||
import { Switch } from '../components/ui/Switch'
|
import { Switch } from '../components/ui/Switch'
|
||||||
import { Spinner } from '../components/ui/Spinner'
|
import { Spinner } from '../components/ui/Spinner'
|
||||||
@@ -55,7 +56,14 @@ export default function GamesPage(): JSX.Element {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const liveCount = games.filter((g) => g.enabled && g.integrationActive).length
|
const connectedCount = games.filter((g) => g.integrationActive).length
|
||||||
|
const liveCount = games.filter(
|
||||||
|
(g) =>
|
||||||
|
g.enabled && g.integrationActive && g.launchOptionStatus === 'applied'
|
||||||
|
).length
|
||||||
|
const queuedCount = games.filter(
|
||||||
|
(g) => g.integrationActive && g.launchOptionStatus === 'queued'
|
||||||
|
).length
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto">
|
<div className="h-full overflow-y-auto">
|
||||||
@@ -85,6 +93,36 @@ export default function GamesPage(): JSX.Element {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<InsightGrid>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Gamepad2 size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('games.insight.supported')}
|
||||||
|
value={`${games.length}`}
|
||||||
|
hint={t('games.insight.supported.hint')}
|
||||||
|
tone="info"
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<CheckCircle2 size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('games.insight.connected')}
|
||||||
|
value={`${connectedCount}`}
|
||||||
|
hint={t('games.insight.connected.hint')}
|
||||||
|
tone={connectedCount > 0 ? 'success' : 'muted'}
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Hourglass size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('games.insight.live')}
|
||||||
|
value={
|
||||||
|
queuedCount > 0
|
||||||
|
? t('games.insight.queued', { n: queuedCount })
|
||||||
|
: t('games.subtitle.live', { n: liveCount })
|
||||||
|
}
|
||||||
|
hint={t('games.insight.live.hint')}
|
||||||
|
tone={
|
||||||
|
liveCount > 0 ? 'success' : queuedCount > 0 ? 'warning' : 'muted'
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</InsightGrid>
|
||||||
|
|
||||||
<SectionHeader title={t('games.section.supported')} />
|
<SectionHeader title={t('games.section.supported')} />
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{games.map((g, i) => (
|
{games.map((g, i) => (
|
||||||
@@ -109,7 +147,11 @@ export default function GamesPage(): JSX.Element {
|
|||||||
className="px-5 py-12 flex flex-col items-center gap-3 text-center text-text/55 text-[14px]"
|
className="px-5 py-12 flex flex-col items-center gap-3 text-center text-text/55 text-[14px]"
|
||||||
role="status"
|
role="status"
|
||||||
>
|
>
|
||||||
<Spinner size={22} className="text-accent" label={t('games.scanning')} />
|
<Spinner
|
||||||
|
size={22}
|
||||||
|
className="text-accent"
|
||||||
|
label={t('games.scanning')}
|
||||||
|
/>
|
||||||
{t('games.scanning')}
|
{t('games.scanning')}
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
@@ -221,7 +263,11 @@ function GameCard({
|
|||||||
disabled={busy}
|
disabled={busy}
|
||||||
size="sm"
|
size="sm"
|
||||||
>
|
>
|
||||||
{busy ? <Spinner size={14} /> : <Trash2 size={14} strokeWidth={2.5} />}{' '}
|
{busy ? (
|
||||||
|
<Spinner size={14} />
|
||||||
|
) : (
|
||||||
|
<Trash2 size={14} strokeWidth={2.5} />
|
||||||
|
)}{' '}
|
||||||
{t('btn.disconnect')}
|
{t('btn.disconnect')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,8 +1,19 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { Plus, ChevronRight, UtensilsCrossed } from 'lucide-react'
|
import {
|
||||||
|
CalendarDays,
|
||||||
|
ChevronRight,
|
||||||
|
Clock,
|
||||||
|
Plus,
|
||||||
|
UtensilsCrossed
|
||||||
|
} from 'lucide-react'
|
||||||
import { AnimatePresence, motion } from 'framer-motion'
|
import { AnimatePresence, motion } from 'framer-motion'
|
||||||
import { useAppStore } from '../store/appStore'
|
import { useAppStore } from '../store/appStore'
|
||||||
import { MealEditor, type MealDraft } from '../components/MealEditor'
|
import { MealEditor, type MealDraft } from '../components/MealEditor'
|
||||||
|
import {
|
||||||
|
InsightCard,
|
||||||
|
InsightGrid,
|
||||||
|
PageHeader
|
||||||
|
} from '../components/PageScaffold'
|
||||||
import { Button } from '../components/ui/Button'
|
import { Button } from '../components/ui/Button'
|
||||||
import { Switch } from '../components/ui/Switch'
|
import { Switch } from '../components/ui/Switch'
|
||||||
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
||||||
@@ -37,6 +48,8 @@ export default function Meals(): JSX.Element {
|
|||||||
const ordered = [...meals].sort((a, b) =>
|
const ordered = [...meals].sort((a, b) =>
|
||||||
a.enabled === b.enabled ? 0 : a.enabled ? -1 : 1
|
a.enabled === b.enabled ? 0 : a.enabled ? -1 : 1
|
||||||
)
|
)
|
||||||
|
const activeMeals = meals.filter((m) => m.enabled)
|
||||||
|
const nextMeal = getNextMealLabel(activeMeals)
|
||||||
|
|
||||||
async function addPreset(
|
async function addPreset(
|
||||||
preset: (typeof MEAL_PRESETS)[number]
|
preset: (typeof MEAL_PRESETS)[number]
|
||||||
@@ -53,15 +66,11 @@ export default function Meals(): JSX.Element {
|
|||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto">
|
<div className="h-full overflow-y-auto">
|
||||||
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-10 pt-8 pb-12">
|
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-10 pt-8 pb-12">
|
||||||
<div className="flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-8">
|
<PageHeader
|
||||||
<div>
|
kicker={t('meals.kicker')}
|
||||||
<div className="text-[14px] text-text/65 font-semibold">
|
title={t('meals.title')}
|
||||||
{t('meals.kicker')}
|
subtitle={t('meals.subtitle')}
|
||||||
</div>
|
action={
|
||||||
<h1 className="font-serif text-[34px] sm:text-[40px] leading-[1.02] tracking-tight mt-1 font-bold">
|
|
||||||
{t('meals.title')}
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEditing(null)
|
setEditing(null)
|
||||||
@@ -70,7 +79,32 @@ export default function Meals(): JSX.Element {
|
|||||||
>
|
>
|
||||||
<Plus size={15} strokeWidth={2.5} /> {t('btn.add')}
|
<Plus size={15} strokeWidth={2.5} /> {t('btn.add')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<InsightGrid>
|
||||||
|
<InsightCard
|
||||||
|
icon={<UtensilsCrossed size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('meals.insight.active')}
|
||||||
|
value={`${activeMeals.length}/${meals.length}`}
|
||||||
|
hint={t('meals.insight.active.hint')}
|
||||||
|
tone={activeMeals.length > 0 ? 'success' : 'muted'}
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Clock size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('meals.insight.next')}
|
||||||
|
value={nextMeal ?? '—'}
|
||||||
|
hint={t('meals.insight.next.hint')}
|
||||||
|
tone={nextMeal ? 'accent' : 'muted'}
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<CalendarDays size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('meals.insight.presets')}
|
||||||
|
value={`${MEAL_PRESETS.length}`}
|
||||||
|
hint={t('meals.insight.presets.hint')}
|
||||||
|
tone="info"
|
||||||
|
/>
|
||||||
|
</InsightGrid>
|
||||||
|
|
||||||
{/* Пресеты быстрого добавления */}
|
{/* Пресеты быстрого добавления */}
|
||||||
<SectionHeader title={t('meals.presets')} />
|
<SectionHeader title={t('meals.presets')} />
|
||||||
@@ -148,6 +182,25 @@ export default function Meals(): JSX.Element {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNextMealLabel(meals: Meal[]): string | null {
|
||||||
|
const today = new Date().getDay()
|
||||||
|
const now = new Date()
|
||||||
|
const nowMinutes = now.getHours() * 60 + now.getMinutes()
|
||||||
|
const candidates = meals
|
||||||
|
.filter((meal) => meal.days.length === 0 || meal.days.includes(today))
|
||||||
|
.map((meal) => {
|
||||||
|
const [hh, mm] = meal.time.split(':').map(Number)
|
||||||
|
return {
|
||||||
|
meal,
|
||||||
|
minutes: (hh || 0) * 60 + (mm || 0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.filter((item) => item.minutes >= nowMinutes)
|
||||||
|
.sort((a, b) => a.minutes - b.minutes)
|
||||||
|
|
||||||
|
return candidates[0]?.meal.time ?? null
|
||||||
|
}
|
||||||
|
|
||||||
function MealRow({
|
function MealRow({
|
||||||
meal,
|
meal,
|
||||||
last,
|
last,
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import { Copy, FolderOpen, RefreshCw } from 'lucide-react'
|
import {
|
||||||
|
Bell,
|
||||||
|
Copy,
|
||||||
|
FolderOpen,
|
||||||
|
Languages,
|
||||||
|
Palette,
|
||||||
|
RefreshCw
|
||||||
|
} from 'lucide-react'
|
||||||
import { useAppStore } from '../store/appStore'
|
import { useAppStore } from '../store/appStore'
|
||||||
import { Switch } from '../components/ui/Switch'
|
import { Switch } from '../components/ui/Switch'
|
||||||
import { Button } from '../components/ui/Button'
|
import { Button } from '../components/ui/Button'
|
||||||
|
import { InsightCard, InsightGrid } from '../components/PageScaffold'
|
||||||
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
import { Card, Row, SectionHeader } from '../components/ui/Card'
|
||||||
import { UpdaterCard } from '../components/UpdaterCard'
|
import { UpdaterCard } from '../components/UpdaterCard'
|
||||||
import { WhatsNewModal } from '../components/WhatsNewModal'
|
import { WhatsNewModal } from '../components/WhatsNewModal'
|
||||||
@@ -54,6 +62,30 @@ export default function SettingsPage(): JSX.Element {
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<InsightGrid>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Bell size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('settings.insight.mode')}
|
||||||
|
value={t(`settings.notification_mode.${settings.notificationMode}`)}
|
||||||
|
hint={t('settings.insight.mode.hint')}
|
||||||
|
tone={settings.soundEnabled ? 'success' : 'info'}
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Palette size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('settings.insight.theme')}
|
||||||
|
value={t(`settings.theme.${settings.theme}`)}
|
||||||
|
hint={t('settings.insight.theme.hint')}
|
||||||
|
tone="accent"
|
||||||
|
/>
|
||||||
|
<InsightCard
|
||||||
|
icon={<Languages size={17} strokeWidth={2.5} />}
|
||||||
|
label={t('settings.insight.language')}
|
||||||
|
value={t(`settings.language.${settings.language}`)}
|
||||||
|
hint={t('settings.insight.language.hint')}
|
||||||
|
tone="info"
|
||||||
|
/>
|
||||||
|
</InsightGrid>
|
||||||
|
|
||||||
<SectionHeader title={t('settings.section.language')} />
|
<SectionHeader title={t('settings.section.language')} />
|
||||||
<Card className="mb-6">
|
<Card className="mb-6">
|
||||||
<SelectRow
|
<SelectRow
|
||||||
|
|||||||
@@ -21,6 +21,90 @@ export type ReleaseNoteItem = {
|
|||||||
export type ReleaseNotes = Record<Language, ReleaseNoteItem[]>
|
export type ReleaseNotes = Record<Language, ReleaseNoteItem[]>
|
||||||
|
|
||||||
export const RELEASE_NOTES: Record<string, ReleaseNotes> = {
|
export const RELEASE_NOTES: Record<string, ReleaseNotes> = {
|
||||||
|
'0.6.5': {
|
||||||
|
ru: [
|
||||||
|
{
|
||||||
|
title: 'Главный экран стал обзором действий',
|
||||||
|
detail:
|
||||||
|
'Верхний заголовок теперь показывает состояние: что сделать сейчас, что ждёт, пауза или встреча.',
|
||||||
|
tag: 'new'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Исправлен запуск с Windows',
|
||||||
|
detail:
|
||||||
|
'Проверка автозапуска теперь использует тот же путь и аргументы, что и запись в Windows.',
|
||||||
|
tag: 'fix'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Discord больше не ставит перерывы на паузу',
|
||||||
|
detail:
|
||||||
|
'Авто-пауза встреч реагирует на Zoom, Teams, Webex и Slack-huddle, но не на обычный Discord.',
|
||||||
|
tag: 'fix'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
en: [
|
||||||
|
{
|
||||||
|
title: 'The main screen is now an action overview',
|
||||||
|
detail:
|
||||||
|
'The header shows the current state: what to do now, what is due, pause or meeting.',
|
||||||
|
tag: 'new'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Fixed Start with Windows',
|
||||||
|
detail:
|
||||||
|
'Autostart now reads Windows login items with the same path and arguments it writes.',
|
||||||
|
tag: 'fix'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Discord no longer pauses breaks',
|
||||||
|
detail:
|
||||||
|
'Meeting auto-pause still handles Zoom, Teams, Webex and Slack-huddle, but ignores Discord.',
|
||||||
|
tag: 'fix'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'0.6.4': {
|
||||||
|
ru: [
|
||||||
|
{
|
||||||
|
title: 'Новый видимый бренд “Разомнись”',
|
||||||
|
detail:
|
||||||
|
'Название стало короче и понятнее для русской аудитории: действие видно сразу.',
|
||||||
|
tag: 'new'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Сводки на каждом экране',
|
||||||
|
detail:
|
||||||
|
'Упражнения, питание, игры, челленджи и настройки теперь быстрее сканируются сверху.',
|
||||||
|
tag: 'new'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Улучшена структура вторичных страниц',
|
||||||
|
detail:
|
||||||
|
'Важные статусы вынесены выше списков, чтобы сразу видеть активность и проблемные места.',
|
||||||
|
tag: 'new'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
en: [
|
||||||
|
{
|
||||||
|
title: 'New visible “Razomnis” brand',
|
||||||
|
detail:
|
||||||
|
'The name is shorter and more action-focused for the Russian audience.',
|
||||||
|
tag: 'new'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Overview cards on every screen',
|
||||||
|
detail:
|
||||||
|
'Exercises, meals, games, challenges and settings are easier to scan from the top.',
|
||||||
|
tag: 'new'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Secondary pages are more structured',
|
||||||
|
detail:
|
||||||
|
'Important statuses moved above long lists so active and risky areas are visible immediately.',
|
||||||
|
tag: 'new'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
'0.6.3': {
|
'0.6.3': {
|
||||||
ru: [
|
ru: [
|
||||||
{
|
{
|
||||||
@@ -151,7 +235,7 @@ export const RELEASE_NOTES: Record<string, ReleaseNotes> = {
|
|||||||
{
|
{
|
||||||
title: 'Видно когда мы молчим из-за ВКС',
|
title: 'Видно когда мы молчим из-за ВКС',
|
||||||
detail:
|
detail:
|
||||||
'Запущен Zoom/Teams — на Dashboard баннер «Не дёргаем — ты на встрече».',
|
'Запущен Zoom/Teams — на Dashboard появляется баннер активной встречи.',
|
||||||
tag: 'new'
|
tag: 'new'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -234,7 +318,7 @@ export const RELEASE_NOTES: Record<string, ReleaseNotes> = {
|
|||||||
{
|
{
|
||||||
title: 'Авто-пауза на ВКС',
|
title: 'Авто-пауза на ВКС',
|
||||||
detail:
|
detail:
|
||||||
'Не дёргает напоминаниями, если запущен Zoom/Teams/Discord/Webex/Slack-huddle.',
|
'Ставит напоминания на паузу, если запущен Zoom/Teams/Webex/Slack-huddle.',
|
||||||
tag: 'new'
|
tag: 'new'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -281,7 +365,7 @@ export const RELEASE_NOTES: Record<string, ReleaseNotes> = {
|
|||||||
{
|
{
|
||||||
title: 'Meeting auto-pause',
|
title: 'Meeting auto-pause',
|
||||||
detail:
|
detail:
|
||||||
'No reminders while Zoom/Teams/Discord/Webex/Slack-huddle is running.',
|
'Pauses reminders while Zoom/Teams/Webex/Slack-huddle is running.',
|
||||||
tag: 'new'
|
tag: 'new'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export type Settings = {
|
|||||||
voicePromptsEnabled: boolean
|
voicePromptsEnabled: boolean
|
||||||
/**
|
/**
|
||||||
* Авто-пауза напоминаний во время ВКС-звонков. Сканирует список процессов
|
* Авто-пауза напоминаний во время ВКС-звонков. Сканирует список процессов
|
||||||
* (Zoom/Teams/Discord/Webex/Slack-huddle/etc) раз в 30 сек, если хоть один
|
* (Zoom/Teams/Webex/Slack-huddle/etc) раз в 30 сек, если хоть один
|
||||||
* запущен — fires не происходят. Чисто Windows (через tasklist).
|
* запущен — fires не происходят. Чисто Windows (через tasklist).
|
||||||
*/
|
*/
|
||||||
meetingAutoPause: boolean
|
meetingAutoPause: boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user