generated from john/python-template
V4.4 Complete
This commit is contained in:
@@ -11,10 +11,11 @@ Documents manages the archival record for each historical artifact independently
|
||||
| `/documents` | Searchable archival Document list. |
|
||||
| `/documents/new` | Create a Document. |
|
||||
| `/documents/{document_id}` | View one Document and its related records. |
|
||||
| `/documents/{document_id}/edit` | Edit metadata and people-by-role links. |
|
||||
| `/documents/{document_id}/edit` | Edit metadata and the complete Linked People set. |
|
||||
| `/documents/{document_id}/delete` | Confirm or block deletion. |
|
||||
| `/documents/{document_id}/jobs` | Show Jobs belonging to the Document. |
|
||||
| `/documents/{document_id}/sources` | Redirect to the Document-filtered Sources list. |
|
||||
| `/documents/{document_id}/print` | Preview and browser-print the persisted Document. |
|
||||
|
||||
## List Behavior
|
||||
|
||||
@@ -42,7 +43,7 @@ Optional:
|
||||
- Document location.
|
||||
- Archive identifier.
|
||||
- Notes.
|
||||
- Multiple people for every configured Person Role.
|
||||
- Linked People, with exactly one Person Role per linked Person.
|
||||
|
||||
Rules:
|
||||
|
||||
@@ -53,6 +54,11 @@ Rules:
|
||||
- An invalid requested Person produces a warning rather than a broken form.
|
||||
- `return_to=jobs_new` returns a successful create to Job creation with the new Document selected.
|
||||
- Edit includes active and inactive Document Types so historical values remain maintainable.
|
||||
- One Linked People table contains Select, Person, and Role columns.
|
||||
- Add and Edit use an inline Person/Role editor; Save, Cancel, and Delete change staged UI state only.
|
||||
- A Person may appear once per Document regardless of role.
|
||||
- Existing inactive-role links remain visible; only active roles may be newly assigned.
|
||||
- Document fields and the complete staged link set commit atomically on the main save.
|
||||
- Save success returns to Document Detail.
|
||||
|
||||
## Detail Behavior
|
||||
@@ -63,9 +69,20 @@ Rules:
|
||||
- System Logistics shows created and updated timestamps.
|
||||
- Related People are grouped by role and link to Person Detail.
|
||||
- **Sources & Pipeline Jobs** shows counts and actions for filtered Sources, Document Jobs, and adding a Job.
|
||||
- **Edit Document** and **Delete** are available from the header.
|
||||
- **Edit Document**, **Print**, and **Delete** are available from the header.
|
||||
- Invalid IDs and missing Documents produce explicit states without rendering a partial page.
|
||||
|
||||
## Print Behavior
|
||||
|
||||
- Print opens a dedicated preview for persisted Document data.
|
||||
- **Facsimile** places each Source image beside its current transcription and starts every Source on a new printed sheet.
|
||||
- **Text only** omits images, joins single line breaks inside paragraphs, and preserves blank-line paragraph boundaries.
|
||||
- Non-null revised text takes precedence over raw transcription, including an intentionally empty revision.
|
||||
- Archival metadata resolves Author through the hidden built-in semantic identity, not its mutable label.
|
||||
- Job metadata uses one oldest-to-newest column per Job and ends with Status.
|
||||
- Stored text is escaped and Source media uses record-validated application URLs rather than local file paths.
|
||||
- Printing uses the browser print dialog; server-generated PDFs are not provided.
|
||||
|
||||
## Document Jobs Behavior
|
||||
|
||||
- The page lists the Document's Jobs newest first with status and Job ID.
|
||||
@@ -84,10 +101,12 @@ Rules:
|
||||
|
||||
- List columns, alignment, search, sorting, date fallback, and row navigation match this contract.
|
||||
- Create/edit enforce name, registered type, and valid exact-date input.
|
||||
- Multiple people can be selected independently for each configured role.
|
||||
- Linked People staging enforces one role and one row per Person.
|
||||
- Document and Linked People writes never partially commit.
|
||||
- Person-first Document creation preselects the requested Person as author.
|
||||
- Detail links people, Sources, and Jobs to the correct records.
|
||||
- Delete never removes a Document with Source or Job dependencies.
|
||||
- Both print formats preserve the frozen content, ordering, text-precedence, and safety contracts.
|
||||
- Service failures use the shared error presenter and never report false success.
|
||||
|
||||
## Implementation Anchors
|
||||
@@ -96,10 +115,14 @@ Rules:
|
||||
- `src/transcription/ui/components/table/documents.py`
|
||||
- `src/transcription/services/documents.py`
|
||||
- `src/transcription/services/people.py`
|
||||
- `src/transcription/services/workflows.py`
|
||||
- `src/transcription/ui/components/linked_people.py`
|
||||
- `src/transcription/ui/pages/print_preview_page.py`
|
||||
- `src/transcription/api/v4_print.py`
|
||||
- `tests/ui/test_documents_page.py`
|
||||
- `tests/services/test_document_service.py`
|
||||
|
||||
## Known Limitations and Deferred Work
|
||||
|
||||
- Document creation persists the Document before adding relationship links; a later link failure is surfaced but is not currently one atomic write.
|
||||
- Source ordering controls are deferred to the [draft V4.3 scope](../../ver4.3/scope_boundary_v4_3.md).
|
||||
- Source page ordering remains read-only in V4.4.
|
||||
- Printing other entities, batch printing, and server-side export formats are deferred.
|
||||
|
||||
Reference in New Issue
Block a user