Skip to content

Preserve cleared offline Journal entries and speed up large-history writing - #207

Merged
callumalpass merged 2 commits into
mainfrom
journal-performance-offline-a11y
Nov 28, 2026
Merged

callumalpass merged 2 commits into
mainfrom
journal-performance-offline-a11y

Conversation

@callumalpass

Copy link
Copy Markdown
Member

Journal now reopens a deliberately cleared entry under its original record ID. The date picker and day arrows can resume a locally held page while the collection listing is unavailable. A refused session update keeps its status message, and the outside-edit banner follows actual conflict evidence.

The history picker reuses its sorted saved entries and visible buttons when possible. The writer uses intrinsic textarea sizing where supported, avoids building a second copy of a long page to position an end caret, and counts words once per changed body.

Chromium timings

One warm-up plus nine measured samples per revision and size. Baseline and candidate alternate order in the same Chromium 149.0.7827.55 process, each sample in a fresh browser context. Values are milliseconds. The reported p95 is nearest-rank, the slowest of nine samples.

Entries Operation Base median Head median Base p95 Head p95
5000 Startup / history hydration 72.70 31.50 108.70 98.00
5000 Open picker 141.10 76.70 261.20 225.00
5000 Next 50 entries 8.20 6.10 70.10 21.70
5000 Exact-date filter 2.60 2.00 18.20 8.80
5000 Append one character 69.90 44.80 178.00 119.50
5000 Input through autosave 1868.50 1561.90 2333.20 1843.00
10000 Startup / history hydration 54.10 43.70 96.90 126.90
10000 Open picker 109.40 99.40 198.40 195.80
10000 Next 50 entries 11.30 6.80 29.50 26.10
10000 Exact-date filter 2.30 2.30 7.10 11.90
10000 Append one character 114.00 39.70 180.40 177.10
10000 Input through autosave 1731.60 1643.80 2576.60 2246.60

At 10,000 entries median input dropped from 114.0 to 39.7 ms. The startup and date-filter p95s increased on this shared host. The input p95 remained near 180 ms.

Startup measures Journal mount through the first history scan after fixture setup. Picker open includes a refresh through 500-record in-memory SDK pages. Pagination and exact-date input are synchronous UI timings. Typing appends one character to a 55,296-character entry. Autosave measures the same input through confirmed SDK fixture readback, including the 1,200 ms idle delay. Network transit, native replica indexing, and external font downloads are outside these timings. Journal's shipped history search is its date filter. There is no full-text search, tag filter, or journal-wide backup/export view in this revision.

Recovery and accessibility

  • Three new regressions fail against 3b3bcdd. They cover editing two dates offline, switching away and back after a clear, restoring the cleared page on reload, confirming both original record bodies after reconnect, opening a local date after a refused listing, and showing an ordinary storage refusal without a conflict banner.
  • Axe-core 4.11.0 ran against Today, the past-entry writer, picker, date search, Settings, and the draft recovery banner at 360 and 1280 px, each in both color schemes. Two additional touch-typing scans brought the total to 26. No WCAG A/AA violations or horizontal overflow were reported in these scans.
  • Keyboard and touch assertions caught picker dismissal moving focus away from the opener in all four configurations, and fading touch controls in both themes. Those checks pass on the candidate. Choosing an entry still focuses the writer.

Reproduce

Run from the PR checkout with Node 22 and npm. The baseline argument points to a checkout with its own dependencies. The harness reads the same fixture against each checkout's application source and bundled styles.

npm ci
npm ci --prefix tools/smoke
npm exec --prefix tools/smoke -- playwright install chromium
git worktree add --detach ../journal-bench-base 3b3bcddf819bd2c1b0c263d710d3d1f6241199ab
npm ci --prefix ../journal-bench-base
node benchmarks/browser-journal.mjs bench ../journal-bench-base
node benchmarks/browser-journal.mjs axe
npm run verify

@callumalpass
callumalpass enabled auto-merge (squash) November 28, 2026 12:17
@callumalpass
callumalpass merged commit da89e67 into main Nov 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant