diff --git a/.roo/memory-bank/activeContext.md b/.roo/memory-bank/activeContext.md index 4a7e7ec..52fe91b 100644 --- a/.roo/memory-bank/activeContext.md +++ b/.roo/memory-bank/activeContext.md @@ -2,12 +2,23 @@ ## Task State -- task_id: TASK-HIDE-TRACK-T1 +- task_id: TASK-HIDE-TRACK-3-FIX - status: success - parent_task: TASK-HIDE-TRACK -- summary: **Backend тест `test_workout_hide_start_end` добавлен. Все 4 теста PASSED (5.13s).** +- summary: **Чекбокс `hide_start_end` + `changeHideStartEnd` + i18n ключ восстановлены в WorkoutItem.vue (потеряны в git stash при TASK-HIDE-TRACK-4).** - next task: — +## ✅ CODER SUCCESS REPORT — TASK-HIDE-TRACK-3-FIX + +- `src/pages/workouts/components/WorkoutItem.vue`: + - импорт `import { useI18n } from "vue-i18n"` + `const { t } = useI18n();` (рядом с `useToast`). + - template: чекбокс `hide_start_end` (v-model + `v-on:change="changeHideStartEnd(...)"`) после блока `is_public`. + - script: `changeHideStartEnd(value: boolean)` → `axiosAuth.patch('/api/v0/workouts/${workoutItem.id}', { hide_start_end: value })` (с guard `!workoutItem` и catch-тостом, как у `changePublic`). +- i18n: ключ `workout.hide_start_end` добавлен во ВСЕ 6 локали (`br, cn, es, gb, ir, ru`) — ранее отсутствовал (секция `workout` была создана заново). +- Verified: `yarn build` exit 0 (vue-tsc --noEmit 0 ошибок, vite ✓). +- Verified: `grep hide_start_end` → 4 совпадения; `grep useI18n` → 2 совпадения. +- Note: `yarn lint` сломан системно — `tsutils.iterateComments is not a function` на всех .vue файлах (существующий дефект окружения, не от этих изменений). + ## ✅ CODER SUCCESS REPORT — TASK-HIDE-TRACK-T1 - `../backend/tests/test_api_workout.py`: добавлен `test_workout_hide_start_end` — проверяет PATCH `hide_start_end` (False→True→False) с GET-верификацией на каждом шаге. diff --git a/.roo/memory-bank/progress.md b/.roo/memory-bank/progress.md index 7902014..d3ab0eb 100644 --- a/.roo/memory-bank/progress.md +++ b/.roo/memory-bank/progress.md @@ -1,5 +1,15 @@ # Progress — Strava Frontend +## 2026-09-25 — TASK-HIDE-TRACK-3-FIX: восстановление чекбокса hide_start_end в WorkoutItem.vue + +- `src/pages/workouts/components/WorkoutItem.vue` — восстановлены (потеряны в git stash при TASK-HIDE-TRACK-4): + - `import { useI18n } from "vue-i18n"` + `const { t } = useI18n();` + - template: чекбокс `hide_start_end` после блока `is_public` + - `changeHideStartEnd(value: boolean)` → PATCH `hide_start_end` (guard + catch-тост, паттерн `changePublic`) +- i18n: секция `workout` + ключ `hide_start_end` добавлены во все 6 локалей (`br, cn, es, gb, ir, ru`) — секция отсутствовала. +- Verified: `yarn build` exit 0 (vue-tsc 0 errors, vite ✓ 7.09s). +- Known issue: `yarn lint` сломан системно — `tsutils.iterateComments is not a function` (дефект окружения). + ## 2026-09-25 — TASK-HIDE-TRACK-B3: hide_start_end в PATCH endpoint + service (backend) - `../backend/app/web/v0/workout.py` — `WorkoutEditReq` + `hide_start_end: bool | None = Field(None)`; PATCH `/workouts/{workout_id}` передаёт `hide_start_end=req.hide_start_end` в `workout_service.workout_edit(...)`. diff --git a/src/i18n/locales/br.json b/src/i18n/locales/br.json index cbf7ce9..7b8f693 100644 --- a/src/i18n/locales/br.json +++ b/src/i18n/locales/br.json @@ -157,5 +157,8 @@ "undo": "Desfazer", "dropzone": "Arraste arquivos aqui para enviar", "fileDeleted": "Arquivo excluído" + }, + "workout": { + "hide_start_end": "Ocultar início e fim da trilha" } } diff --git a/src/i18n/locales/cn.json b/src/i18n/locales/cn.json index 86bb33d..b761a8b 100644 --- a/src/i18n/locales/cn.json +++ b/src/i18n/locales/cn.json @@ -190,5 +190,8 @@ "undo": "撤销", "dropzone": "将文件拖放到此处进行上传", "fileDeleted": "文件已删除" + }, + "workout": { + "hide_start_end": "隐藏轨迹起点和终点" } } diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 3328c38..e3a321b 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -146,5 +146,8 @@ "undo": "Deshacer", "dropzone": "Arrastra archivos aquí para subir", "fileDeleted": "Archivo eliminado" + }, + "workout": { + "hide_start_end": "Ocultar inicio y fin de la ruta" } } diff --git a/src/i18n/locales/gb.json b/src/i18n/locales/gb.json index cf54a18..3458877 100644 --- a/src/i18n/locales/gb.json +++ b/src/i18n/locales/gb.json @@ -183,5 +183,8 @@ "undo": "Undo", "dropzone": "Drop files here to upload", "fileDeleted": "File deleted" + }, + "workout": { + "hide_start_end": "Hide start and end of track" } } diff --git a/src/i18n/locales/ir.json b/src/i18n/locales/ir.json index 7472518..3a651ae 100644 --- a/src/i18n/locales/ir.json +++ b/src/i18n/locales/ir.json @@ -198,5 +198,8 @@ "undo": "واگرد", "dropzone": "فایل‌ها را برای بارگذاری اینجا رها کنید", "fileDeleted": "فایل حذف شد" + }, + "workout": { + "hide_start_end": "پنهان کردن شروع و پایان مسیر" } } diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 10cb06b..85d7cac 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -187,5 +187,8 @@ "undo": "Отменить", "dropzone": "Перетащите файл сюда для загрузки", "fileDeleted": "Файл удалён" + }, + "workout": { + "hide_start_end": "Скрыть начало и конец трека" } } diff --git a/src/pages/workouts/components/WorkoutItem.vue b/src/pages/workouts/components/WorkoutItem.vue index 1a16d59..d70180f 100644 --- a/src/pages/workouts/components/WorkoutItem.vue +++ b/src/pages/workouts/components/WorkoutItem.vue @@ -176,6 +176,14 @@ v-on:change="changePublic(workoutItem.is_public)" /> +
+
{{ t("workout.hide_start_end") }}: 
+ +
Ссылки на описание: 
@@ -429,6 +437,7 @@ import { watch, } from "vue"; import { useToast, useForm } from "vuestic-ui/web-components"; +import { useI18n } from "vue-i18n"; import zoomPlugin from "chartjs-plugin-zoom"; import { Chart as ChartJS, @@ -551,6 +560,7 @@ ChartJS.register( TimeScale, ); const { init } = useToast(); +const { t } = useI18n(); function isEmpty(obj: Record) { for (const prop in obj) { @@ -1205,6 +1215,20 @@ const changePublic = (value: boolean) => { }); }); }; +const changeHideStartEnd = (value: boolean) => { + if (!workoutItem) { + return; + } + axiosAuth + .patch(`/api/v0/workouts/${workoutItem.id}`, { hide_start_end: value }) + .then((_response: AxiosResponse) => {}) + .catch((_error: AxiosError) => { + init({ + message: "Что-то пошло не так.", + color: "error", + }); + }); +}; const fileInput = ref(null); const uploading = ref(false);