Todo small lines template as a Methods item (refs #51) #71

Manually merged
jfro merged 0 commits from feature/51-todo-template into main 2026-11-09 00:23:57 +00:00
Owner

Refs #51. Spike for the small lined todo template as a native reMarkable Methods template (Jeremy's D19: "use what the official third-party templates use"). Draft until Jeremy's tablet check.

What it does

  • Remarkable.NewTemplate writes a TemplateType cloud item (<id>.metadata, <id>.content = {}, <id>.template JSON) in one commit right after a sync, the same loop as NewPdf (412 → sync and retry ×3; already there → no-op). Each write is logged (item id, root hash, generation, uploads, ms).
  • Todos.Template: "Todo small lines": P Lines small's 52 px rules, a margin line at x 120.5, and a printed box on every rule left of the margin (Todos.Template.box/1, D31). OCR renders strokes only, on white (OCR.PageImage), so the boxes never reach it. The .template is built from Templates.segments/1 and box/1, which is also what the page view draws (Templates.svg/1, version 5), so the two match. Coordinates scale by templateWidth/1404 and templateHeight/1872, so one file fits the rM2 and the Paper Pro. The item id is fixed, so adding it twice adds it once.
  • Settings > reMarkable gets a Todo template card with Add to tablet (async). Once the item is synced it shows "On your tablet's template list".
  • Typed pages and draw_page write on its rules (same rules/1 and layout as P Lines small).
  • docs/todo-template.md: the format (from spacepanda.se and real Methods templates on GitHub), the risks, and the tablet check for Jeremy.

Risks

  • Methods may need Connect for cloud templates to show. The 3.30 beta reportedly hides custom templates.
  • Orientation: Jeremy's rM2 draws the item upright (no 90° turn, D29). If some rM2 software does turn it, we'd add a turned item under a new id.
  • We don't know yet what template.value a page on it stores (name or item id). The tablet check finds out.
  • Fallback if the picker never shows it: the generated PDF notebook (docs/generated-pdfs.md).

Checks

mix precommit green. New tests: new_template_test.exs (files, plan, write, retry on 412, no double add, logs), todos/template_test.exs (Methods fields, 37 straight paths, matches the SVG), and a settings LiveView test.

Screenshots (head 1ca35aa, Chromium; no horizontal scroll at 390 or 1280)

Settings > reMarkable, 390px, before adding:

390 before

390px, once the template is in the library:

390 added

Desktop, before adding:

desktop before

Desktop, added:

desktop added

Fixed (f2589fb), Nye F3: the rM2 reads a Methods canvas turned 90° from the Paper Pro's, so the template is now two items named "Todo small lines": the Paper Pro's (supportedScreens ["rmPP"], same id) and the rM2's (["rm2"], new id 6c73ab67-…, every point (x, y) → (y, 1404 - x), sx/sy kept). NewTemplate now writes a list in one commit and skips items already there, so only a missing one is written. Todos.Template.ids/0 replaces id/0; added? needs both. Docs updated. mix precommit: 1122 tests, 0 failures. The settings UI didn't change, so the screenshots still hold.

Fixed (5fb9d1c), D29/D34: Jeremy's rM2 drew the turned item sideways, so it's one upright item for rm2 + rmPP under a new id; Add to tablet removes our earlier items in the same commit.

57c5e80, D31: printed boxes. Every one of the 36 rules gets a 30 px box at x 76–106, from 40 px to 10 px above its rule (row 0: y 10.5–40.5). Todos.Template.box/1 (row 0–35 → {left, top, width, height}, the Lines.Marks rect) and boxes/0 are the one source: the .template draws each as a closed M/L/Z path, Templates.svg/1 (version 5) and the picker thumbnail draw the same rects. New id d7fac201-…; the upright item without boxes (1548ae34-…) joins stale_ids/0. Settings card text and icon now show the boxes. docs/todo-template.md updated (no more "no boxes printed"). Tests for box/1, the 36 drawn boxes matching it, the SVG and the thumbnail. mix precommit green.

The template at 2x (app drawing at fe0c01a, D36 layout, top left: title rule, margin at x 220.5, boxes at x 160–190 clear of the toolbar):

template at 2x, D36

Settings card at head 57c5e80, 390px and desktop (Chromium, no horizontal scroll):

390 card

desktop card

D36 (fe0c01a), Jeremy's rM2 re-check of 57c5e80: upright, but the boxes sat under the tablet's toolbar and he wants room for the list's title first. Now: one title rule at y 154.5 from the margin to 1403; 31 task rules from 258.5 every 52 px (last 1818.5); margin at x 220.5; boxes at x 160-190 (30 px, 40/10 above the rule), box/1 rows 0-30. Templates.rules/1 also returns title_y and margin_x. New id d3850d5e-…; 57c5e80's d7fac201-… joins stale_ids, so Add to tablet removes it. The typed-page layout now starts right of the margin, on the first task rule. Svg version 6; the settings card's icon and text show the title line. Also Nye's two wording notes (M/L/Z in the doc, duplicate moduledoc sentence). mix precommit: 1126 tests, 0 failures.

Settings card at fe0c01a, 390px and desktop (no horizontal scroll at either):

390 title

desktop title

The page as the app draws it (Templates.svg/1), the same drawing as the .template:

template

Refs #51. Spike for the small lined todo template as a native reMarkable **Methods** template (Jeremy's D19: "use what the official third-party templates use"). Draft until Jeremy's tablet check. ## What it does - **`Remarkable.NewTemplate`** writes a `TemplateType` cloud item (`<id>.metadata`, `<id>.content` = `{}`, `<id>.template` JSON) in one commit right after a sync, the same loop as `NewPdf` (412 → sync and retry ×3; already there → no-op). Each write is logged (item id, root hash, generation, uploads, ms). - **`Todos.Template`**: "Todo small lines": P Lines small's 52 px rules, a margin line at x 120.5, and a printed box on every rule left of the margin (`Todos.Template.box/1`, D31). OCR renders strokes only, on white (`OCR.PageImage`), so the boxes never reach it. The `.template` is built from `Templates.segments/1` and `box/1`, which is also what the page view draws (`Templates.svg/1`, version 5), so the two match. Coordinates scale by `templateWidth/1404` and `templateHeight/1872`, so one file fits the rM2 and the Paper Pro. The item id is fixed, so adding it twice adds it once. - **Settings > reMarkable** gets a **Todo template** card with **Add to tablet** (async). Once the item is synced it shows "On your tablet's template list". - Typed pages and `draw_page` write on its rules (same `rules/1` and layout as P Lines small). - `docs/todo-template.md`: the format (from spacepanda.se and real Methods templates on GitHub), the risks, and the **tablet check** for Jeremy. ## Risks - Methods may need Connect for cloud templates to show. The 3.30 beta reportedly hides custom templates. - Orientation: Jeremy's rM2 draws the item upright (no 90° turn, D29). If some rM2 software does turn it, we'd add a turned item under a new id. - We don't know yet what `template.value` a page on it stores (name or item id). The tablet check finds out. - Fallback if the picker never shows it: the generated PDF notebook (docs/generated-pdfs.md). ## Checks `mix precommit` green. New tests: `new_template_test.exs` (files, plan, write, retry on 412, no double add, logs), `todos/template_test.exs` (Methods fields, 37 straight paths, matches the SVG), and a settings LiveView test. ## Screenshots (head 1ca35aa, Chromium; no horizontal scroll at 390 or 1280) Settings > reMarkable, 390px, before adding: ![390 before](https://git.knope.dev/attachments/31d30233-a2df-4a5f-ba9e-41c4e1476a73) 390px, once the template is in the library: ![390 added](https://git.knope.dev/attachments/8a0b050a-70f8-4289-bd2a-8c4a98d22e92) Desktop, before adding: ![desktop before](https://git.knope.dev/attachments/18fff3d6-f2a5-4712-974f-0b2f813ed3f0) Desktop, added: ![desktop added](https://git.knope.dev/attachments/dce0dfeb-156a-48ed-9ab6-85c84ad602ff) **Fixed (f2589fb), Nye F3:** the rM2 reads a Methods canvas turned 90° from the Paper Pro's, so the template is now two items named "Todo small lines": the Paper Pro's (`supportedScreens` ["rmPP"], same id) and the rM2's (["rm2"], new id `6c73ab67-…`, every point `(x, y)` → `(y, 1404 - x)`, `sx`/`sy` kept). `NewTemplate` now writes a list in one commit and skips items already there, so only a missing one is written. `Todos.Template.ids/0` replaces `id/0`; `added?` needs both. Docs updated. `mix precommit`: 1122 tests, 0 failures. The settings UI didn't change, so the screenshots still hold. **Fixed (5fb9d1c), D29/D34:** Jeremy's rM2 drew the turned item sideways, so it's one upright item for rm2 + rmPP under a new id; Add to tablet removes our earlier items in the same commit. **57c5e80, D31: printed boxes.** Every one of the 36 rules gets a 30 px box at x 76–106, from 40 px to 10 px above its rule (row 0: y 10.5–40.5). `Todos.Template.box/1` (row 0–35 → `{left, top, width, height}`, the `Lines.Marks` rect) and `boxes/0` are the one source: the `.template` draws each as a closed `M`/`L`/`Z` path, `Templates.svg/1` (version 5) and the picker thumbnail draw the same rects. New id `d7fac201-…`; the upright item without boxes (`1548ae34-…`) joins `stale_ids/0`. Settings card text and icon now show the boxes. `docs/todo-template.md` updated (no more "no boxes printed"). Tests for `box/1`, the 36 drawn boxes matching it, the SVG and the thumbnail. `mix precommit` green. The template at 2x (app drawing at fe0c01a, D36 layout, top left: title rule, margin at x 220.5, boxes at x 160–190 clear of the toolbar): ![template at 2x, D36](https://git.knope.dev/attachments/f2008836-67ad-4087-ae0f-539959873029) Settings card at head 57c5e80, 390px and desktop (Chromium, no horizontal scroll): ![390 card](https://git.knope.dev/attachments/ebe709ea-6788-4bd0-9031-6ef2aee86acf) ![desktop card](https://git.knope.dev/attachments/a3d2afd9-54eb-46b3-8760-19e9432c5eb9) **D36 (fe0c01a), Jeremy's rM2 re-check of 57c5e80:** upright, but the boxes sat under the tablet's toolbar and he wants room for the list's title first. Now: one title rule at y 154.5 from the margin to 1403; 31 task rules from 258.5 every 52 px (last 1818.5); margin at x 220.5; boxes at x 160-190 (30 px, 40/10 above the rule), `box/1` rows 0-30. `Templates.rules/1` also returns `title_y` and `margin_x`. New id `d3850d5e-…`; 57c5e80's `d7fac201-…` joins `stale_ids`, so Add to tablet removes it. The typed-page layout now starts right of the margin, on the first task rule. Svg version 6; the settings card's icon and text show the title line. Also Nye's two wording notes (`M`/`L`/`Z` in the doc, duplicate moduledoc sentence). `mix precommit`: 1126 tests, 0 failures. Settings card at fe0c01a, 390px and desktop (no horizontal scroll at either): ![390 title](https://git.knope.dev/attachments/472c33b3-fd98-4b8d-ae0f-39741459daeb) ![desktop title](https://git.knope.dev/attachments/400d8b84-48fe-4b08-b9e7-5b53fe2cbadb) The page as the app draws it (`Templates.svg/1`), the same drawing as the `.template`: ![template](https://git.knope.dev/attachments/fc4ffdd3-9a21-4002-bacb-bf84fc24ed37)
Remarkable.NewTemplate writes a TemplateType item (.metadata, {} .content,
.template JSON) in one commit after a sync, like NewPdf. Todos.Template
builds the .template from Templates.segments/1, the same drawing the page
view uses: P Lines small's rules and a left margin. Settings > reMarkable
gets an Add to tablet card. docs/todo-template.md has the tablet check.
Jeremy's rM2 drew the 90°-turned rM2 item sideways (left edge ~75% down,
1404/1872), so the template is now one item for rm2 and rmPP, upright,
under a new id (the tablet caches thumbnails by id). Add to tablet takes
our earlier items 90a78e7e and 6c73ab67 out of the root in the same
commit (Commit.plan/3 remove:), logged, so the picker shows one.
feat(todos): title band and toolbar-clear boxes on the Todo template (D36), new id (refs #51)
All checks were successful
CI / test (pull_request) Successful in 1m48s
fe0c01ae44
Title rule at y 154.5 from the margin; 31 task rules from 258.5 every 52;
margin at x 220.5; boxes at x 160-190. Templates.rules/1 also gives
title_y and margin_x. d7fac201 joins stale_ids. Typed-page layout starts
right of the margin. Svg v6, settings icon, docs/todo-template.md.
jfro changed title from WIP: Todo small lines template as a Methods item (refs #51) to Todo small lines template as a Methods item (refs #51) 2026-11-08 23:39:30 +00:00
Author
Owner

Jeremy said ship it. Merged into main with a signed merge commit, 1dbc293 (no squash); local mix precommit on the merge passed (1126 tests). The CI runner hasn't started a job since run 144 (Nov 1), so no CI result here. Forgejo shows this PR closed rather than merged because manual-merge marking is off on this repo.

Jeremy said ship it. Merged into main with a signed merge commit, 1dbc293 (no squash); local mix precommit on the merge passed (1126 tests). The CI runner hasn't started a job since run 144 (Nov 1), so no CI result here. Forgejo shows this PR closed rather than merged because manual-merge marking is off on this repo.
jfro closed this pull request 2026-11-08 23:39:38 +00:00
jfro reopened this pull request 2026-11-09 00:23:54 +00:00
jfro manually merged commit 1dbc2936c1 into main 2026-11-09 00:23:57 +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!71
No description provided.