Page viewer draws the Todo small lines template #76
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/75-todo-template-viewer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #75. Refs #51.
A page on our Todo small lines template showed only its strokes in the page viewer. The viewer looks a page's drawing up by its
template.value; built-in templates store their name there, but our template is a Methods-styleTemplateTypecloud item (Todos.Template,Remarkable.NewTemplate), and a page on it points at the item by id, so the name lookup missed.Change
Templates.drawing/1: a page's template value to the drawing's name: a name we draw, or our todo item's id (current or any earlier, stale one, also inside a path like<id>.template, any case) ->"Todo small lines".drawn?/1,svg/1,rules/1and the viewer's template URL go through it, so the viewer fetches the sharedTodo%20small%20lines.svgand draws it behind the strokes like a built-in template.OCR.PageImagestill renders strokes on white, without the template.docs/todo-template.mdstep 4 updated.Tests
test/rm_analyzer_web/components/remarkable_components_test.exs(new):page_previewdraws the todo template for a page on its item id (and stale ids), still draws built-ins by name, leaves out unknown templates.templates_test.exs:drawing/1by name and id;svg/1/rules/1match for id and name.97e46e8) and pass here.mix precommit: 1340 passed.Screenshots (head
dbfd26d, realistic todo page)The example page holds only what a real todo page has: the template, the tablet's handwriting on the first rows (a title, two tasks, the first ticked by hand in its printed box), then three tasks write-back drew from the app on the next free rows. No typed text (the earlier example reused a fixture with an unrelated typed block, which overlapped the rules).
Desktop:
390px:
Page close-up (desktop, 2x):
Alignment (measured, no change needed)
-702 0 1404 1872(390px: 358x477 css px; desktop: 604x805).Templates.segments/1gives the 31 rules at 258.5 + 52k, the same asTodos.Template.layout/0; measured off the screenshots, pitch 52.1-52.2 page px.Report.rule_lift, PR #65), fineliner 3 px wide, so the ink ends 3.5 page px above the rule. That's about 3 css px on desktop; at 390px the page is drawn at 0.25 css px per page px, so the gap is under 1 css px and anti-aliasing closes it. Letters with descenders (p in "plants") go below the rule, as handwriting does.Open question
I couldn't read a real page from Jeremy's tablet, so the id form is inferred from how Methods templates sync. If the page stores something else (neither the name nor an id), the viewer will still miss it; the value from the page's
.contentwould settle it.