# Slice 6: Admin UI ## Role You are a frontend TypeScript/Vue developer adding admin functionality to an existing read-only academic submission website. The backend API and read-only frontend are complete — you are adding token-based authentication, inline editing, asset upload, and drag-and-drop reorder. ## Objective Create the full admin experience: token entry, inline segment editing (create/update/delete), asset uploading, and drag-and-drop segment reorder. Admin controls must be invisible when no token is active. All files must pass `vue-tsc --noEmit` (strict TypeScript). ## Architecture Reference Read [PLAN.md](../PLAN.md) for full architecture context. **However, note these deviations from PLAN.md that were made during Slice 5 implementation:** ### Layout Change (IMPORTANT) The layout was changed from a **sidebar** to a **horizontal top bar with tabs**: - **Title bar:** `bg-primary-300` (golden yellow) with dark text, full width at top. - **Tab navigation:** Horizontal tab bar below the title, with `border-b-2 border-primary-400` on the active tab. Visible on `md+` screens. - **Mobile:** Hamburger dropdown (not slide-out sidebar). Opens a vertical list from the top with backdrop. - **Content area:** Centered `max-w-4xl` on white background. The component **file names** from PLAN.md are preserved but their implementations differ: - `SidebarNav.vue` is actually a **horizontal tab bar** (desktop). - `MobileHeader.vue` is a **hamburger dropdown** (mobile). - `AppShell.vue` composes the title bar + tab nav + mobile header + main content slot. ### Backend Route Trailing Slashes Backend collection routes use **trailing slashes**. Always include them in fetch URLs: - `GET /api/site/` — not `/api/site` - `GET /api/segments/` — not `/api/segments` - `POST /api/segments/` — not `/api/segments` - `POST /api/assets/` — not `/api/assets` - `PUT /api/segments/reorder` — no trailing slash (path route, not collection) - `GET /api/auth/verify` — no trailing slash - `PATCH /api/segments/{id}` — no trailing slash (uses PATCH, not PUT) - `DELETE /api/segments/{id}` — no trailing slash - `DELETE /api/assets/{filename}` — no trailing slash Omitting trailing slashes on collection routes causes **307 redirects** which break in the Docker proxy setup (CORS errors). ## UI Decision-Making Policy **When you encounter any ambiguity in visual design, layout, spacing, interaction patterns, or component behavior — use `AskUserQuestion` BEFORE implementing.** Do not guess or pick defaults for subjective UI choices. Examples: - How the "Add Segment" form should look (modal vs inline vs dropdown) - Editor layout for different segment types - Confirmation dialogs for delete actions - Token input styling and placement - Admin toolbar positioning relative to the top bar - Drag handle icon/style Only proceed without asking when this prompt gives an unambiguous, specific instruction. ## Coding Standards (mandatory) - Vue 3 `