--- phase: 09-admin-panel-rearchitecture plan: 03 type: execute wave: 2 depends_on: - 09-02 files_modified: - frontend/src/views/admin/AdminUsersView.vue - frontend/src/views/admin/AdminQuotasView.vue - frontend/src/views/admin/AdminAiView.vue - frontend/src/views/admin/AdminAuditView.vue autonomous: true requirements: - ADMIN-08 - ADMIN-10 user_setup: [] must_haves: truths: - "Each of the four extracted views (Users, Quotas, AI, Audit) is a self-contained .vue file under frontend/src/views/admin/" - "Each extracted view behaves identically to its Phase 8 tab component — same data fetches, same actions, same template DOM" - "Top-level template element of each view is a plain
with NO p-8, p-6, or max-w- class (AdminLayout owns the content padding)" artifacts: - path: "frontend/src/views/admin/AdminUsersView.vue" provides: "Standalone /admin/users view extracted from AdminUsersTab.vue" - path: "frontend/src/views/admin/AdminQuotasView.vue" provides: "Standalone /admin/quotas view extracted from AdminQuotasTab.vue" - path: "frontend/src/views/admin/AdminAiView.vue" provides: "Standalone /admin/ai view extracted from AdminAiConfigTab.vue" - path: "frontend/src/views/admin/AdminAuditView.vue" provides: "Standalone /admin/audit view extracted from AuditLogTab.vue" key_links: - from: "frontend/src/views/admin/*View.vue" to: "frontend/src/api/admin.js" via: "named imports preserved from source tab components" pattern: "from '../../api/" --- Promote the four existing admin tab components (`AdminUsersTab.vue`, `AdminQuotasTab.vue`, `AdminAiConfigTab.vue`, `AuditLogTab.vue`) into standalone view files in `frontend/src/views/admin/` (D-11). Extraction is **structural and behavior-preserving** — same template, same script, same data fetches, same emitted actions, with import paths rewritten for the new location and the component renamed in the script setup. Purpose: D-11 mandates the tab components become views. D-13 mandates AuditLog is promoted as-is (no new features). The Phase 9 architecture (D-09/D-10/D-11) requires each admin section be a standalone deep-linkable view component — `AdminLayout`'s `` must render them. Output: 4 new view files. Original tab components and `AdminView.vue` are deleted in 09-04 (after router rewiring). This plan does NOT delete anything and does NOT touch the router — those land in 09-04 to keep the codebase in a buildable state between waves. @$HOME/.claude/get-shit-done/workflows/execute-plan.md @$HOME/.claude/get-shit-done/templates/summary.md @.planning/phases/09-admin-panel-rearchitecture/09-CONTEXT.md @.planning/phases/09-admin-panel-rearchitecture/09-RESEARCH.md @.planning/phases/09-admin-panel-rearchitecture/09-PATTERNS.md @CLAUDE.md @frontend/src/components/admin/AdminUsersTab.vue @frontend/src/components/admin/AdminQuotasTab.vue @frontend/src/components/admin/AdminAiConfigTab.vue @frontend/src/components/admin/AuditLogTab.vue @frontend/src/views/AdminView.vue From RESEARCH.md §Pattern 4 (codebase audit): - `AdminUsersTab.vue` — top element `
`, no padding. - `AdminQuotasTab.vue` — top element `
`, no padding. - `AdminAiConfigTab.vue` — top element `
`, no padding. - `AuditLogTab.vue` — top element `
`, no padding. Tab components currently live at depth `frontend/src/components/admin/` (two levels deep from `src/`). Extracted views live at `frontend/src/views/admin/` (also two levels deep). Therefore relative imports of the form `../../api/...`, `../../stores/...`, `../../utils/...` resolve identically from the new location — **no relative import paths need adjustment**. Any imports that go through `../layout/...` (one level up to `components/`) would break, but these tab components do NOT import any sibling component under `components/`. Verify before extracting each file: `grep -E "^import" frontend/src/components/admin/.vue` — every import path should already start with `../../` (relative to `components/admin/`). If any import uses a different depth, document the rewrite in the SUMMARY. Task 1: Extract AdminUsersTab.vue and AdminQuotasTab.vue to views/admin/ frontend/src/views/admin/AdminUsersView.vue, frontend/src/views/admin/AdminQuotasView.vue - frontend/src/components/admin/AdminUsersTab.vue (entire file — this is the source being promoted) - frontend/src/components/admin/AdminQuotasTab.vue (entire file — this is the source being promoted) - frontend/src/views/AdminView.vue (current parent — confirm which props/events these tab components rely on so the standalone views can drop the prop-passing layer) - `AdminUsersView.vue` template + script behave identically to `AdminUsersTab.vue` for the user CRUD flows (create user, deactivate user, set quota, set AI provider, etc.). - `AdminQuotasView.vue` template + script behave identically to `AdminQuotasTab.vue` for the quota management flows. - Both files compile under Vite with no warnings about unused imports or unresolved paths. - No prop is required to mount either view (AdminLayout passes nothing to its children). Copy the entire contents of `frontend/src/components/admin/AdminUsersTab.vue` into a new file `frontend/src/views/admin/AdminUsersView.vue`. Rename the component if the script defines a `name:` field (Options-API style) or sets `defineOptions({ name: 'AdminUsersTab' })` (Composition-API) — change `'AdminUsersTab'` to `'AdminUsersView'`. If neither convention is used, no rename is needed. Verify every import line resolves from the new path (use the rule in ``: `../../` resolves identically). If `AdminUsersTab.vue` declares props that were used to receive data from `AdminView.vue` and they are no longer relevant (e.g. a `currentUser` prop), remove the `defineProps` block AND audit where those props were referenced — if a prop was only used as a passthrough, replace its template references with direct store reads (`useAuthStore().user`). Do NOT change template DOM, do NOT change `onMounted` fetches, do NOT change emitted events (emitted events are dropped at the view boundary — they no longer have a parent listening; check whether any emit was the sole trigger of a fetch on the parent — if so, replace the emit with a direct re-fetch inside the view). Repeat the same extraction for `AdminQuotasTab.vue` → `frontend/src/views/admin/AdminQuotasView.vue`. cd frontend && [ -f src/views/admin/AdminUsersView.vue ] && [ -f src/views/admin/AdminQuotasView.vue ] && diff <(sed -n '/