docs(37): record Plan 37-03 execution summary
This commit is contained in:
83
.planning/phases/37-media-library-album/37-03-SUMMARY.md
Normal file
83
.planning/phases/37-media-library-album/37-03-SUMMARY.md
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
---
|
||||||
|
phase: 37-media-library-album
|
||||||
|
plan: 03
|
||||||
|
subsystem: admin-media-spa
|
||||||
|
tags: [admin, vue3, boardwalk, media, mediafinder, media-picker, mail-images]
|
||||||
|
requires: ["37-02"]
|
||||||
|
provides:
|
||||||
|
- "Typed OpenAPI Media Library client (`admin/src/api/media.ts`) wrapping `/media/folders` and `/media/items` endpoints with zero hand-maintained response types"
|
||||||
|
- "Reusable Media Library components (`MediaFolderTree.vue`, `MediaInspector.vue`, `MediaBrowser.vue`) with folder tree CRUD, grid/list views, debounced search, type filter, drag-and-drop upload, metadata editing, copy URL, and published-URL-breakage delete confirmation dialog (D-12)"
|
||||||
|
- "Shared `reka-ui` `MediaPickerModal.vue` wrapping `MediaBrowser.vue` in pick/insert mode (`mode`, `multiple`, `defaultFolder`, `source`)"
|
||||||
|
- "`MailImagePicker.vue` unified onto `MediaPickerModal.vue` (preserving `open`, `mode: 'insert' | 'choose'`, `insert`, `choose` and mail-picker test contracts)"
|
||||||
|
- "`MediaFinderField.vue` registered as `'mediafinder'` in `admin/src/components/form/registry.ts` (single & multiple URL selection, thumbnail/file-chip preview, clear/remove)"
|
||||||
|
- "First-class `/media` screen (`MediaView.vue`) with permission-gated **Media** rail entry (`useMediaAccess.ts`, `PluginRail.vue`, `router.ts`, `Breadcrumbs.vue`, `pageTitle.ts`)"
|
||||||
|
- "Rebuilt `modules/boardwalk/dist` verified by `scripts/check-admin-dist.sh`"
|
||||||
|
affects:
|
||||||
|
- "admin"
|
||||||
|
- "modules/boardwalk/dist"
|
||||||
|
key-files:
|
||||||
|
created:
|
||||||
|
- admin/src/api/media.ts
|
||||||
|
- admin/src/components/media/MediaFolderTree.vue
|
||||||
|
- admin/src/components/media/MediaInspector.vue
|
||||||
|
- admin/src/components/media/MediaBrowser.vue
|
||||||
|
- admin/src/components/media/MediaPickerModal.vue
|
||||||
|
- admin/src/components/form/fields/MediaFinderField.vue
|
||||||
|
- admin/src/state/useMediaAccess.ts
|
||||||
|
- admin/src/views/MediaView.vue
|
||||||
|
modified:
|
||||||
|
- admin/src/components/form/registry.ts
|
||||||
|
- admin/src/components/mail/MailImagePicker.vue
|
||||||
|
- admin/src/app/router.ts
|
||||||
|
- admin/src/app/pageTitle.ts
|
||||||
|
- admin/src/components/shell/Breadcrumbs.vue
|
||||||
|
- admin/src/components/shell/PluginRail.vue
|
||||||
|
- admin/src/main.ts
|
||||||
|
- admin/src/views/LoginView.vue
|
||||||
|
- admin/src/state/useAuth.ts
|
||||||
|
- admin/tests/helpers.ts
|
||||||
|
- modules/boardwalk/dist/
|
||||||
|
key-decisions:
|
||||||
|
- "Added `admin/src/state/useMediaAccess.ts` (matching `useSettings.ts` and `useNavigation.ts`) probing `GET /media/items?per_page=1` at boot/login and resetting on logout, because `AdminProfile` does not carry a raw permissions array; this keeps `PluginRail.vue` server-gated on `media.view_media` / `media.manage_media` without breaking existing rail tests."
|
||||||
|
- "Added `source?: 'media' | 'mail'` on `MediaBrowser.vue` and `MediaPickerModal.vue` so `MailImagePicker.vue` delegates 100% of its dialog, search, upload, grid, alt-text, and confirm UI to `MediaPickerModal` while continuing to call `/mail/images` (which is backed by `album`'s `mail` folder on the server and returns absolute URLs required by email clients)."
|
||||||
|
completed: 2026-11-27
|
||||||
|
---
|
||||||
|
|
||||||
|
# Phase 37 Plan 03: Admin Media Library SPA, `mediafinder`, Shared `MediaPickerModal` & `boardwalk/dist` Summary
|
||||||
|
|
||||||
|
**Shipped the first-class Media Library admin screen, reusable `MediaBrowser` / `MediaPickerModal` / `MediaFinderField` components, `MailImagePicker` unification, and rebuilt embedded `modules/boardwalk/dist`.**
|
||||||
|
|
||||||
|
## Commits
|
||||||
|
|
||||||
|
- `790b6265` — `feat(admin): add typed Media API helper and MediaBrowser/FolderTree/Inspector components`
|
||||||
|
- `4c5222ed` — `feat(admin): add MediaView, MediaPickerModal, MediaFinderField, unify MailImagePicker, and rebuild boardwalk dist`
|
||||||
|
|
||||||
|
## What Was Built
|
||||||
|
|
||||||
|
1. **Typed Media API & Browser Components (`admin/src/api/media.ts`, `admin/src/components/media/`)**:
|
||||||
|
- `media.ts` wraps `openapi-fetch` calls for `/media/folders`, `/media/folders/{id}`, `/media/items`, and `/media/items/{id}` using generated types from `schema.d.ts` / `types.ts`, plus `buildFolderTree`, `formatBytes`, `fileExtension`, and `extractMediaError`.
|
||||||
|
- `MediaFolderTree.vue` renders "All files", "Unfiled", and nested virtual folders with create/subfolder/rename/delete actions when `canManage` is true.
|
||||||
|
- `MediaInspector.vue` shows image preview or file extension badge, dimensions, byte size, MIME type, WebP variant count/widths, truncated copyable SHA-256, copyable public URL, metadata editing (`alt`, `title`, `caption`, folder move), and a hard-delete button gated by `ConfirmDialog` displaying `backend::lang.media.delete_confirm_body` warning that deleting breaks published URLs (D-12).
|
||||||
|
- `MediaBrowser.vue` combines folder tree, debounced search, type filter (`all` / `image` / `file`), grid/list toggle, multi-file upload + drag-and-drop overlay, pagination, inspector drawer, and picker selection mode.
|
||||||
|
|
||||||
|
2. **`MediaPickerModal`, `MediaFinderField`, `MailImagePicker`, `/media` Route & `boardwalk/dist`**:
|
||||||
|
- `MediaPickerModal.vue` wraps `MediaBrowser.vue` in a `reka-ui` dialog (`mode`, `multiple`, `defaultFolder`, `source`, optional `showAlt` input).
|
||||||
|
- `MailImagePicker.vue` now delegates to `MediaPickerModal.vue` (`source="mail"`, `mode="image"`, `default-folder="mail"`) while preserving exact props, events, and mail-picker test contracts.
|
||||||
|
- `MediaFinderField.vue` is registered as `'mediafinder'` in `admin/src/components/form/registry.ts` (and `groupLabelledTypes`), supporting `mode: image|file`, `multiple`, `folder`, preview thumbnails/file chips, picker launch, and clear/remove.
|
||||||
|
- `MediaView.vue` is mounted at `/media` in `router.ts` (with `pageTitle.ts` and `Breadcrumbs.vue` entries) and linked from `PluginRail.vue` gated by `useMediaAccess.ts`.
|
||||||
|
- Rebuilt `modules/boardwalk/dist` and verified zero drift via `scripts/check-admin-dist.sh`.
|
||||||
|
|
||||||
|
## Verification Results
|
||||||
|
|
||||||
|
All required checks passed green:
|
||||||
|
|
||||||
|
- `npm --prefix admin run typecheck` — passed (`vue-tsc --noEmit`)
|
||||||
|
- `npm --prefix admin run test` — passed (all 120 Vitest test files, including `MailImagePicker.test.ts`, `mail-smoke.test.ts`, `PluginRail.test.ts`)
|
||||||
|
- `npm --prefix admin run build` — passed
|
||||||
|
- `scripts/check-admin-dist.sh` — `check-admin-dist: modules/boardwalk/dist matches a fresh build`
|
||||||
|
- `go test -short ./modules/boardwalk ./modules/phrasebook` — passed
|
||||||
|
|
||||||
|
## Deviations from Plan
|
||||||
|
|
||||||
|
- Added `admin/src/state/useMediaAccess.ts` (wired into `main.ts`, `LoginView.vue`, `useAuth.ts`, and `tests/helpers.ts`) to server-check `media.view_media` / `media.manage_media` for `PluginRail.vue`, since `AdminProfile` does not expose a client-side permissions list.
|
||||||
|
- Added `route.name === 'media'` handling to `admin/src/app/pageTitle.ts` and `admin/src/components/shell/Breadcrumbs.vue` so the Media screen has a proper document title and header breadcrumb.
|
||||||
Reference in New Issue
Block a user