1d445f3980
Rework entity schema: rename Tracker→NotificationTracker, add CommandConfig/ CommandTracker/CommandTrackerListener entities for decoupled command handling. Commands now resolve through CommandTracker→CommandConfig instead of TelegramBot.commands_config. Smart ref-counted bot polling based on active listeners. Add chat_action to telegram targets. Full frontend CRUD pages for command configs and command trackers. Idempotent SQLite migrations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
76 lines
3.4 KiB
Markdown
76 lines
3.4 KiB
Markdown
# Phase 5: Frontend — Rename & Restructure
|
|
|
|
**Status:** ⬜ Not Started
|
|
**Parent plan:** [PLAN.md](./PLAN.md)
|
|
**Domain:** frontend
|
|
|
|
## Objective
|
|
Rename all tracker-related frontend pages, routes, API calls, and i18n keys to use
|
|
"notification tracker" naming. Add chat_action dropdown to telegram target form.
|
|
Update navigation.
|
|
|
|
## Tasks
|
|
|
|
- [ ] Task 1: Rename route directory `frontend/src/routes/trackers/` → `frontend/src/routes/notification-trackers/`. Update `+page.svelte` to use new API endpoints (`/api/notification-trackers`, `/api/notification-tracker-targets`).
|
|
|
|
- [ ] Task 2: Update `+layout.svelte` navigation:
|
|
- Change "Trackers" nav item to "Notification Trackers" (or shorter "Notif. Trackers") with route `/notification-trackers`
|
|
- Keep icon the same
|
|
|
|
- [ ] Task 3: Update `frontend/src/lib/i18n/en.json`:
|
|
- Rename `tracker.*` keys to `notificationTracker.*`
|
|
- Rename `trackerTarget.*` keys to `notificationTrackerTarget.*`
|
|
- Add nav key: `nav.notificationTrackers`
|
|
- Add `targets.chatAction`, `targets.chatActionHelp` keys
|
|
- Remove old `tracker.*` keys
|
|
|
|
- [ ] Task 4: Update `frontend/src/lib/i18n/ru.json` — same key renames as en.json with Russian translations
|
|
|
|
- [ ] Task 5: Update `frontend/src/routes/targets/+page.svelte`:
|
|
- Add `chat_action` dropdown to telegram target form (options: none/typing/upload_photo/upload_video/upload_document/record_video/record_voice)
|
|
- Include chat_action in create/update API calls
|
|
- Display chat_action in target list if set
|
|
|
|
- [ ] Task 6: Update `frontend/src/routes/notification-trackers/+page.svelte` (renamed from trackers):
|
|
- All API calls point to `/api/notification-trackers` and `/api/notification-tracker-targets`
|
|
- All variable names reflect "notificationTracker" naming
|
|
- i18n keys updated to new prefixes
|
|
|
|
- [ ] Task 7: Update `frontend/src/routes/+page.svelte` (dashboard):
|
|
- Update any tracker references/stats to use new API endpoints and naming
|
|
|
|
- [ ] Task 8: Update any other pages that reference trackers:
|
|
- `tracking-configs/+page.svelte` — update if it links to trackers
|
|
- `template-configs/+page.svelte` — update if it references trackers
|
|
|
|
## Files to Modify/Create
|
|
- `frontend/src/routes/trackers/+page.svelte` → move to `frontend/src/routes/notification-trackers/+page.svelte`
|
|
- `frontend/src/routes/+layout.svelte` — nav updates
|
|
- `frontend/src/lib/i18n/en.json` — key renames
|
|
- `frontend/src/lib/i18n/ru.json` — key renames
|
|
- `frontend/src/routes/targets/+page.svelte` — chat_action
|
|
- `frontend/src/routes/+page.svelte` — dashboard updates
|
|
|
|
## Acceptance Criteria
|
|
- Navigation shows "Notification Trackers" linking to `/notification-trackers`
|
|
- Notification trackers page works with renamed API endpoints
|
|
- Telegram targets have chat_action dropdown
|
|
- All i18n keys updated in both en and ru
|
|
- Frontend builds without errors
|
|
- No references to old `/api/trackers` endpoints remain
|
|
|
|
## Notes
|
|
- The old `/trackers` route should be removed entirely (no redirect needed — this is an admin tool).
|
|
- chat_action values map to Telegram's sendChatAction API parameter.
|
|
- Keep the UI structure the same — this is a rename, not a redesign.
|
|
|
|
## Review Checklist
|
|
- [ ] All tasks completed
|
|
- [ ] Code follows project conventions
|
|
- [ ] No unintended side effects
|
|
- [ ] Build passes
|
|
- [ ] Tests pass (new + existing)
|
|
|
|
## Handoff to Next Phase
|
|
<!-- Filled in by the implementation agent after completing this phase. -->
|