Todo sync write loop (two-way: app changes onto the page) #73
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/51-write-loop"
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 #51 (D45: the last PR of the todo sync closes it; #70 says Refs #51).
Stacked on #72 (feature/51-append-layer,
dfb611a); #70 (groundwork) and #71 are now on main, merged in ate9cf2c6. Parents are merged in again when they move, never rebased.In this PR so far
VIKUNJA_URL/VIKUNJA_TOKENare unset. Each env var, when set, wins and is shown read-only, and is never saved over.VIKUNJA_TOKENwithoutVIKUNJA_URLis refused at boot, so the server's token only goes to the server's URL. A URL entered here is checked like a spellcheck one (public, or inBACKUP_S3_ALLOWED_NETWORKS) and called at the checked address. The token is stored encrypted and never shown. No defaults. Test connection lists the token's projects and is logged with status and duration.5417ccf): a URL moved to another host with the token left blank isn't saved ("enter the token for the new server"); withVIKUNJA_URLset, the token field says the URL it's sent to;VIKUNJA_URLwithout a host is refused at boot; each sync and poll sets/clears the settings' last error, so a bad token or a down server shows on the settings page.a2e4e66+0a3324d), so the tablet test needs no iex or copied ids: the viewer's page bar has Sync todos (pick a Vikunja project, or "New project…" by name, then Map page; once mapped it says "Todos synced with " with Sync details and Unmap; when sync isn't set up it says so and links Settings > Todo sync). /todos/pages/:id is the page's sync panel: waiting for its transcription / edits not read yet / ready, the last read of the page, check of the app and write onto it with times and counts (a skip says why), the last error, and each task with its app state, pending write, task link and whether our strokes for it are still on the page (Marks.present). Sync this page now queues its poll. Back up cloud in Settings > Todo sync runs the same snapshot asmix remarkable.snapshot, with a toast. New:Provider.create_project/2(optional; VikunjaPOST /projects, logged),Todos.list_projects/2,create_project/3,unmap_page/2,sync_page_now/2,record_page/4,marks_present/3,Remarkable.Snapshot.backup/1, migration for the page's run status.Still to do
a6d59ef(D23, D55). Merge after #72.mix precommitpasses at0a3324d(1331 tests).Screenshots (
59d1d49, against a local Vikunja 2.8 with example projects)Screenshots (
5417ccf, N27/N28)N27, the URL moved to another host with the token blank (390px, desktop):

N28,

VIKUNJA_URLset by the server and the user's own token (390px, desktop):Screenshots (
0a3324d, test UI, local Vikunja 2.8, example notebook)The example page is a test fixture, not the todo template, so our line sits over its text; the 1-of-1 / 26-of-26 counts are our tick's and line's strokes found on the page.
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.outside/3 counts only strokes above the page; a tick in a printed box is in the margin, not outside (F7). A stroke whose centre is in the top third of a band, just under rule k, while row k has writing, joins row k: a separate g/y tail or an underline, not a phantom task in row k+1 (F8). The tick glyph strip takes an optional U+FE0F after the glyph and knows ✅, ✗, ✘ (F9).A stroke centred above row 0's band (y < rule_y - line_height, per repeat) is the title: no task, not outside. title/3 gives his strokes in the first page's band; texts/3 drops OCR's first line when there are any and returns it as the title ({:ok, pairs, title | nil}). A repeat's band writing has no line dropped, so it holds the page.Lines.Writer.erase_layer/3 turns our line items into the tablet's own deleted items, in place (deleted length 1, no value), only in our layer. PageInk takes an :erase list and does it in the same write as any adds, and writes nothing when the page wouldn't change. PageMarks plans {:untick, ids} as an erase (skipped with no ids of ours, D37), and TodoItem.drop_ids/2 drops the erased ids from the task.dfb611a, F11) into feature/51-write-loop61fd964, doc F11/N20/F12) into feature/51-write-loopWIP: Todo sync write loop (two-way: app changes onto the page)to Todo sync write loop (two-way: app changes onto the page)