feat(remarks): show unconfirmed remark ink as a translucent overlay where it was written #30

Merged
daniel merged 6 commits from agent/remark-ink-overlay into main 2026-10-20 20:00:33 +02:00
Collaborator

Closes #29

Goal

Issue #29 asks to show unconfirmed handwritten remarks in Obsidian roughly where the ink sits on the reMarkable page, as a half-transparent overlay. Today a remark only shows up as a callout (> [!note] Remark + ![[…png]] + ^ink-<id>) placed after the whole block it was written against (see src/__tests__/remarkplacement.test.ts). The note gives no sense of where on the page the ink actually was.

What already exists (no new data needed)

  • Position is already recorded. For every remark image, renderHandwriting (src/main.ts:~2178-2186) writes an InkStrokes record via this.state.writeInk(<image file name>, ink). Read it back with this.state.readInk(file.name) (src/sync/syncstate.ts:211; stored at reMarkable/.sync/ink/<image>.json). InkStrokes (src/ink/inkimage.ts:54-83) has:
    • sourceWidth / sourceHeight: the ink's natural size in px at 96 dpi (pt ÷ 0.75), i.e. ink width in pt = sourceWidth * 0.75.
    • at?: RemarkPlace { text, x, below }. text is the printed row the ink sits against. x is the ink's left edge in pt from the page's left. below is the ink's top in pt under that row's baseline (negative means above it). It is computed in groupNotes, src/incoming/marks.ts:574 (PDF y-up, so below = row.y - ink.maxY). at is absent for added pages and for remarks read before positions were kept, so those get no overlay.
  • The send path already uses at to draw ink back in place: overlayPlacements in src/ink/inkrender.ts:181-210. Mirror its interpretation of x/below.
  • Page geometry: the mapping entry's pdfLayout (src/id/mapping.ts:52: margin, pageWidth, fontSize, lineHeight) for the note's notePath. Fall back to the convert/pdf.ts defaults (margin: 40, PAGE_WIDTH) when there is no entry.
  • The remark image PNG is cropped to the ink plus 40 device units of padding on each side (planRender, src/incoming/strokerender.ts, padding ?? 40). Account for that padding when sizing/offsetting the <img> so the strokes, not the padded box, land at x/below. Alternatively use object-fit/a negative margin equal to the padding scaled.
  • Remark lookup and confirmed state: findRemark / remarkAt (src/incoming/remarkid.ts). confirmed is true when the title ends in ✓. A rendered callout is matched to its remark in RemarkControls.idOf (src/remarkui.ts).
  • Finding the anchor row in the note: anchorAbove/wordsOf in src/incoming/remarkinsert.ts:122-140 match a printed row to a source line by its first ≤4 words, with markdown and punctuation stripped. Export and reuse this (or factor it out) instead of writing a new matcher. Search above the callout's start line, as insertRemarkText does.

What to build

  1. Pure placement module (new, e.g. src/incoming/remarkoverlay.ts, unit-tested, no DOM).
    • Input: InkStrokes (needs at), page { pageWidth, margin }, the rendered text column width in px, and the line-height ratio.
    • Output: { leftPx, topPx (relative to the anchor row's baseline), widthPx, heightPx }.
    • Horizontal mapping: the tablet text column (pageWidth - 2*margin pt) maps onto the Obsidian column width, so s = columnPx / (pageWidth - 2*margin), left = (x - margin) * s, and width = sourceWidth*0.75*s. Margin-written ink gives negative left or left + width > columnPx. Clamp it so it stays inside the view (it may overhang into the editor's side padding, but must not be clipped away entirely).
    • Vertical: top = below * s. Using the same scale is fine; "approximately" is the explicit requirement.
    • Return null when at is missing.
  2. Reading view: extend RemarkControls (src/remarkui.ts) or add a sibling post-processor registered next to it (src/main.ts:~312).
    • For each unconfirmed remark callout that has an image with an InkStrokes.at, find the rendered element holding the anchor row's text (DOM text search for the row's first words via Range/getClientRects).
    • Append an absolutely positioned <img class="remarkable-ink-remark-overlay"> (the same vault image via app.vault.getResourcePath) positioned from that row's line box.
    • Reading view renders sections separately, so the overlay can be attached to the anchor's section element (position: relative) on whichever section contains the anchor text.
  3. Live preview / source mode: a CM6 ViewPlugin registered with this.registerEditorExtension(...). @codemirror/view and @codemirror/state are already esbuild externals and present in package-lock.json; the repo does not import them yet.
    • Resolve the anchor source line (same matcher, on the editor doc), get view.coordsAtPos / lineBlockAt for it, and draw the overlays in a layer() (or absolutely positioned widgets) on view.scrollDOM.
    • Recompute on doc/viewport/geometry changes.
    • Read InkStrokes asynchronously and cache by image name; invalidate when the note's remark set changes.
  4. Look: styles.css, following the existing .remarkable-ink-* naming.
    • opacity: 0.5, pointer-events: none so the text underneath stays selectable/editable. Optionally mix-blend-mode: multiply so the white PNG background does not hide text; in dark theme use filter: invert(1) with mix-blend-mode: screen or similar.
    • Hovering the callout may raise the opacity of its overlay; nice-to-have, not required.
    • Must pass npm run lint:css (stylelint obsidianmd config).
  5. Setting: inkRemarkOverlay: boolean, default true, in src/settingsmodel.ts + src/settingschema.ts. Put it in the same "Handwriting" group as inkRemarks (settingschema.ts:~346). Suggested name: "Show unconfirmed remarks on the text", with a description explaining it is translucent and goes away once confirmed. When off, register nothing / render nothing.
  6. README: one short bullet under "Correcting what was read" describing the overlay and that it disappears on ✓ Confirm / Insert as text.

Constraints and decisions

  • Only unconfirmed remarks get an overlay. A confirmed (✓) or inserted remark has no overlay. That is the point of the feature: it shows what still needs review.
  • The callout stays exactly as it is. Do not change note content, the callout format, projectOntoSource placement, or ^ink- ids. The overlay is purely a rendering layer and must never write to the note.
  • No re-render of strokes in Obsidian. Reuse the existing PNG. Drawing from InkStrokes.strokes on a canvas was considered and ruled out as unnecessary for "approximately".
  • Remarks without at (old remarks, added pages), or whose anchor row can't be found in the current note text: no overlay, silently.
  • Do not regenerate src/__tests__/fixtures/layout-inset0.json (golden layout; imported marks are anchored to it).
  • Must not throw inside post-processors or the view plugin for notes that are not synced notes. Bail out early when the note has no ^ink- lines.

Scope boundary

Not included: changing where the callout goes, editing ink, a click-through from the overlay to the callout (nice follow-up), and overlays for added whole pages.

Validation contract

The repo has no flake.nix, so run Node directly:

  • npm ci && npx vitest run src/__tests__/remarkoverlay.test.ts → PASS. This is a new test file for the pure placement module and must cover these cases:
    1. ink in the text column at x = margin, below = 2 → left ≈ 0, top ≈ 2*s;
    2. right-margin ink → clamped to stay visible;
    3. at missing → null;
    4. padding accounted for (strokes' left edge, not the PNG's, lands at x).
  • Red gate: before the module exists, the test file fails to import (red). It must turn green with the implementation.
  • npm test → all existing tests still pass.
  • npm run build → exit 0, and npm run lint → exit 0 (ESLint obsidianmd and stylelint, --max-warnings 0).
  • Manual check, described in the MR: a note with one unconfirmed remark in the margin beside a paragraph shows its ink faded at roughly that line, on the right, in both reading view and live preview. After ✓ Confirm the overlay is gone. Turning the setting off removes all overlays.

🤖 Generated with Claude Code

Closes #29 ## Goal Issue #29 asks to show **unconfirmed** handwritten remarks in Obsidian roughly where the ink sits on the reMarkable page, as a half-transparent overlay. Today a remark only shows up as a callout (`> [!note] Remark` + `![[…png]]` + `^ink-<id>`) placed **after the whole block** it was written against (see `src/__tests__/remarkplacement.test.ts`). The note gives no sense of where on the page the ink actually was. ## What already exists (no new data needed) - **Position is already recorded.** For every remark image, `renderHandwriting` (`src/main.ts:~2178-2186`) writes an `InkStrokes` record via `this.state.writeInk(<image file name>, ink)`. Read it back with `this.state.readInk(file.name)` (`src/sync/syncstate.ts:211`; stored at `reMarkable/.sync/ink/<image>.json`). `InkStrokes` (`src/ink/inkimage.ts:54-83`) has: - `sourceWidth` / `sourceHeight`: the ink's natural size in px at 96 dpi (pt ÷ 0.75), i.e. ink width in pt = `sourceWidth * 0.75`. - `at?: RemarkPlace { text, x, below }`. `text` is the printed row the ink sits against. `x` is the ink's left edge in **pt from the page's left**. `below` is the ink's top in pt **under that row's baseline** (negative means above it). It is computed in `groupNotes`, `src/incoming/marks.ts:574` (PDF y-up, so `below = row.y - ink.maxY`). `at` is absent for added pages and for remarks read before positions were kept, so those get **no overlay**. - The send path already uses `at` to draw ink back in place: `overlayPlacements` in `src/ink/inkrender.ts:181-210`. Mirror its interpretation of `x`/`below`. - Page geometry: the mapping entry's `pdfLayout` (`src/id/mapping.ts:52`: `margin`, `pageWidth`, `fontSize`, `lineHeight`) for the note's `notePath`. Fall back to the `convert/pdf.ts` defaults (`margin: 40`, `PAGE_WIDTH`) when there is no entry. - The remark image PNG is cropped to the ink **plus 40 device units of padding** on each side (`planRender`, `src/incoming/strokerender.ts`, `padding ?? 40`). Account for that padding when sizing/offsetting the `<img>` so the strokes, not the padded box, land at `x`/`below`. Alternatively use `object-fit`/a negative margin equal to the padding scaled. - Remark lookup and confirmed state: `findRemark` / `remarkAt` (`src/incoming/remarkid.ts`). `confirmed` is true when the title ends in ✓. A rendered callout is matched to its remark in `RemarkControls.idOf` (`src/remarkui.ts`). - Finding the anchor row in the note: `anchorAbove`/`wordsOf` in `src/incoming/remarkinsert.ts:122-140` match a printed row to a source line by its first ≤4 words, with markdown and punctuation stripped. Export and reuse this (or factor it out) instead of writing a new matcher. Search **above** the callout's start line, as `insertRemarkText` does. ## What to build 1. **Pure placement module** (new, e.g. `src/incoming/remarkoverlay.ts`, unit-tested, no DOM). - Input: `InkStrokes` (needs `at`), page `{ pageWidth, margin }`, the rendered text column width in px, and the line-height ratio. - Output: `{ leftPx, topPx (relative to the anchor row's baseline), widthPx, heightPx }`. - Horizontal mapping: the tablet text column (`pageWidth - 2*margin` pt) maps onto the Obsidian column width, so `s = columnPx / (pageWidth - 2*margin)`, `left = (x - margin) * s`, and `width = sourceWidth*0.75*s`. Margin-written ink gives negative `left` or `left + width > columnPx`. Clamp it so it stays inside the view (it may overhang into the editor's side padding, but must not be clipped away entirely). - Vertical: `top = below * s`. Using the same scale is fine; "approximately" is the explicit requirement. - Return `null` when `at` is missing. 2. **Reading view**: extend `RemarkControls` (`src/remarkui.ts`) or add a sibling post-processor registered next to it (`src/main.ts:~312`). - For each **unconfirmed** remark callout that has an image with an `InkStrokes.at`, find the rendered element holding the anchor row's text (DOM text search for the row's first words via `Range`/`getClientRects`). - Append an absolutely positioned `<img class="remarkable-ink-remark-overlay">` (the same vault image via `app.vault.getResourcePath`) positioned from that row's line box. - Reading view renders sections separately, so the overlay can be attached to the anchor's section element (`position: relative`) on whichever section contains the anchor text. 3. **Live preview / source mode**: a CM6 `ViewPlugin` registered with `this.registerEditorExtension(...)`. `@codemirror/view` and `@codemirror/state` are already esbuild externals and present in `package-lock.json`; the repo does not import them yet. - Resolve the anchor source line (same matcher, on the editor doc), get `view.coordsAtPos` / `lineBlockAt` for it, and draw the overlays in a `layer()` (or absolutely positioned widgets) on `view.scrollDOM`. - Recompute on doc/viewport/geometry changes. - Read `InkStrokes` asynchronously and cache by image name; invalidate when the note's remark set changes. 4. **Look**: `styles.css`, following the existing `.remarkable-ink-*` naming. - `opacity: 0.5`, `pointer-events: none` so the text underneath stays selectable/editable. Optionally `mix-blend-mode: multiply` so the white PNG background does not hide text; in dark theme use `filter: invert(1)` with `mix-blend-mode: screen` or similar. - Hovering the callout may raise the opacity of its overlay; nice-to-have, not required. - Must pass `npm run lint:css` (stylelint obsidianmd config). 5. **Setting**: `inkRemarkOverlay: boolean`, default **true**, in `src/settingsmodel.ts` + `src/settingschema.ts`. Put it in the same "Handwriting" group as `inkRemarks` (`settingschema.ts:~346`). Suggested name: "Show unconfirmed remarks on the text", with a description explaining it is translucent and goes away once confirmed. When off, register nothing / render nothing. 6. **README**: one short bullet under "Correcting what was read" describing the overlay and that it disappears on ✓ Confirm / Insert as text. ## Constraints and decisions - **Only unconfirmed remarks** get an overlay. A confirmed (✓) or inserted remark has no overlay. That is the point of the feature: it shows what still needs review. - **The callout stays exactly as it is.** Do not change note content, the callout format, `projectOntoSource` placement, or `^ink-` ids. The overlay is purely a rendering layer and must never write to the note. - **No re-render of strokes in Obsidian.** Reuse the existing PNG. Drawing from `InkStrokes.strokes` on a canvas was considered and ruled out as unnecessary for "approximately". - Remarks without `at` (old remarks, added pages), or whose anchor row can't be found in the current note text: no overlay, silently. - Do not regenerate `src/__tests__/fixtures/layout-inset0.json` (golden layout; imported marks are anchored to it). - Must not throw inside post-processors or the view plugin for notes that are not synced notes. Bail out early when the note has no `^ink-` lines. ## Scope boundary Not included: changing where the callout goes, editing ink, a click-through from the overlay to the callout (nice follow-up), and overlays for added whole pages. ## Validation contract The repo has no `flake.nix`, so run Node directly: - `npm ci && npx vitest run src/__tests__/remarkoverlay.test.ts` → PASS. This is a new test file for the pure placement module and must cover these cases: 1. ink in the text column at `x = margin`, `below = 2` → `left ≈ 0`, `top ≈ 2*s`; 2. right-margin ink → clamped to stay visible; 3. `at` missing → `null`; 4. padding accounted for (strokes' left edge, not the PNG's, lands at `x`). - Red gate: before the module exists, the test file fails to import (red). It must turn green with the implementation. - `npm test` → all existing tests still pass. - `npm run build` → exit 0, and `npm run lint` → exit 0 (ESLint obsidianmd and stylelint, `--max-warnings 0`). - Manual check, described in the MR: a note with one unconfirmed remark in the margin beside a paragraph shows its ink faded at roughly that line, on the right, in both reading view and live preview. After ✓ Confirm the overlay is gone. Turning the setting off removes all overlays. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude self-assigned this 2026-10-20 19:08:12 +02:00
Author
Collaborator

🤖 Agent is working on this — turn 17

Last activity: assistant message — updated 17:58:40 UTC

Last message:

I've merged the latest main into the branch, so the merge conflicts on MR !30 are gone, but the MR still isn't merged because Forgejo refused it again. It returned the same "HTTP 405 merge not completed" as before.

  • Conflict: only CHANGELOG-INK.md conflicted, between the overlay entry and the new one-click Ollama setup entry. I kept both under Unreleased. src/main.ts and README.md merged without conflicts.
  • Checks after the merge: build and lint both pass, and all 762 tests pass. No CI pipeline has run for the new commit.
  • Pushed: the merge is commit 2c10986 on agent/remark-ink-overlay.

To finish it, approve the MR in Forgejo or merge it by hand; no code changes are pending. I've said this in a short update on the MR and marked the run as blocked.

🤖 **Agent is working on this** — turn 17 _Last activity: assistant message — updated 17:58:40 UTC_ **Last message:** > I've merged the latest `main` into the branch, so the merge conflicts on MR !30 are gone, but the MR still isn't merged because Forgejo refused it again. It returned the same "HTTP 405 merge not completed" as before. > > - **Conflict:** only `CHANGELOG-INK.md` conflicted, between the overlay entry and the new one-click Ollama setup entry. I kept both under Unreleased. `src/main.ts` and `README.md` merged without conflicts. > - **Checks after the merge:** build and lint both pass, and all 762 tests pass. No CI pipeline has run for the new commit. > - **Pushed:** the merge is commit 2c10986 on `agent/remark-ink-overlay`. > > To finish it, approve the MR in Forgejo or merge it by hand; no code changes are pending. I've said this in a short update on the MR and marked the run as blocked.
Author
Collaborator

What changed

  • Placement module src/incoming/remarkoverlay.ts (pure, unit-tested). It maps the tablet's text column onto the note's column. The strokes, not the padded PNG, land at x/below. Margin ink is clamped into view, and remarks without at get null. The row matcher (wordSpans/runsOf/anchorAbove) is now exported from remarkinsert.ts and shared, with no behaviour change.
  • Overlays src/remarkoverlayui.ts. Reading view: a post-processor attaches the overlay <img> to the section holding the anchor row, measured with a DOM Range. It is redrawn on resize and on note changes, so a ✓ elsewhere in the note removes it. Live preview and source mode: a CM6 ViewPlugin + layer(). Only unconfirmed remarks with an image get an overlay. The note itself is never written.
  • Look, setting and docs. Styles: 50% opacity, pointer-events: none, multiply blend (inverted + screen in dark theme). The setting inkRemarkOverlay (default on, "Show unconfirmed remarks on the text", under Handwriting) adds or removes the editor extension live. README bullet and CHANGELOG-INK entry added.
  • Side changes:
    • @codemirror/state and @codemirror/view were added as devDependencies at the versions already in the lock. Without that, import/no-extraneous-dependencies warns.
    • css-mixblendmode was added to stylelint's ignore list, with the reason in the config: Safari only lacks the non-separable blend modes, and this uses multiply/screen.

Verify

  • npx vitest run src/__tests__/remarkoverlay.test.ts covers the four required cases. It failed to import before the module existed and passes now.
  • New remarkoverlayui.test.ts (happy-dom, layout stubbed) checks: an overlay appears for an unconfirmed margin remark, and it disappears on ✓ and when the setting is turned off.
  • npm test 714/714, npm run build and npm run lint all exit 0. There is no branch CI on this repo.
  • Not checked in Obsidian. The manual check in a real vault hasn't been done: reading view + live preview, ✓ removes the overlay, setting off removes them all. The CM layer has no automated test.

Follow-ups

  • None filed. Possible later: clicking the overlay to jump to its callout (out of scope here).
## What changed - **Placement module** `src/incoming/remarkoverlay.ts` (pure, unit-tested). It maps the tablet's text column onto the note's column. The strokes, not the padded PNG, land at `x`/`below`. Margin ink is clamped into view, and remarks without `at` get `null`. The row matcher (`wordSpans`/`runsOf`/`anchorAbove`) is now exported from `remarkinsert.ts` and shared, with no behaviour change. - **Overlays** `src/remarkoverlayui.ts`. Reading view: a post-processor attaches the overlay `<img>` to the section holding the anchor row, measured with a DOM `Range`. It is redrawn on resize and on note changes, so a ✓ elsewhere in the note removes it. Live preview and source mode: a CM6 `ViewPlugin` + `layer()`. Only unconfirmed remarks with an image get an overlay. The note itself is never written. - **Look, setting and docs.** Styles: 50% opacity, `pointer-events: none`, multiply blend (inverted + screen in dark theme). The setting `inkRemarkOverlay` (default on, "Show unconfirmed remarks on the text", under Handwriting) adds or removes the editor extension live. README bullet and CHANGELOG-INK entry added. - Side changes: - `@codemirror/state` and `@codemirror/view` were added as devDependencies at the versions already in the lock. Without that, `import/no-extraneous-dependencies` warns. - `css-mixblendmode` was added to stylelint's ignore list, with the reason in the config: Safari only lacks the non-separable blend modes, and this uses multiply/screen. ## Verify - `npx vitest run src/__tests__/remarkoverlay.test.ts` covers the four required cases. It failed to import before the module existed and passes now. - New `remarkoverlayui.test.ts` (happy-dom, layout stubbed) checks: an overlay appears for an unconfirmed margin remark, and it disappears on ✓ and when the setting is turned off. - `npm test` 714/714, `npm run build` and `npm run lint` all exit 0. There is no branch CI on this repo. - **Not checked in Obsidian.** The manual check in a real vault hasn't been done: reading view + live preview, ✓ removes the overlay, setting off removes them all. The CM layer has no automated test. ## Follow-ups - None filed. Possible later: clicking the overlay to jump to its callout (out of scope here).
Author
Collaborator

✅ Agent run completed

2m41s · 12 turns · $0.37

✅ **Agent run completed** _2m41s · 12 turns · $0.37_
Keep both Unreleased changelog entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Collaborator

Since my last update: merged main into the branch (6224350) to clear the conflict. The only conflict was the Unreleased list in CHANGELOG-INK.md, where I kept both entries. After the merge, npm test passes (733/733), and npm run build and npm run lint both exit 0.

Since my last update: merged `main` into the branch (6224350) to clear the conflict. The only conflict was the Unreleased list in `CHANGELOG-INK.md`, where I kept both entries. After the merge, `npm test` passes (733/733), and `npm run build` and `npm run lint` both exit 0.
Author
Collaborator

Acceptance-intent assessment

Issue #29 asks for unconfirmed ink to be shown as a half-transparent overlay, roughly where it sat on the reMarkable page. The diff does this as a rendering-only layer. It places each unconfirmed remark's existing PNG over the note using the recorded InkStrokes.at row/x/below, mapped onto the note's text column. It works in both reading view and the editor. Confirming the remark or inserting it as text removes the overlay, and a setting (on by default) turns the feature off. Every item in the MR's hand-off spec is covered by the diff.

Criteria

  • Show unconfirmed ink as an overlay (issue core): PASS. pendingRemarks skips remarks with ✓ and remarks without an image. The overlay is the vault PNG via getResourcePath, with no re-render of strokes.
  • Roughly where it was on the reMarkable page: PASS. overlayBox uses s = columnPx/(pageWidth-2·margin), left=(x-margin)·s, top=below·s (optionally scaled by line pitch). The anchor row is found above the callout with the shared anchorAbove/wordSpans/runsOf matcher, which is exported from remarkinsert.ts with matching behaviour unchanged.
  • Half-transparent: PASS. styles.css sets opacity: 0.5 and pointer-events: none, uses multiply, and in dark theme uses invert(1) with screen.
  • Pure placement module plus the four required test cases: PASS. src/incoming/remarkoverlay.ts is tested in remarkoverlay.test.ts: column edge at below=2, right-margin ink clamped into view (left margin too), missing at returns null, and the 40-unit padding offset so the strokes land at x. Commit ee86738 adds the module and its test together. 20/20 pass locally.
  • Reading view: PASS. A post-processor (OverlaySection) attaches the <img class="remarkable-ink-remark-overlay"> to the section holding the anchor row. The row is measured with Range.getClientRects, and the overlay is redrawn on resize and on vault modify, so a ✓ removes it. The happy-dom test covers it appearing, going away on ✓, and going away when the setting is off.
  • Live preview / source mode: PASS. A CM6 ViewPlugin plus layer() is registered via registerEditorExtension. It uses coordsAtPos on the anchor line and recomputes on doc, viewport and geometry changes. InkStrokes are read asynchronously and cached by image path and mtime.
  • Setting inkRemarkOverlay (default true, in Handwriting next to inkRemarks, suggested name and description): PASS. When off, sync() empties the editor extension and the post-processor returns early. Both saveSettings and onExternalSettingsChange call it.
  • README bullet under "Correcting what was read": PASS. It also adds a CHANGELOG-INK entry.
  • Constraints (note never written, callout/placement/^ink- unchanged, no overlay without at or anchor, early bail without ^ink-, golden fixture untouched): PASS. No write path was added, and src/__tests__/fixtures/ is not in the diff.
  • Validation commands: PASS, re-run locally. npm ci passes, npm test passes 714/714, and npm run build and npm run lint (eslint plus stylelint --max-warnings 0) both exit 0.
  • Manual Obsidian check: not done. The MR says plainly that it was not run in a real vault, and there is no automated test for the CM layer. This is human verification of delivered behaviour, not a missing requirement, but a maintainer should do it before merge: reading view and live preview, ✓ removes the overlay, setting off removes all overlays.

Verdict

Approved

## Acceptance-intent assessment Issue #29 asks for unconfirmed ink to be shown as a half-transparent overlay, roughly where it sat on the reMarkable page. The diff does this as a rendering-only layer. It places each unconfirmed remark's existing PNG over the note using the recorded `InkStrokes.at` row/x/below, mapped onto the note's text column. It works in both reading view and the editor. Confirming the remark or inserting it as text removes the overlay, and a setting (on by default) turns the feature off. Every item in the MR's hand-off spec is covered by the diff. ## Criteria - **Show unconfirmed ink as an overlay (issue core)**: PASS. `pendingRemarks` skips remarks with ✓ and remarks without an image. The overlay is the vault PNG via `getResourcePath`, with no re-render of strokes. - **Roughly where it was on the reMarkable page**: PASS. `overlayBox` uses `s = columnPx/(pageWidth-2·margin)`, `left=(x-margin)·s`, `top=below·s` (optionally scaled by line pitch). The anchor row is found above the callout with the shared `anchorAbove`/`wordSpans`/`runsOf` matcher, which is exported from `remarkinsert.ts` with matching behaviour unchanged. - **Half-transparent**: PASS. `styles.css` sets `opacity: 0.5` and `pointer-events: none`, uses `multiply`, and in dark theme uses `invert(1)` with `screen`. - **Pure placement module plus the four required test cases**: PASS. `src/incoming/remarkoverlay.ts` is tested in `remarkoverlay.test.ts`: column edge at `below=2`, right-margin ink clamped into view (left margin too), missing `at` returns `null`, and the 40-unit padding offset so the strokes land at `x`. Commit ee86738 adds the module and its test together. 20/20 pass locally. - **Reading view**: PASS. A post-processor (`OverlaySection`) attaches the `<img class="remarkable-ink-remark-overlay">` to the section holding the anchor row. The row is measured with `Range.getClientRects`, and the overlay is redrawn on resize and on vault `modify`, so a ✓ removes it. The happy-dom test covers it appearing, going away on ✓, and going away when the setting is off. - **Live preview / source mode**: PASS. A CM6 `ViewPlugin` plus `layer()` is registered via `registerEditorExtension`. It uses `coordsAtPos` on the anchor line and recomputes on doc, viewport and geometry changes. InkStrokes are read asynchronously and cached by image path and mtime. - **Setting `inkRemarkOverlay`** (default true, in Handwriting next to `inkRemarks`, suggested name and description): PASS. When off, `sync()` empties the editor extension and the post-processor returns early. Both `saveSettings` and `onExternalSettingsChange` call it. - **README bullet under "Correcting what was read"**: PASS. It also adds a CHANGELOG-INK entry. - **Constraints** (note never written, callout/placement/`^ink-` unchanged, no overlay without `at` or anchor, early bail without `^ink-`, golden fixture untouched): PASS. No write path was added, and `src/__tests__/fixtures/` is not in the diff. - **Validation commands**: PASS, re-run locally. `npm ci` passes, `npm test` passes 714/714, and `npm run build` and `npm run lint` (eslint plus stylelint `--max-warnings 0`) both exit 0. - **Manual Obsidian check**: not done. The MR says plainly that it was not run in a real vault, and there is no automated test for the CM layer. This is human verification of delivered behaviour, not a missing requirement, but a maintainer should do it before merge: reading view and live preview, ✓ removes the overlay, setting off removes all overlays. ## Verdict Approved
Author
Collaborator

Since my last update: the intent review approved, so I tried to self-merge. Forgejo refused all three attempts (squash twice, then a plain merge) with HTTP 405 merge not completed.

On the operator side nothing should block it:

  • self-merge and merging without approval are both allowed;
  • the MR is open;
  • the branch contains current main and has no conflicts;
  • there is no pipeline for head 6224350.

The refusal therefore seems to come from Forgejo itself, most likely a protection rule on main (required approvals or status checks) or a disabled merge style. Approving the MR in Forgejo or merging it by hand should finish it; no code changes are pending.

Since my last update: the intent review approved, so I tried to self-merge. Forgejo refused all three attempts (squash twice, then a plain merge) with `HTTP 405 merge not completed`. On the operator side nothing should block it: - self-merge and merging without approval are both allowed; - the MR is open; - the branch contains current `main` and has no conflicts; - there is no pipeline for head `6224350`. The refusal therefore seems to come from Forgejo itself, most likely a protection rule on `main` (required approvals or status checks) or a disabled merge style. Approving the MR in Forgejo or merging it by hand should finish it; no code changes are pending.
Owner

@claude resolve mr conflicts

@claude resolve mr conflicts
Author
Collaborator

Since my last update: I merged the latest main (7a021f8, the one-click Ollama setup) into the branch and pushed it as 2c10986. Only CHANGELOG-INK.md conflicted; I kept both Unreleased entries. src/main.ts and README.md merged on their own. After the merge, build and lint both exit 0, and all 762 tests pass. I tried to self-merge once more and Forgejo refused again with the same HTTP 405 ("merge not completed"), so it still needs approving in Forgejo or merging by hand. No code changes are pending.

Since my last update: I merged the latest `main` (7a021f8, the one-click Ollama setup) into the branch and pushed it as 2c10986. Only `CHANGELOG-INK.md` conflicted; I kept both Unreleased entries. `src/main.ts` and `README.md` merged on their own. After the merge, build and lint both exit 0, and all 762 tests pass. I tried to self-merge once more and Forgejo refused again with the same HTTP 405 ("merge not completed"), so it still needs approving in Forgejo or merging by hand. No code changes are pending.
daniel merged commit eb84e3acb2 into main 2026-10-20 20:00:33 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
daniel/obsidian-remarkable-round-trip!30
No description provided.