Book reflection journal
The reading journal lets signed-in members write a text reflection on a book they have finished, choosing public or private visibility and an optional spoiler flag, and lets any visitor browse the resulting community reflections. Spoiler-flagged reflections are hidden behind a reveal toggle until the reader chooses to show them.
Document details · v1
User flow
4member
Open the reading journal to see community reflections
ResultThe page shows the list of existing reflections (reviews) with book title, date, author name, and a count of how many reflections exist; if not signed in, a sign-in prompt is shown above the list
Interaction details
- all · navigate
member
Write a reflection on a finished book
ResultThe member picks a book, chooses visibility (PUBLIC or PRIVATE), optionally marks the entry as containing a spoiler, enters reflection text (up to 1000 characters) and publishes it; on success the form is cleared and the reflection appears in the list
Starts when · Member is signed in · The selected book is marked FINISHED on the member's shelf
Interaction details
- desktop · submit
- mobile · submit
member
Update a previously written reflection for the same book
ResultSubmitting the form again for a book the member already reflected on replaces the existing reflection's text, visibility, and spoiler flag instead of creating a second entry
Starts when · Member already has a reflection saved for that book
Interaction details
- all · submit
member
Read the content of a spoiler-flagged reflection
ResultThe reflection text is hidden behind a spoiler warning notice until the reader clicks to reveal it, after which the full text is shown and can be hidden again
Starts when · The reflection is marked as containing a spoiler
Interaction details
- all · click
Business rules
4Policies and constraints the product must keep.
- 01PermissionBR-JOURNAL-01
Only an authenticated member with a valid session can submit a reflection; otherwise the request fails with status 401 and error code UNAUTHENTICATED.
Rule scope and code anchor
Roles · ROLE-MEMBER, ROLE-USER
Read linked criteria here
- AC-JOURNAL-01A signed-in member who has finished a book can submit a reflection for it and receives a successful result (status 200), after which the form clears and the reflection is listed.
- AC-JOURNAL-02An unauthenticated submission attempt is rejected with status 401 and error code UNAUTHENTICATED.
- 02RestrictionBR-JOURNAL-02
A reflection can only be submitted for a book the member has marked FINISHED on their shelf; otherwise the request fails with status 409 and error code REVIEW_REQUIRES_FINISHED.
Rule scope and code anchor
Roles · ROLE-MEMBER
Read linked criteria here
- AC-JOURNAL-01A signed-in member who has finished a book can submit a reflection for it and receives a successful result (status 200), after which the form clears and the reflection is listed.
- AC-JOURNAL-03A reflection submitted for a book the member has not finished is rejected with status 409 and error code REVIEW_REQUIRES_FINISHED.
- 03ValidationBR-JOURNAL-03
Reflection text must be a non-empty string (after trimming) of at most 1000 characters, visibility must be either PUBLIC or PRIVATE, and the spoiler flag must be a boolean; any violation produces a VALIDATION error.
Rule scope and code anchor
Roles · ROLE-MEMBER
Linked criteria 1Criterion 04Read linked criteria here
- AC-JOURNAL-04A reflection with empty text, text longer than 1000 characters, an invalid visibility value, or a non-boolean spoiler flag is rejected with a VALIDATION error.
- 04PolicyBR-JOURNAL-04
A member can hold at most one reflection per book; resubmitting for the same book overwrites the stored text, visibility and spoiler flag rather than creating a duplicate entry.
Rule scope and code anchor
Roles · ROLE-MEMBER
Linked criteria 1Criterion 05Read linked criteria here
- AC-JOURNAL-05Resubmitting a reflection for a book the member already reviewed updates the existing reflection's text, visibility, and spoiler flag instead of adding a second entry.
Acceptance criteria
6Expected outcomes. These entries do not claim a test was run or passed.
- 01CriterionAC-JOURNAL-01
A signed-in member who has finished a book can submit a reflection for it and receives a successful result (status 200), after which the form clears and the reflection is listed.
- 02CriterionAC-JOURNAL-02
An unauthenticated submission attempt is rejected with status 401 and error code UNAUTHENTICATED.
Linked rules 1Rule 01 - 03CriterionAC-JOURNAL-03
A reflection submitted for a book the member has not finished is rejected with status 409 and error code REVIEW_REQUIRES_FINISHED.
Linked rules 1Rule 02 - 04CriterionAC-JOURNAL-04
A reflection with empty text, text longer than 1000 characters, an invalid visibility value, or a non-boolean spoiler flag is rejected with a VALIDATION error.
Linked rules 1Rule 03 - 05CriterionAC-JOURNAL-05
Resubmitting a reflection for a book the member already reviewed updates the existing reflection's text, visibility, and spoiler flag instead of adding a second entry.
Linked rules 1Rule 04 - 06CriterionAC-JOURNAL-06
A reflection marked as a spoiler displays a warning notice instead of its text until the reader toggles it open, and can be hidden again afterward.
Linked rules 0
Source files 21
- page.tsx
- LeafProvider.tsx
- useLeafState.ts
- useLeafLocale.ts
- locale.ts
- layout.tsx
- headings.tsx
- store.mjs
- initial-state.mjs
- password.mjs
- action-support.ts
- domain-error.mjs
- session.mjs
- validation.mjs
- types.ts
- FeatureFrame.tsx
- journal.tsx
- reviews.tsx
- actions.ts
- reviews.mjs
- actionView.ts
Source anchors are injected deterministically. No GitHub repository is connected. File links are unavailable.
