Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
773fbac
docs: archive stale workflow plans
nonnil May 27, 2026
4c91ffb
perf: reduce reader DB work
nonnil May 28, 2026
fc19659
docs: add lazy loading workflow
nonnil May 28, 2026
e24378d
docs: add popover translation UI workflow
nonnil May 28, 2026
89b9489
docs: expand translation default workflow
nonnil May 28, 2026
d9d8100
feat: define browse page contract
nonnil May 28, 2026
28def27
feat: paginate memory browse queries
nonnil May 28, 2026
3c5a24b
feat: expose memory browse page loader
nonnil May 28, 2026
fd43d41
feat: add infinite scroll to memories
nonnil May 28, 2026
4babf16
feat: lazy load browse flashbacks
nonnil May 28, 2026
00dc970
feat: lazy load reader all flashbacks
nonnil May 28, 2026
72b3f75
fix: unify translation popover defaults
nonnil May 28, 2026
6a1d3f2
fix: preserve browse tab keyboard focus
nonnil May 28, 2026
8332228
test: isolate backup git fixtures from hooks
nonnil May 28, 2026
eddf0df
test: isolate backup git commands from hook env
nonnil May 28, 2026
1d155b3
feat: add vim-like memory browse keybindings
nonnil May 28, 2026
7a8a4bf
fix: honor renderable flashbacks in lazy browse
nonnil May 29, 2026
7889d42
Merge pull request #26 from hauntedfail/feat/lazy-loading
nonnil May 30, 2026
7b6cb06
fix: isolate popup callbacks from tracking
nonnil May 30, 2026
46a7313
fix: address browse pagination review feedback
nonnil May 30, 2026
3da6381
fix: address remaining pr review feedback
nonnil May 30, 2026
c54ef1c
fix: close lazy loading review gaps
nonnil May 30, 2026
efec039
fix: persist reader translation defaults before start
nonnil May 30, 2026
c0bb519
fix: harden translation submit review edges
nonnil May 30, 2026
ef81b41
fix: guard browse review edge cases
nonnil May 30, 2026
aa4b35d
fix: keep scanning stale browse candidates
nonnil May 30, 2026
bddc401
docs: add task 23 reader toc reading-progress exec-plan
nonnil May 30, 2026
a6cf2e1
feat: add toc reading-range model
nonnil May 30, 2026
6f1a433
feat: visualize active reading range in reader toc
nonnil May 30, 2026
91f3176
fix: relocate toc reading-range styles to satisfy style contracts
nonnil May 30, 2026
0ceb43c
docs: document toc reading-progress contract
nonnil May 30, 2026
534c145
fix: read toc active range as accessor to avoid right-rail remount on…
nonnil May 30, 2026
f9cbd54
merge fix/perform into fix/anything
nonnil May 30, 2026
a060510
Merge pull request #27 from hauntedfail/fix/anything
nonnil May 30, 2026
402ada6
Merge remote-tracking branch 'origin/fix/perform' into fix/toc
nonnil May 30, 2026
f4ced5f
Merge pull request #28 from hauntedfail/fix/toc
nonnil May 30, 2026
796b8f1
feat: spy on the visible toc range with an elastic droplet highlight
nonnil May 30, 2026
5b32a60
fix: render toc reading range as one seamless vertically-growing band
nonnil May 30, 2026
9cfb9a5
feat: auto-scroll the bounded toc to follow the spied reading range
nonnil May 30, 2026
f36e8b1
fix: preserve native browse key activation
nonnil May 31, 2026
dbcdddd
merge fix/perform into feat/vim-like-key-bind
nonnil May 31, 2026
4e27a0c
Merge pull request #29 from hauntedfail/feat/vim-like-key-bind
nonnil May 31, 2026
65c4d9d
fix: handle PR 25 review follow-ups
nonnil May 31, 2026
9b8fc75
test: align reader translation trigger selector
nonnil May 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/architecture/data-and-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Runtime tables:
- `translation_projection_spans`
- `backup_environment_stamps`
- `backup_failsafe_alerts`
- `app_settings`

`memories` stores URL metadata, content path, extraction status, backup status,
and timestamps.
Expand All @@ -73,6 +74,11 @@ one exists. Alert kinds distinguish path drift, missing backup repository,
remote push failure, and backup content inconsistency so the UI can offer only
the recovery actions that are safe for that condition.

`app_settings` stores singleton local application preferences. Translation
defaults such as `translation_target_language`, `codex_translation_model`, and
`codex_translation_reasoning_effort` are current UI/settings state used to seed
future translation forms. They are not historical job records.

## Flashback Model

Flashbacks are SQLite metadata rendered into reader HTML at read time.
Expand Down Expand Up @@ -159,6 +165,9 @@ Translated content is stored beside the source memory:
```

`translation_jobs` is the current/history table for translation attempts.
Each row stores the resolved `model` and `reasoning_effort` used for that
attempt, so later settings changes do not rewrite the model or effort that a
queued, running, completed, or failed job actually used.
`translation_chunks` may temporarily hold translated chunk Markdown while a job
is running, but completed chunk bodies and temporary projection JSON are purged
after final commit.
Expand Down
4 changes: 3 additions & 1 deletion docs/architecture/ui-and-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ The initial markdown reader supports:
- HTML sanitization.
- Footnotes.
- Heading anchors.
- Table of contents.
- Table of contents that tracks the reader's live position and highlights the
active chapter reading range (see the design-system reader-and-content TOC
reading-progress contract).
- Controlled external embeds.
- Flashback marks.

Expand Down
5 changes: 5 additions & 0 deletions docs/references/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ trauma.config.json
The initial design does not allow executable config files or arbitrary
lifecycle hooks.

Runtime UI preferences are stored in SQLite, not in `trauma.config.json`.
Codex translation defaults such as the selected model and reasoning effort are
managed through `app_settings` so the reader translation popover can reopen with
the user's last saved selections.

## Initial Shape

```json
Expand Down
6 changes: 6 additions & 0 deletions docs/references/design-system/components-and-surfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ drawers:
- General action menus use the same `Popup` shell with `role="menu"`. Memory,
Moment, and Flashback delete actions use one danger menu-item treatment and
the shared trash icon.
- Popup chrome is translucent by default: `Popup` owns the rounded elevated
border, `bg-trauma-bg-elev/50`, backdrop blur, animation, and layer. Consumers
only provide width, grid, gap, padding, text alignment, and placement-specific
constraints.
- Popovers close on Escape, outside pointer interaction, or successful
completion of the contained workflow.
- Outside pointer dismissal is a cancel action for confirmation popovers. It
closes the panel and resets draft form edits without submitting the action.
- Add memory keeps the shell-level command globally reachable, but the composer
itself stays attached to the rail action that opened it.
- The primary rail must allow visible overflow and sit above route panes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Theme controls:
- Do not write to SQLite, markdown files, or `trauma.config.json`.
- Expose the opened panel as a labelled dialog-like popover.
- Close the popover with Escape and outside pointer interaction.
- Use the shared translucent `Popup` surface for anchored popovers; domain
components must not add their own outside-pointer listeners for those panels.

## Focus And Keyboard

Expand All @@ -86,6 +88,8 @@ Rules:
- Route rows and reader links must have visible focus treatment.
- Reader flashback keyboard toggling must remain explicit and must not trigger
during ordinary text navigation.
- Confirmation popovers must treat Cancel, Escape, and outside pointer
dismissal as the same cancel/reset path.

## Labels And Landmarks

Expand Down
44 changes: 44 additions & 0 deletions docs/references/design-system/reader-and-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,50 @@ Contract:
- Entry uses `animate-trauma-pop-bounce` for a short popup-style bounce.
- Motion is disabled under `prefers-reduced-motion: reduce`.

### Reading-Progress Visualization

The TOC tracks the reader's live position and visualizes it as a background
treatment, so it doubles as a reading-progress indicator without losing its
static aids (anchors, scroll fades, Moment toggles, long-press menus).

- `MemoryReader` observes the rendered section headings
(`[data-reader-section-anchor]`) inside the reading column. Each heading owns
the section that runs to the next heading; a section counts as on screen when
that span overlaps the viewport.
- The spy tracks whatever range is currently rendered on screen, not a single
chapter. If the sections for several chapters are visible at once, every
visible entry is highlighted. The result is always a contiguous slice of the
TOC ordering; the topmost visible entry is the `leadId`.
- The reader and the right-rail TOC communicate this range through
`MemoryReader`-owned reactive state passed down as props; the TOC never reads
reader DOM.
- The range is painted by a single measured overlay element
(`trauma-toc-reading-band`) positioned behind the entries, not per-row
backgrounds. Its top/height are measured from the first and last on-screen
rows so the highlight is one seamless region with no visible seams between
chapters. The fill is a subtle translucent contrast lift over the TOC surface
(`color-mix(in srgb, var(--fg-1) 8%, transparent)`); background-only, it does
not recolor or re-weight the spied section text. Only design tokens are used;
no raw hex.
- The band eases its `top`/`height` with an elastic
`cubic-bezier(0.34, 1.56, 0.64, 1)` transition, so moving between adjacent
chapters reads as the band growing vertically out of the previous range into
the next one rather than popping or switching instantly. The first paint is
not animated (the band appears in place).
- The `leadId` entry carries `aria-current="location"` for assistive tech; this
is semantic only and applies no visual emphasis.
- With nothing on screen mapped to a heading (empty TOC) the TOC renders in its
plain static state with no highlight.
- The TOC body is bounded, so memories with many sections scroll inside it. When
the spied range reaches a section outside that bounded viewport, the TOC
auto-scrolls just enough to keep the range in view and follow the reader. This
runs only on range changes, so manual TOC browsing is not interrupted until
the reader scrolls the document again.
- Scroll observation is `requestAnimationFrame`-batched, attached as passive
listeners, and fully torn down on reader unmount. Under
`prefers-reduced-motion: reduce` the band only fades, its position no longer
animates, and the follow-scroll jumps instantly instead of smoothing.

## Markdown Prose

Rendered markdown uses Tailwind Typography through `@tailwindcss/typography`.
Expand Down
6 changes: 6 additions & 0 deletions docs/references/design-system/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,16 @@ Check:
chrome.
- Theme controls are hidden until the left-rail `Theme` tab opens their popover.
- On phone, Theme opens from the bottom tab bar as a popover above the bar.
- Theme, Add memory, action-menu, taxonomy, and reader translation popovers use
the shared translucent elevated panel with backdrop blur.
- Theme selected state is visible inside the popover in every theme.
- Theme popover buttons remain labelled and readable below desktop.
- Add-memory composer opens from shell routes as a popover above route panes.
- On phone, Add memory opens from the bottom tab bar as a popover above the bar.
- Reader translation popover outside-click and Escape dismissal close without
starting a translation.
- Reader translation popover opens with the persisted model and reasoning effort
selected when DB-backed defaults exist.
- Tablet compact Add memory uses a centered icon-only control without paper or
Hermès wax-seal chrome shifting the icon.
- Browse filters update URL state without clearing unrelated query state.
Expand Down
66 changes: 47 additions & 19 deletions docs/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,53 @@ architecture, reference, quality, or operations docs.
| Order | Workflow | Domain | Status |
| --- | --- | --- | --- |
| 9 | [E2E integration hardening](task-09-e2e-integration-hardening.md) | Deterministic fixtures and full flow Playwright coverage | Available for further hardening |
| 10 | [Runtime dev server stabilization](task-10-runtime-dev-server-stabilization.md) | `bun run dev` crash, deterministic host/port contract, startup smoke | Merged baseline |
| 11 | [Test suite health refactor](task-11-test-suite-health-refactor.md) | Test boundaries, weak assertions, startup coverage, script normalization | Ready after Task 10 |
| 12 | [GitHub Actions and docs health](task-12-github-actions-and-docs-health.md) | CI trigger split, docs health checks, scheduled docs maintenance workflow | Ready after Task 11 |
| 13 | [Markdown reader library decision](task-13-markdown-reader-library-decision.md) | Reader library spike, ADR, dependency direction | Ready after Task 10 |
| 14 | [Markdown reader refactor](task-14-markdown-reader-refactor.md) | Reader pipeline decomposition and behavior-preserving refactor | Ready after Task 13 |
| 15 | [Refactor wave integration](task-15-refactor-wave-integration.md) | Cross-task verification and workflow/docs synchronization | Ready after Tasks 10-14 |
| 19 | [Codex translation for memories](task-19-codex-translation.md) | ChatGPT sign-in through Codex, translation target settings, Codex-backed memory translation, and translated CONTENT.md variants | Ready |
| 19R | [Codex app-server auth repair](task-19-codex-translation-auth-repair.md) | Repair Task 19 device-code completion, app-server auth interpretation, Settings refresh, and translation auth preflight | Draft |
| 19S | [Codex app-server protocol repair](task-19-codex-translation-protocol-repair.md) | Repair Task 19 stable app-server request schema, protocol error taxonomy, API mapping, and reader error copy | Draft |
| 19T | [Codex translation model controls](task-19-codex-translation-model-controls.md) | Add Settings defaults and reader confirmation popup for Codex translation model, reasoning effort, and language | Draft |
| 19U | [Codex translation segment reassembly](task-19-codex-translation-segment-reassembly.md) | Split parser-backed segment extraction, deterministic Markdown reassembly, validation, runtime integration, docs, and E2E verification into domain subtasks | Draft |
| 19V | [Translated reader annotation projection](task-19-codex-translation-reader-projections.md) | Superseded for Flashbacks by Task 19W; retain only as historical projection planning context until a new Moment/alignment workflow is approved | Superseded for Flashbacks |
| 19W | [Variant-local translated Flashbacks](task-19-codex-translation-variant-local-flashbacks.md) | Store source and translated Flashbacks independently while keeping global Flashback browse/search surfaces unified | Implemented |
| 19X | [Translation validation feedback repair](task-19-codex-translation-validation-feedback-repair.md) | Add structured validation diagnostics and retry feedback for code-heavy translation failures without relaxing preservation guarantees | In progress |
| 11 | [Test suite health refactor](task-11-test-suite-health-refactor.md) | Test boundaries, weak assertions, startup coverage, script normalization | TODO after archived Task 10 baseline |
| 12 | [GitHub Actions and docs health](task-12-github-actions-and-docs-health.md) | CI trigger split, docs health checks, scheduled docs maintenance workflow | TODO after Task 11 |
| 13 | [Markdown reader library decision](task-13-markdown-reader-library-decision.md) | Reader library spike, ADR, dependency direction | TODO after archived Task 10 baseline |
| 14 | [Markdown reader refactor](task-14-markdown-reader-refactor.md) | Reader pipeline decomposition and behavior-preserving refactor | TODO after Task 13 |
| 15 | [Refactor wave integration](task-15-refactor-wave-integration.md) | Cross-task verification and workflow/docs synchronization | TODO after Tasks 11-14 |
| 20 | [Lazy loading performance](task-20-lazy-loading-performance/README.md) | Cursor-paginated memories, lazy Flashback data, reader All-tab deferral | Ready on `feat/lazy-loading` from `fix/perform` |
| 21 | [Popover and translation UI fixes](task-21-popover-and-translation-ui-fixes/README.md) | Unified translucent popovers, reader translation cancellation, and translation UI integration checks | Ready on `fix/anything` from `fix/perform` |
| 22 | [Vim-like memory browse keybindings](task-22-vim-like-key-bindings.md) | `/memories` keyboard cursor, search focus, and selected-memory open behaviour | In progress on `feat/vim-like-key-bind` |
| 23 | [Reader TOC reading-progress](task-23-reader-toc-reading-progress/README.md) | Dynamic TOC that visualizes the active chapter reading range on `/memories/:id` | Active on `fix/toc` from `fix/perform` |

## Current Audit Notes

- Task 10 was stale in the active task map because its startup contract is
already part of the merged baseline through `dev`, `start`, `preview`, and
`dev:smoke`; the execution plan is now archived.
- Task 19 and its repair/follow-up plans are archived as historical Brilliant
execution records. Current translation behaviour is represented by the code,
architecture/reference docs, and tests, not active workflow plans.
- Tasks 11-15 remain active TODO plans after checking the current tree. In
particular, `scripts/check-docs-health.ts`, `docs:check`,
`.github/workflows/docs-health.yml`, `docs/references/reader-pipeline-decision.md`,
and the Task 14 split reader modules are not present on `main`.
- Task 20 is a performance workflow for the `fix/perform` follow-up branch. It
is intentionally scoped to lazy loading and pagination; renderer caching,
extractor pooling, and backup integrity refactors remain separate future
work unless a later workflow adds them.
- Task 21 is a focused UI and integration repair workflow for the
`fix/anything` branch. It does not reopen archived Task 19 translation
architecture; it only changes reader translation popover behaviour, shared
popover chrome, and integration verification around the existing translation
APIs.
- Task 23 is a reader UI workflow for the `fix/perform` follow-up branch on the
`fix/toc` worktree. It is scoped to making the reader TOC visualize the live
reading range; it must not change markdown rendering, Moment behaviour, or any
non-reader surface.

## Archived Workflows

`docs/workflows/archive/` is intentionally retained only as a tracked
placeholder. Completed workflow records, one-off review captures, branch
history, and implementation diaries should not accumulate here. If a completed
task reveals a durable rule, move that rule into the owning semantic document
instead of preserving the old execution plan.
`docs/workflows/archive/` contains historical execution plans that are no
longer active work. Do not start implementation from archived files. If an
archived task reveals a durable rule, move that rule into the owning semantic
document instead of reviving the old execution plan.

| Workflow | Archived Location | Reason |
| --- | --- | --- |
| Task 10: Runtime dev server stabilization | [archive/task-10-runtime-dev-server-stabilization.md](archive/task-10-runtime-dev-server-stabilization.md) | Startup contract is merged into the shared baseline. |
| Task 19: Brilliant Codex translation family | [archive/task-19-codex-translation.md](archive/task-19-codex-translation.md) | Translation implementation and follow-up repair plans have landed or been superseded. |

## Worker Rules

Expand Down Expand Up @@ -104,3 +129,6 @@ Use concise branch names that match the workflow:
- `refactor/markdown-reader`
- `chore/refactor-wave-integration`
- `feat/brilliant`
- `feat/lazy-loading`
- `fix/anything`
- `feat/vim-like-key-bind`
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Task 10: Runtime Dev Server Stabilization Workflow

> Archived execution plan. The startup contract described here has landed on
> `main`; use current package scripts, operations docs, and tests for active
> implementation decisions.

## Goal

Make local development startup reliable. `bun run dev` must start the app
without exit code 1 on a clean checkout with the pinned toolchain.

## Required Context

- [Technology stack](../references/technology-stack.md)
- [Local/self-hosting operation](../operations/local-self-hosting.md)
- [Verification strategy](../quality/verification.md)
- [Coding standards](../references/coding-standards/INDEX.md)
- [Technology stack](../../references/technology-stack.md)
- [Local/self-hosting operation](../../operations/local-self-hosting.md)
- [Verification strategy](../../quality/verification.md)
- [Coding standards](../../references/coding-standards/INDEX.md)

## Current Failure To Reproduce

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ the translation runner before scheduling Codex-backed translation work.

## Required Context

- [Documentation index](../INDEX.md)
- [Documentation index](../../INDEX.md)
- [Task 19 overview](task-19-codex-translation.md)
- [Task 19 app-server integration](task-19-codex-translation/05-codex-app-server-integration.md)
- [Task 19 auth setup flow](task-19-codex-translation/06-codex-auth-and-device-code-setup-flow.md)
- [Task 19 prompt and validation contract](task-19-codex-translation/contracts/06-codex-prompt-and-validation.md)
- [Configuration reference](../references/configuration.md)
- [Verification strategy](../quality/verification.md)
- [Coding standards](../references/coding-standards/INDEX.md)
- [Configuration reference](../../references/configuration.md)
- [Verification strategy](../../quality/verification.md)
- [Coding standards](../../references/coding-standards/INDEX.md)

## Current Failure To Reproduce

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ translation.

## Required Context

- [Documentation index](../INDEX.md)
- [Documentation index](../../INDEX.md)
- [Task 19 overview](task-19-codex-translation.md)
- [Task 19 app-server integration](task-19-codex-translation/05-codex-app-server-integration.md)
- [Task 19 frontend translation controls and progress UI](task-19-codex-translation/12-frontend-translation-controls-and-progress-ui.md)
- [Task 19 error handling and cancellation](task-19-codex-translation/15-error-handling-and-cancellation.md)
- [Task 19 test plan and fixtures](task-19-codex-translation/16-test-plan-and-fixtures.md)
- [Configuration reference](../references/configuration.md)
- [Design system reference](../references/design-system/DESIGN.md)
- [Verification strategy](../quality/verification.md)
- [Coding standards](../references/coding-standards/INDEX.md)
- [Configuration reference](../../references/configuration.md)
- [Design system reference](../../references/design-system/DESIGN.md)
- [Verification strategy](../../quality/verification.md)
- [Coding standards](../../references/coding-standards/INDEX.md)

## Current Behavior To Replace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ failures as app-server availability failures.

## Required Context

- [Documentation index](../INDEX.md)
- [Documentation index](../../INDEX.md)
- [Task 19 overview](task-19-codex-translation.md)
- [Task 19 app-server integration](task-19-codex-translation/05-codex-app-server-integration.md)
- [Task 19 error handling and cancellation](task-19-codex-translation/15-error-handling-and-cancellation.md)
- [Task 19 test plan and fixtures](task-19-codex-translation/16-test-plan-and-fixtures.md)
- [Task 19 prompt and validation contract](task-19-codex-translation/contracts/06-codex-prompt-and-validation.md)
- [Configuration reference](../references/configuration.md)
- [Verification strategy](../quality/verification.md)
- [Coding standards](../references/coding-standards/INDEX.md)
- [Configuration reference](../../references/configuration.md)
- [Verification strategy](../../quality/verification.md)
- [Coding standards](../../references/coding-standards/INDEX.md)

## Current Failure To Reproduce

Expand Down
Loading
Loading