# Phase 6: Dashboard widget + Settings retention panel + docs **Status:** ✅ Done **Parent plan:** [PLAN.md](./PLAN.md) **Domain:** frontend · uses the `frontend-design` skill ## Objective Add the two secondary surfaces: a compact **Recent Activity** widget on the Dashboard linking to the full tab, and a **Settings** panel for retention configuration (+ clear + export entry) positioned beside the existing Log Viewer with a clear "what's the difference" note. Update docs/tutorials. ## Tasks - [x] Dashboard **Recent Activity** widget (`features/dashboard.ts` + dashboard CSS): - Compact card showing the latest ~5 entries (severity icon, relative time, message). - Reuse the Phase 5 render helper (don't duplicate row markup). - Live update via `server:activity_logged` (prepend, cap to N). - **View all →** navigates to the Activity tab (`switchTab('activity_log')`). - Respect the existing dashboard card layout/toggle system; localized; empty state. - [x] **Settings** retention panel (`features/settings.ts` + `templates/modals/settings.html`): - New rail entry `Activity Log` (beside the existing **Log Viewer**). - Controls: `enabled` toggle, `max_days` number, `max_entries` number → `GET/PUT /activity-log/settings`. Save → toast; validation feedback. - **Clear log** button (confirm dialog) → `DELETE /activity-log`; **Export** button → `/activity-log/export`. - One-line note distinguishing this persistent audit log from the ephemeral debug Log Viewer (cross-link both ways). - i18n for all controls/labels/hints. - [x] Docs: update user-facing docs/README/feature list for the new Activity tab + retention settings + export (and the audit-vs-debug-log distinction). Keep it brief. - [x] Tutorials/cross-links: ensure the Settings tutorial (if any) and tab tour mention the panel; `tour.*`/`settings.*` i18n keys in all 3 locales. ## Files to Modify/Create - `server/src/ledgrab/static/js/features/dashboard.ts` — modify: Recent Activity widget - `server/src/ledgrab/static/css/dashboard.css` (or relevant sheet) — modify: widget styles - `server/src/ledgrab/static/js/features/settings.ts` — modify: retention panel + handlers - `server/src/ledgrab/templates/modals/settings.html` — modify: rail entry + panel HTML - `server/src/ledgrab/static/js/app.ts` / `global.d.ts` — modify: new window handlers - `server/src/ledgrab/static/locales/{en,ru,zh}.json` — modify: i18n keys - docs (README / feature list / relevant context doc) — modify: brief feature documentation ## Acceptance Criteria - Dashboard shows a live Recent Activity widget; **View all →** opens the Activity tab. - Settings panel reads/writes retention settings, clears (with confirm + auth), and exports. - Audit-log vs debug-Log-Viewer distinction is explicit and cross-linked. - Fully localized (en/ru/zh); empty/loading states; consistent with app design. - `npx tsc --noEmit` clean; `npm run build` succeeds. No plain `