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>
3.4 KiB
Phase 5: Frontend — Rename & Restructure
Status: ⬜ Not Started Parent plan: 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.svelteto use new API endpoints (/api/notification-trackers,/api/notification-tracker-targets). -
Task 2: Update
+layout.sveltenavigation:- Change "Trackers" nav item to "Notification Trackers" (or shorter "Notif. Trackers") with route
/notification-trackers - Keep icon the same
- Change "Trackers" nav item to "Notification Trackers" (or shorter "Notif. Trackers") with route
-
Task 3: Update
frontend/src/lib/i18n/en.json:- Rename
tracker.*keys tonotificationTracker.* - Rename
trackerTarget.*keys tonotificationTrackerTarget.* - Add nav key:
nav.notificationTrackers - Add
targets.chatAction,targets.chatActionHelpkeys - Remove old
tracker.*keys
- Rename
-
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_actiondropdown 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
- Add
-
Task 6: Update
frontend/src/routes/notification-trackers/+page.svelte(renamed from trackers):- All API calls point to
/api/notification-trackersand/api/notification-tracker-targets - All variable names reflect "notificationTracker" naming
- i18n keys updated to new prefixes
- All API calls point to
-
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 trackerstemplate-configs/+page.svelte— update if it references trackers
Files to Modify/Create
frontend/src/routes/trackers/+page.svelte→ move tofrontend/src/routes/notification-trackers/+page.sveltefrontend/src/routes/+layout.svelte— nav updatesfrontend/src/lib/i18n/en.json— key renamesfrontend/src/lib/i18n/ru.json— key renamesfrontend/src/routes/targets/+page.svelte— chat_actionfrontend/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/trackersendpoints remain
Notes
- The old
/trackersroute 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)