generated from john/python-template
v5.0 Introduce centralized homepage & portrait photo management
Quality Gate / gate (push) Failing after 11s
Quality Gate / gate (push) Failing after 11s
This commit is contained in:
+14
-14
@@ -2,21 +2,22 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
Home provides a user-maintained landing page for the local archive. It combines one current image with Markdown text and lets the operator edit both without changing application source or prompt assets.
|
||||
Home provides a user-maintained landing page for the local archive. It combines a database-backed image gallery with Markdown text and lets the operator edit both without changing application source or prompt assets.
|
||||
|
||||
## Routes
|
||||
|
||||
| Route | Browser path | Purpose |
|
||||
| --- | --- | --- |
|
||||
| `/homepage` | `/ui/homepage` | View current homepage image and Markdown. |
|
||||
| `/homepage/edit` | `/ui/homepage/edit` | Upload an image and edit Markdown. |
|
||||
| `/homepage` | `/ui/homepage` | View homepage gallery and Markdown. |
|
||||
| `/homepage/edit` | `/ui/homepage/edit` | Upload images, manage image metadata, and edit Markdown. |
|
||||
|
||||
The application root and `/ui` redirect to `/ui/homepage`.
|
||||
|
||||
## View Behavior
|
||||
|
||||
- The visible page heading is **Home**; the browser tab title is **VibeScribe Home**.
|
||||
- The latest homepage image appears in the shared dark-room viewer.
|
||||
- The featured homepage image (`photo.is_primary`) is shown first; remaining images are shown in random order.
|
||||
- The current image appears in the shared dark-room viewer with its description.
|
||||
- Saved Markdown is rendered in the **Home Text** card.
|
||||
- Missing text displays `No homepage text saved yet.`
|
||||
- Missing image displays the viewer's empty state.
|
||||
@@ -25,26 +26,26 @@ The application root and `/ui` redirect to `/ui/homepage`.
|
||||
|
||||
## Edit Behavior
|
||||
|
||||
- The image upload accepts JPEG, PNG, GIF, WebP, BMP, and TIFF files.
|
||||
- A successful upload immediately stores the file, updates the preview to that image, and displays a positive notification.
|
||||
- The image upload accepts JPEG, PNG, GIF, WebP, BMP, and TIFF files and supports multi-file uploads.
|
||||
- A successful upload immediately stores files in the shared `photo` table/media layout and displays a positive notification.
|
||||
- The editor supports per-image description edits, setting a featured image, and deleting the current image.
|
||||
- The Markdown textarea is initialized from the currently stored homepage text.
|
||||
- **Save** writes the textarea content, displays `Homepage saved`, and returns to Home.
|
||||
- **Cancel** returns to Home without saving textarea changes. An image already uploaded during the edit session remains stored.
|
||||
|
||||
## Storage Contract
|
||||
|
||||
- Homepage content is mutable application data under `data/homepage`.
|
||||
- Markdown is stored in `homepage.md`.
|
||||
- Uploaded images keep a sanitized basename.
|
||||
- The view selects the supported image with the most recent modification time.
|
||||
- Homepage files are not transcription prompts and are not database records.
|
||||
- Homepage markdown text is mutable application data at `UPLOAD_DIR/homepage.md`.
|
||||
- Homepage images are stored as `photo` rows (`person_id = NULL`) with files under `UPLOAD_DIR/photos/`.
|
||||
- Uploaded images are renamed to `{photo_id}{suffix}`.
|
||||
- Homepage images are database records; markdown remains file-backed.
|
||||
|
||||
## Acceptance Checklist
|
||||
|
||||
- `/`, `/ui`, and the application brand reach Home.
|
||||
- Home renders with or without stored Markdown and image content.
|
||||
- Edit loads existing Markdown.
|
||||
- A supported image upload updates the preview and becomes the latest homepage image.
|
||||
- Supported image upload stores one or more images and makes the first image featured when no featured image exists yet.
|
||||
- Save persists Markdown and returns to Home.
|
||||
- Cancel does not save changed Markdown.
|
||||
|
||||
@@ -59,6 +60,5 @@ The application root and `/ui` redirect to `/ui/homepage`.
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- Homepage storage location is configured by application settings and must remain writable in the active runtime environment.
|
||||
- Homepage markdown storage location is `UPLOAD_DIR/homepage.md` and must remain writable in the active runtime environment.
|
||||
- Uploading an image is immediate and is not rolled back by Cancel.
|
||||
- The editor does not currently delete or select among previously uploaded images.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
People manages reusable historical-person records. A Person may appear in many Documents under different relationship roles and may optionally carry a portrait and FamilySearch identifier.
|
||||
People manages reusable historical-person records. A Person may appear in many Documents under different relationship roles and may optionally carry one or more photos plus a FamilySearch identifier.
|
||||
|
||||
## Routes
|
||||
|
||||
@@ -38,7 +38,6 @@ Optional:
|
||||
- Exact and approximate birth/death dates.
|
||||
- Birth/death places.
|
||||
- Biography.
|
||||
- Portrait path or uploaded portrait.
|
||||
- FamilySearch ID.
|
||||
|
||||
Rules:
|
||||
@@ -46,7 +45,7 @@ Rules:
|
||||
- Missing Full name blocks save with a warning.
|
||||
- Exact date inputs are native browser date inputs.
|
||||
- FamilySearch IDs are normalized and validated by `PeopleService`.
|
||||
- Portrait uploads are stored under the configured upload root in a Person-specific directory and update Portrait path.
|
||||
- Photos are managed on Person Detail (not in create/edit form fields).
|
||||
- Metadata JSON remains hidden.
|
||||
- Save success returns to Person Detail.
|
||||
|
||||
@@ -54,7 +53,8 @@ Rules:
|
||||
|
||||
- The header provides **New Document**, **Edit Person**, and **Delete**.
|
||||
- **New Document** opens Document creation with this Person requested for author preselection.
|
||||
- The portrait viewer resolves supported relative upload paths and absolute HTTP/data URLs.
|
||||
- Person Detail includes a photo gallery card with multi-file upload, per-photo description edits, set-primary, and delete.
|
||||
- Primary photo is shown first and labeled as the primary portrait.
|
||||
- Biographical Record shows names, compact birth/death dates, and places.
|
||||
- Birth and death place values are clickable links to Google Maps when present.
|
||||
- FamilySearch ID is shown as a metadata value and is clickable to the FamilySearch person details route when present.
|
||||
@@ -67,6 +67,7 @@ Rules:
|
||||
## Delete Behavior
|
||||
|
||||
- The page warns when linked Document relationships exist.
|
||||
- Delete is blocked when related Photos exist.
|
||||
- Confirmed deletion removes the Person and its relationship links; it does not delete Documents.
|
||||
- Success returns to the People list.
|
||||
- Missing or already-deleted records return to a safe list state.
|
||||
@@ -76,7 +77,7 @@ Rules:
|
||||
- List fields, alignment, date fallback, search, sorting, and navigation match this contract.
|
||||
- Full name is enforced on create and edit.
|
||||
- FamilySearch ID validation and link generation use the fixed supported identifier format.
|
||||
- Portrait upload and rendering remain constrained to supported media paths.
|
||||
- Photo upload and rendering remain constrained to supported media paths.
|
||||
- New Document carries the Person context.
|
||||
- Linked Documents show the correct role and target.
|
||||
- Delete wording distinguishes removal of relationship links from deletion of Documents.
|
||||
|
||||
Reference in New Issue
Block a user