Quick note appends to its page, in handwriting (Closes #92) #93

Merged
jfro merged 3 commits from quick-note-92 into main 2026-11-22 17:51:48 +00:00
Owner

Closes #92

Branch quick-note-92 (3 commits: 54ef44b feature, 9501414 review fixes, c5621cc Jeremy's review) off main v1.8.1 (16bdb2e).

What changes

  • A quick note is drawn in pen strokes (Hershey, as drawn report pages and todo write-back are), on the template's rules, instead of typed text.
  • Where it goes (Jeremy's review): under the writing on the notebook's last page when that page changed today (its modifed time in .content, else the notebook's last change, as a local date via TZ). Otherwise (an earlier day, no pages, typed text on the page, or the note doesn't fit in the rows left) it starts a new drawn page at the end (TypedPages.add_page(kind: :drawn)). No dedicated quick-note page, no new tables.
  • Notes are drawn on the page's next free rows: one empty row under the lowest ink (his or ours), via PageInk.write/4. Long lines wrap; a note that doesn't fit isn't split.
  • OCR (Jeremy's review): notes are drawn as their own author (QuickNotes.author/0), not the device id whose layer OCR leaves out, and no text is recorded for the new version (PageInk.write(carry_text: false)), so the next sync reads the page like any page he wrote on: his writing and the notes together. A new page a note started keeps the note's text as drawn pages do.
  • PageInk.write/4 gains :author and carry_text: false. TypedPages.drawn_layout/1 is public.
  • Notebook changed on the tablet under a minute ago: the note waits. Queued as QuickNotes.WriteWorker (new quick_notes queue, snoozes while busy); the page says it waits and until about when, and updates when the worker writes it (PubSub).
  • Docs: docs/quick-notes.md ("Today's last page", "The page's text"); docs/typed-pages.md note.

Tests

mix precommit: 1408 passed. test/rm_analyzer/quick_notes_test.exs: a last page changed today gets the note under its writing; one from another day gets a new page; same_day_page/2 by local date (and the notebook's time when a page has none); typed-text last page gets a new page; second note the same day under the first (strokes kept, lower, drawn as the quick-note author, no text recorded); rollover when full; waits while busy + worker. test/rm_analyzer/quick_notes_ocr_test.exs: what OCR is given still has the note strokes, both under his unread handwriting and when he writes under a note.

Known limits

  • Our own write bumps the notebook's lastModified, so a second note within a minute of the first waits about 75 s.
  • Each note added to an existing page costs an OCR read of that page (when auto-transcribe is on), as his own edits do.
  • Not tried on a real tablet.
  • Screenshots below are from before the wording change (subtitle is now "Written in handwriting on today's last page of the notebook", the result "Added under the writing on page N of …"); new ones to follow.

Screenshots

appended-390.png

appended-390.png

appended-desktop.png

appended-desktop.png

form-390.png

form-390.png

form-desktop.png

form-desktop.png

waiting-390.png

waiting-390.png

waiting-desktop.png

waiting-desktop.png

Closes #92 Branch `quick-note-92` (3 commits: 54ef44b feature, 9501414 review fixes, c5621cc Jeremy's review) off main v1.8.1 (16bdb2e). ## What changes - A quick note is drawn in pen strokes (Hershey, as drawn report pages and todo write-back are), on the template's rules, instead of typed text. - **Where it goes (Jeremy's review):** under the writing on the notebook's **last page when that page changed today** (its `modifed` time in `.content`, else the notebook's last change, as a local date via `TZ`). Otherwise (an earlier day, no pages, typed text on the page, or the note doesn't fit in the rows left) it starts a new drawn page at the end (`TypedPages.add_page(kind: :drawn)`). No dedicated quick-note page, no new tables. - Notes are drawn on the page's next free rows: one empty row under the lowest ink (his or ours), via `PageInk.write/4`. Long lines wrap; a note that doesn't fit isn't split. - **OCR (Jeremy's review):** notes are drawn as their own author (`QuickNotes.author/0`), not the device id whose layer OCR leaves out, and no text is recorded for the new version (`PageInk.write(carry_text: false)`), so the next sync reads the page like any page he wrote on: his writing and the notes together. A new page a note started keeps the note's text as drawn pages do. - `PageInk.write/4` gains `:author` and `carry_text: false`. `TypedPages.drawn_layout/1` is public. - Notebook changed on the tablet under a minute ago: the note waits. Queued as `QuickNotes.WriteWorker` (new `quick_notes` queue, snoozes while busy); the page says it waits and until about when, and updates when the worker writes it (PubSub). - Docs: docs/quick-notes.md ("Today's last page", "The page's text"); docs/typed-pages.md note. ## Tests `mix precommit`: 1408 passed. test/rm_analyzer/quick_notes_test.exs: a last page changed today gets the note under its writing; one from another day gets a new page; `same_day_page/2` by local date (and the notebook's time when a page has none); typed-text last page gets a new page; second note the same day under the first (strokes kept, lower, drawn as the quick-note author, no text recorded); rollover when full; waits while busy + worker. test/rm_analyzer/quick_notes_ocr_test.exs: what OCR is given still has the note strokes, both under his unread handwriting and when he writes under a note. ## Known limits - Our own write bumps the notebook's lastModified, so a second note within a minute of the first waits about 75 s. - Each note added to an existing page costs an OCR read of that page (when auto-transcribe is on), as his own edits do. - Not tried on a real tablet. - Screenshots below are from before the wording change (subtitle is now "Written in handwriting on today's last page of the notebook", the result "Added under the writing on page N of …"); new ones to follow. ## Screenshots **appended-390.png** ![appended-390.png](https://git.knope.dev/attachments/e92b1fe8-f5bf-4b36-85e2-a880771b10c6) **appended-desktop.png** ![appended-desktop.png](https://git.knope.dev/attachments/b80ff96b-7836-4fcf-808a-66100e2d5e92) **form-390.png** ![form-390.png](https://git.knope.dev/attachments/fff67e9f-5872-47f0-8d77-dfc61e62f637) **form-desktop.png** ![form-desktop.png](https://git.knope.dev/attachments/0019545e-dffb-4c2b-bee4-64848a8238d3) **waiting-390.png** ![waiting-390.png](https://git.knope.dev/attachments/0c3f5dbb-9301-4298-a4c0-23a7ba148af6) **waiting-desktop.png** ![waiting-desktop.png](https://git.knope.dev/attachments/df0e232c-b477-492d-b2ae-58dde4e1e491)
A quick note is now drawn in Hershey handwriting instead of typed text,
and goes under the last note on the notebook's quick note page instead of
a page of its own. The first note (or one once that page is gone or full)
starts a new drawn page at the end of the notebook; later ones are drawn
on its next free rows, a row left under the lowest ink, in our own layer
via PageInk. A note that doesn't fit in the rows left starts a new page
whole. The page's text is recorded as the old with the note under it.

While the notebook changed on the tablet under a minute ago the note
waits: it's queued (QuickNotes.WriteWorker, snoozing while still busy),
the page says it waits and until when, and says when it's written.

Closes #92
fix(quick-notes): keep notes and unread handwriting in the page's text
All checks were successful
CI / test (pull_request) Successful in 1m57s
95014143b7
OCR leaves rM-Analyzer's layer out, so each quick note's text is now kept
(quick_note_texts) and added back to what OCR reads on its page. A note
added under handwriting that hasn't been read yet no longer records the
page as ours alone: OCR reads the new version.
feat(quick-notes): add to today's last page, read by OCR like his writing
All checks were successful
CI / test (pull_request) Successful in 1m47s
c5621cc88d
Jeremy's review of #93: a note goes under the writing on the notebook's
last page when that page changed today (its modifed time, local), else on
a new page. Notes are drawn as their own author, not the device id whose
layer OCR leaves out, and no text is recorded, so the next sync reads the
page like any he wrote on. Drops quick_note_pages and quick_note_texts and
QuickNotes.with_notes/4. A last page with typed text gets a new page.
jfro merged commit a4e5f9b78c into main 2026-11-22 17:51:48 +00:00
jfro deleted branch quick-note-92 2026-11-22 17:51:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/rm-analyzer!93
No description provided.