14 KiB
Document User Journey
Purpose: Define how a user should interact with the UI to create and manage a Document record, including expected inputs, validation, results, and related record creation.
Scope: This document describes intended user interaction for the Document UI. It is the UX contract for the Document entity.
Companion schema mapping: schema-mapping.md Companion acceptance criteria: acceptance-criteria.md
1. Overview
A Document represents a real historical artifact the user wants to describe, organize, and eventually transcribe. The user should be able to create a Document before uploading or linking any source files.
Creating a Document is a metadata-first workflow:
- The user opens the Document page.
- The user selects Create new document.
- The user enters descriptive metadata about the document.
- The user optionally selects one related person from the existing Person list.
- The system creates the Document.
- If a person was selected, the system links that Person to the Document through DocumentPerson with author role.
- The user sees a success state and lands on the new Document detail page.
2. User Goal
The user wants to create a new Document record that:
- Has enough metadata to identify the historical artifact.
- Can optionally be linked to a person.
- Exists independently of transcription jobs and source uploads.
- Is ready for later steps such as adding sources, starting jobs, and reviewing transcriptions.
3. Page Model
3.1 Document Page
The Document page is the general UI surface where users manage documents.
It should support:
- listing or locating existing documents
- starting the Create new document flow
- navigating into a specific Document after it exists
3.2 Document Detail Page
The Document detail page is the page for one specific Document after it has been created.
It should show:
- the Document metadata
- related people linked to the Document
- a linked-author summary when available
- document-scoped navigation links for Sources and Jobs
- filtered views for sources and jobs linked to the current document
It should later support links to filtered views for:
- jobs associated with the current document only
- sources associated with the current document only
4. Entry Point
Entry point: Document page
Primary action: Create new document
Expected UI affordance:
- A visible button, link, or primary action labeled Create new document.
- Activation opens a dedicated form view, modal, or detail panel for creating a Document.
Preferred first implementation:
- A dedicated Document create page or panel.
- A simple form with explicit labels.
- Existing Person records should be selectable through a dropdown.
- Text inputs are acceptable for the remaining fields in first release.
5. Create Document Form
The Create Document form should contain the following fields.
5.1 Required Fields
| UI Label | Schema Field | Input Type | Required | Notes |
|---|---|---|---|---|
| Document name | name | Text input | Yes | Examples: Pioneer Days, Letter from Zenna to Omie |
| Document type | document_type | Text input | Yes | Examples: book, letter, enlistment papers, military record, other |
5.2 Date Fields
| UI Label | Schema Field | Input Type | Required | Notes |
|---|---|---|---|---|
| Exact date | document_date | Date input | No | Use when the exact date is known |
| Approximate date | document_date_raw | Text input | No | Use when exact date is uncertain, approximate, or unknown |
Date handling rule:
- The form may allow both fields to be entered.
- If both fields are entered,
document_dateis the canonical structured date. document_date_rawmay still be retained as the user-entered descriptive form.- The UI should explain the distinction clearly.
Examples:
- Exact date:
07/13/1885 - Approximate date:
c. 1885 - Approximate date:
Fall 1925 - Approximate date:
unknown
5.3 Optional Metadata Fields
| UI Label | Schema Field | Input Type | Required | Notes |
|---|---|---|---|---|
| Document location | location_created | Text input | No | Where the document was created |
| Notes | notes | Multiline text area | No | Freeform notes about the document |
| Archive identifier | archive_identifier | Text input | No | Free text for now; may represent inventory code, storage reference, or repository note |
Archive identifier guidance:
- First implementation should treat this as free text.
- Helper text may explain that this can store a repository code, box or folder reference, or storage note.
5.4 System Fields
| Schema Field | User Editable | Notes |
|---|---|---|
| created_at | No | System-generated at creation time |
| updated_at | No | Not user-entered during creation |
5.5 Optional Related Person
The Create Document flow may optionally link one related person during first release.
| UI Label | Schema Area | Input Type | Required | Notes |
|---|---|---|---|---|
| Related person | Person -> DocumentPerson | Dropdown select | No | Selects an existing Person and links as author when saved |
First release behavior:
- The user may save a Document without linking any person.
- If a person is linked during create, only one person is supported in first release.
- The selected person is linked as author.
- Additional people and recipient workflows are deferred to a future revision.
5.6 Related Records Not Created Directly Here
| Related Area | Included in Document Create | Notes |
|---|---|---|
| Jobs | No | Jobs are created later when transcription work begins |
| Sources | No | Sources are added later as uploaded pages or files |
6. Related Person Workflow
6.1 User Intent
The user should be able to:
- select an existing Person to associate with the Document
- change the associated Person from the Document edit flow
- save the Document even if no person is linked
6.2 Data Model Interpretation
Person selection source:
- The UI should select from Person records.
- If a person is linked, the system should create a DocumentPerson record.
- Role handling for non-author document relationships is deferred.
- If the first release needs a persisted role immediately, the role can default to
authoruntil the relationship model is broadened.
This means:
- The user does not choose from DocumentPerson records.
- DocumentPerson is the relationship created after the Person is chosen or created.
6.3 Related Person UI Behavior
Minimum acceptable first implementation:
- Dropdown of existing Person records.
- Clear display of the selected related person before submit.
- Ability to change or clear the selected person in the Document edit flow.
If the person does not exist:
- The user should create the Person first from the Person page.
- The Document create flow only links existing Person records in first release.
7. Validation Rules
7.1 Required Field Validation
The form must reject submission if:
nameis emptydocument_typeis empty
7.2 Date Validation
The form should allow:
document_dateonlydocument_date_rawonly- both
document_dateanddocument_date_raw - neither date field
If both are present:
document_dateis treated as the canonical exact datedocument_date_rawis retained as descriptive context
7.3 Related Person Validation
The form must not require a linked person in first release.
If a related person is selected or created:
- the selected value must resolve to a valid Person record before final save
- the DocumentPerson link must not be partially persisted on failure
8. Submission Behavior
When the user submits the form, the system should perform these logical steps:
- validate form inputs
- create the Document record
- create a Person record only if the user chose to add a new related person
- create one DocumentPerson record only if a related person was selected or created
- persist all intended records successfully before reporting success to the user
Expected write sequence:
- insert Document
- insert Person only if needed
- insert DocumentPerson link only if a person is linked
Recommended transactional behavior:
- all related writes should succeed or fail together
- the user should not end up with a partial create state where the Document exists but an intended person link does not
9. Expected Result After Success
After successful creation, the user should expect to see:
- confirmation that the Document was created successfully
- the Document name displayed in the resulting UI state
- the Document metadata displayed on the new Document detail page
- any linked person displayed in the resulting UI state
- a Sources section showing an empty state when no sources exist yet
- a Jobs section showing an empty state when no jobs exist yet
- a clear next step, such as adding source files
Recommended success route:
- navigate to the new Document detail page
- show Document summary metadata
- show linked people section
- show empty-state placeholders for Sources and Jobs
10. Expected Result After Failure
If submission fails, the user should expect:
- clear error messaging
- field-level validation feedback where applicable
- no false success message
- preservation of entered form values when possible
Examples:
- missing required name
- missing required document type
- failed person creation
- failed DocumentPerson link creation
- database or server error
11. Read Document Journey
11.1 User Intent
The user wants to open a specific Document and quickly understand:
- what the document is
- which people are linked to it
- whether sources exist
- whether jobs exist
- what the next action should be
11.2 Entry Points
A user can reach a Document detail page by:
- selecting a document from the Document page list
- being redirected after successfully creating a new document
- following a direct link to a known Document record
11.3 Document Detail Layout
The Document detail page should include:
- a header area with document name, document type, and key date values
- a metadata section with location_created, notes, and archive_identifier
- System metadata where created_at and updated_at are shown as read-only values
- a related people section
- a Sources section
- a Jobs section
The Document detail page should support:
- empty-state messaging when no related records exist
- clear next actions from each empty state
- future links to filtered Sources and Jobs views scoped to the current document
11.4 Read Empty States
If no related records exist:
- People section says no linked people yet
- Sources section says no sources added yet
- Jobs section says no jobs created yet
- each section presents one clear next action
11.5 Read Success Criteria
A successful Read experience means:
- The user can identify the Document immediately
- The user can see whether work has started
- The user can navigate directly to document-scoped Jobs and Sources workflows
12. Update Document Journey
12.1 User Intent
The user wants to correct or enrich metadata after creation without touching jobs or source transcriptions directly.
12.2 Update Entry Point
From the Document detail page:
- The user selects Edit document
- UI opens edit mode or a dedicated edit view
12.3 Editable Fields
First release editable fields:
- name
- document_type
- document_date
- document_date_raw
- location_created
- notes
- archive_identifier
Read-only or system-managed fields:
- id
- created_at
- updated_at
12.4 Update Validation Rules
- name remains required
- document_type remains required
- document_date and document_date_raw may both be present
- if both date fields are present, document_date remains canonical
- validation errors should be shown inline and block save
12.5 Update Save Behavior
On save:
- system validates form data
- system persists Document updates
- updated_at is refreshed by system policy
- UI shows a confirmation message
- user remains on Document detail page with refreshed values
12.6 Update Failure Behavior
If save fails:
- Show a clear error message
- keep user edits in form where possible
- do not show stale success messaging
- Allow retry without losing context
13. Delete Document Journey
13.1 User Intent
The user wants to remove a Document only when it is safe and unambiguous.
13.2 Delete Entry Point
From the Document detail page:
- The user selects Delete document
- UI opens a confirmation dialog explaining permanence
13.3 Delete Guardrails
Delete is allowed only when:
- the Document has no related Source records
- the Document has no related Job records
Delete is blocked when:
- any Source exists for the Document
- any Job exists for the Document
13.4 Blocked Delete UX
When blocked:
- Show an explicit reason that related Jobs or Sources exist
- Show which dependency types are present
- provide links to filtered Sources and Jobs for cleanup
- keep the Document unchanged
13.5 Allowed Delete UX
When allowed:
- Show final confirmation with document name
- perform delete
- show success confirmation
- return user to Document page list
13.6 Delete Failure Behavior
If delete fails due to system error:
- Show a clear error message
- keep user on Document detail page
- preserve ability to retry
14. Non-Goals for This Flow
The Document journey does not define:
- Source upload field-level UX
- Job execution internals
- revision editor behavior for transcriptions
- multi-person recipient workflows in first release
15. Relationship to Other Workflows
This Document workflow integrates with:
- Sources workflow for adding pages or files to the document
- Jobs workflow for transcription execution
- Person workflow for future expansion beyond one optional linked person
16. Relationship to Schema Mapping
This document is the intended UX contract.
The companion schema-mapping document should answer:
- which schema field appears on which screen
- whether the field is currently implemented
- whether the field is hidden, editable, or system-managed
- what the implementation gap is between intended UX and current code
17. Deferred Items
These topics are intentionally deferred to future revisions:
- multiple linked people during create and update
- recipient support during create and update
- a broader role model for non-author document relationships
- filtered Jobs and Sources list navigation details