10 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.
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 links one related person.
- The system creates the Document.
- If a person was selected or created, the system links that Person to the Document through DocumentPerson.
- 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 Sources section
- a Jobs section
- empty states when no sources or jobs exist yet
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.
- Text inputs are acceptable for first release, even where future versions may use dropdowns or richer selectors.
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 | Search/select or create inline | No | Intended to support common author-like associations without making the field mandatory |
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.
- 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
- create a new Person if the person does not already exist
- 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:
- Searchable or scrollable list of existing Person records.
- Option to create a new Person inline or in a small secondary flow.
- Clear display of the selected related person before submit.
If the person does not exist:
- User selects Create new person.
- User enters the minimum required Person information.
- System creates Person.
- System returns to Document create flow.
- System links the new Person if the user completes Document creation.
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. Non-Goals for This Flow
The Create Document flow does not:
- upload document images or PDFs
- create transcription jobs
- start AI processing
- create Source rows directly
- edit page-level transcription content
Those actions belong to later workflows.
12. Relationship to Other Workflows
This Document creation workflow should precede:
- adding Sources to a Document
- creating transcription Jobs
- reviewing raw transcription output
- editing revised transcription text
- linking additional people or recipients later
13. 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
14. Deferred Items
These topics are intentionally deferred to future revisions:
- multiple linked people during create
- recipient support during create
- a broader role model for non-author document relationships
- filtered Jobs and Sources list navigation details