Skip to content

0.26.0

Choose a tag to compare

@github-actions github-actions released this 09 Nov 00:38
· 257 commits to main since this release

Eight features: opacity for ink, pictures and areas, smooth and straighten strokes, tidy up handwriting lines, redaction before export, pen width that follows zoom, a context palette in the colour picker, a dynamic gallery block and a related handwritten pages panel. The notebook format moves to version 24 (opacity): the migration from version 23 is automatic, and Notebook 0.25 and older open a v24 notebook read-only and never overwrite it. Four review rounds are folded in (see Review fixes).

Opacity and document format 24

  • Opacity of ink, pictures and areas (#358) and document format 24. An Opacity slider (5 % to 100 %) in the pen options (the pen and its kinds, the shapes) and in the highlighter options (strokes and the area highlighter, with a value of its own): what you write next is that strong. It multiplies the pen's own look, so 100 % is exactly what every pen did before and the highlighter at 50 % is half of its usual translucency, still multiplied over the page. A favourite pen and a pen set keep it like the width, and the style eyedropper takes it from a stroke.
  • Change what is already there. The selection bar has the same slider for the ink, the pictures and the area highlighters you selected: one step in the history (Opacity changed), undone in one go; groups come whole, a locked item or a text box is left alone, a mixed selection shows a dash until you move it, and the little button puts it back to 100 %. A selection of only a picture now has its bar too.
  • Everywhere you see the page. The canvas, the stroke being written (also the wet ink of the pen, the highlighter and the marker, without a flash when it settles), the night look, PNG, SVG, PDF (one graphics state per strength, multiplied for the highlighter), the interactive HTML, the written-area and copy-as-image pictures, library cards, the page navigator and the hand-in PDF draw the same strength. A notebook that never uses it is saved exactly as before.
  • Document format v24. One more optional number, opacity (0.05 to 1), on a stroke of any pen, an image and an area, written only below 1. The v23 to v24 migration is the identity plus the version (a stray key of a v23 file is dropped); lenient reading clamps a number out of range and drops anything else, counted; strict writing refuses both; repair keeps a valid one; large v23 files are still read page by page. Older versions of the plugin open a v24 notebook read-only. The JSON Schema is now docs/schema/notebook-v24.schema.json.
  • Also. The Opacity action (all-actions sheet, ranked first with a selection of ink, pictures or areas and with the highlighter or a shape in hand, long-press explanations in English and Italian); Join broken strokes and the hook clean-up treat strokes of different opacity as different styles; merge keeps both copies of a stroke whose opacity differs.
  • Code. src/model/opacity.ts (the limits and helpers), src/ink/restyle.ts (planOpacity, one UpdateItems step), src/view/opacity-row.ts (the shared slider row), inkAlpha(tool, opacity) in src/ink/stroke-shape.ts as the one description of a stroke's alpha; tests in tests/model-v24.test.ts; harness scenario doc=opacity.

Tidy up

  • Tidy up (#238). One step that straightens a page of handwriting: the words onto their baseline, the starts of the lines onto a common left margin, and oversized gaps between the lines closed. It works on the selection, or on the whole page when nothing is selected (Tidy up page in the page menu and the All actions sheet, Tidy up on the second row of the selection bar from tablet width, command Tidy up the selection or the page). A small sheet lets you switch each step on or off, shows how many words, lines and gaps would change and how much shorter the writing gets, and does nothing until Tidy up; Cancel leaves the page as it is. The choices are remembered on the device.
  • Rules. The words are moved by the existing align-to-baseline engine; the lines are the ones it finds. Line starts within about two letter heights of each other become one margin (an indent stays an indent; on ruled paper the paper's margin line is used when the writing is next to it). A gap of two blank lines or more shrinks to one blank line, so paragraph breaks stay (switch Keep paragraph breaks off to close every gap to the usual line spacing). On ruled paper a line only moves by whole rules. Lines never end up on top of each other.
  • Safe. Rigid moves of line-pen handwriting only (same points, pressure, width, id and layer). Shapes, the highlighter and the marker, pictures, text boxes, areas and every other element are never moved; neither are locked elements and the groups they belong to, a group that is not whole, ink a collapsed note keeps hidden, ink bound to a graph, and a line that has an underline, a drawing or an object in its way. A locked page refuses the step. One undo step ("Page tidied up" in the history panel); the page times are not touched. No format change.
  • Code. Pure, Node-tested src/ink/tidy.ts (reuses analyseBaseline, which now also hands over the lines it found, selectableItems, applyPlacement); the sheet src/view/tidy-modal.ts; tidy() in src/view/selection-actions.ts; registry actions selection-tidy and page-tidy (help text, context ranking, history title in English and Italian).
  • Tests. tests/tidy.test.ts (two paragraphs, crooked lines, big gaps, ruled paper, a locked box in the middle, groups, hidden ink, one undo, page times, registry); tests/selection-arrange.test.ts (one id added to the second row). Not tried with a real hand or on Android.

Smooth and straighten strokes

  • Smooth strokes and Straighten strokes (#66). Two actions in the All actions sheet (Selection) and the command palette work on the handwriting of the selection, each as ONE undo step with a notice that counts the strokes (history titles Strokes smoothed / Strokes straightened). Smooth takes the tremor out of the lines: a few Taubin passes (a smoothing step and a slightly larger step back, so curves do not shrink) with sharp corners held in place, no point moved farther than about a pen width, so the shape stays and only the wobble goes. Straighten turns a stroke that is almost a line (bend under 7% of its length, no loops, no doubling back) into a clean line between its two ends, each point keeping its share of the way; curves and short marks are left alone, and a second run does nothing.
  • Safe. Strokes keep their id, layer, style, number of points and the pressure of every point; the first and last point never move. Shapes, the highlighter and the marker, invisible ink, ink bound to a graph, the ink a collapsed sticky note keeps hidden, text, pictures and area highlights are not touched; a group is reshaped only when wholly selected and without a locked element; a locked page refuses; the page times do not move. No format change; the stroke pipeline, the renderer and the golden render hashes are untouched.
  • Code. Pure module src/ink/smooth.ts (no obsidian import), SelectionTools.reshape in src/view/selection-actions.ts, registry entries selection-smooth and selection-straighten with long-press help, a context-ranking rule and English and Italian texts. Tests: tests/smooth.test.ts, tests/selection-arrange.test.ts; harness scenario doc=smooth.

Redaction before export

  • Redaction before export (#285). The export dialog has a new row, Cover parts of the page, with a Redact… button. It opens a page preview where you drag boxes (pen or mouse; a finger too while Draw with finger is on, otherwise a finger scrolls) over names, numbers or anything else that must not leave the notebook. The picture is exactly what the file will contain. A box can be removed with its cross, the last one undone, a page or everything cleared. Boxes are kept per notebook on this device only (bounded local storage; never in the notebook, the vault or sync) and applied by a switch, Apply the boxes, that turns on when you draw.
  • Covered content is removed, not painted over. Ink is cut at a box (the parts outside stay, and so does the thickness of the pen: nothing of a line within its own width of a box is kept); a text box, picture, equation, graph, structured box, sticky note, marker, checkbox or excerpt that touches a box is dropped whole, with its text and its source; an area highlighter is cut round the box; margin comments anchored on a box go with their replies; the page header or footer is left out when a box covers it; bookmark titles of a covered page are not written to Markdown. The page's tags and drawing states are not drawn by any export and are removed from the copy. The box itself is a solid black rectangle drawn over everything.
  • Backgrounds. A PDF page or a picture behind a page with boxes becomes a flat image of its own with the boxes burned in before it is encoded (a copy: the cached page is not touched), in the PDF (the original PDF text layer was never in the exported file; the burned picture is the only one), SVG, HTML, PNG, print, Markdown, share and hand-in alike, and also in a Background only export where no ink layer would show the box. Trade-off: that page's background can no longer be selected or searched as text. A background that cannot be burned is left out, never drawn as it is.
  • Where it applies. Export… (PDF, SVG, interactive HTML, PNG images, Print, page ranges, split into sheets, clean copy), Hand in…, Share page…, Export as Markdown, the written-area / selection picture and Copy as image, the quick page exports, and the pictures put into notes by Insert selection into note, Make task, Look up later and the figures list, the figures' Copy image, the Highlights digest and the colour-meaning digest (neither quotes a PDF word a box touches), the book index, the formula sheet, and the public API's exportPdf. In the dialog the switch decides; the other paths apply the notebook's boxes while the switch is on and say so in a notice (the pictures put into notes apply them without one); with boxes switched off they say so once. Boxes that cannot be read refuse every one of these paths with a notice: nothing is written without them. Dropped content is not loaded at all (a covered picture is never read).
  • Not covered, on purpose. The text digest of PDF annotations (it quotes the PDF's own text), Extract pages / merge / split notebooks, the automatic PDF copy (a private copy of the whole notebook), the notebook file itself and its backups, the companion note, Zettel inbox cards, page embeds in notes (they show the live page), PDF text you copy yourself, regions taken into another notebook with Copy as excerpt (that notebook's exports do not read these boxes), and the file title (the notebook's name, also in the PDF title). The export dialog lists them under the switch. Margin comments away from a box are kept (use Clean copy to leave all of them out), and ink written over a dropped picture stays where it was.
  • Code. Pure and Node-tested: src/model/redact.ts (boxes, limits, lenient reader), src/ink/redact.ts (redactPage, cutStroke, burnPixelRects); the boxes ride on the copy of the page (a symbol-keyed field that survives a shallow copy and is never serialised), so every writer, and every future one, draws the redacted page. View: src/view/export-redact.ts (withRedaction, applied by each writer on its own), src/view/redact-dialog.ts, src/view/burn.ts, src/ui/redact-store.ts. No format change, no change to the stroke pipeline.
  • Tests. tests/redact.test.ts, tests/redact-export.test.ts (a SECRET marker in text, notes, equations, box titles, comments and a scanned background must not appear anywhere in the bytes of the PDF, SVG, HTML, hand-in PDF, area picture and Markdown), tests/redact-store.test.ts; harness doc=redact (real canvas: PNG, print/Markdown/share renderer, JPEG burn, area picture, the editor and the dialog row).

Pen width follows zoom

  • Pen width follows zoom (#350). New setting Writing > Pen width follows zoom (off by default, so nothing changes). On: a new stroke looks as wide on screen as the width you chose at any zoom; the stored width is the chosen width divided by the zoom, clamped to 0.1 to 48 page units (96 for the highlighter). Pens, shapes and the stroke highlighter follow the rule; the area highlighter and the eraser do not. The live ink and the saved stroke have the same width. The pen options show the on-screen width with a "× zoom" hint.
  • No format change. Strokes stay plain page-unit widths; the golden pen hashes are unchanged. Code: src/ink/zoom-width.ts (pure helper), the stroke start in notebook-view.ts.

Context palette

  • Context palette in the colour picker (#394). Under the recent colours the picker now has up to two short rows. On this page lists the colours already used on the page in view (strokes of every pen, the highlighter and shapes, shape fills, text, markers, boxes, equations, graphs, checkboxes and areas), most used first, near shades counted as one. On a page with a PDF or picture behind it, From the slide lists its dominant colours (the paper white is left out), found from a small downsampled copy of the page picture (median cut refined by k-means), computed in a timer after the picker is shown, kept per page and never started for a page whose picture is not drawn yet. A colour near a recent colour, or near one already in the page row, is not repeated (ΔE below 8); a colour that has a meaning (colours with meaning) shows its label on the swatch. Tapping a swatch sets the pen colour as the toolbar swatches do and does not add it to the recent colours. A row with nothing to offer is not shown. Long-press explains each row; English and Italian; light and dark. No format change, no change to the input pipeline.
  • Code. Pure module src/ink/context-palette.ts (no obsidian import; tests/context-palette.test.ts), the rows in src/view/colour-picker.ts, the sampling and cache in src/view/colour-tools.ts, the page context in src/view/notebook-view.ts; harness doc=ctxpalette (PDF page) and doc=ctxpalettew (written page).

Gallery block

  • Dynamic gallery block (#421). A notebook-gallery code block in a Markdown note shows pages of your notebooks as a responsive grid of thumbnails with notebook name and page number; tap one to open the notebook at that page. Lines: tag: #x, bookmarked (notebook and global bookmarks), course: Analysis (timetable), notebook: path, marked: question|homework|… (marker kinds and the marked-pages kinds), limit: 12, sort: recent|title. It works in reading view and Live Preview, refreshes (debounced, after the pen is quiet) when the notebooks change, shows a quiet empty state and a readable line for a bad query, and never writes to the vault. The command "Insert gallery block" has a small builder (tag, course, marker, bookmarked, count, order). English and Italian. No format change.
  • Code. Pure src/integration/gallery-query.ts (tested in tests/gallery-query.test.ts), gallery-service.ts (in-memory index, no writes), gallery-render.ts, gallery-builder.ts; thumbnails reuse PageThumbs, which gained data-page-thumb-index.

Related handwritten pages

  • Related handwritten pages (#422). The command Related handwritten pages (also in All actions) opens a panel in the right sidebar. For the Markdown note in front it lists the handwritten pages that relate to it, best first: pages whose text links to the note ([[Note]]), pages that name its title or an alias, pages tagged like the note, pages that name one of its headings (or a bookmark titled like one), and, last, the first page of the notebooks of the note's course. Each row has the page thumbnail, the notebook and page, a reason pill (Links here, Title, Alias, Tag, Heading, Same course) with the matched text, and +n when the page has more reasons.
  • Use. Tap a row to open the page; drag a row into the note to place its embed; the link button copies the link. The panel follows the note you work in (a short delay after you switch notes or edit its headings, tags or aliases) and a refresh button reads the notebooks again. Empty states say what to do. Long-press explains the buttons (English and Italian).
  • Read-only. It reads the library index and the note's metadata only; it never writes to the vault. No format change. A new setting Related pages: same course (Integration) turns the course rows off.
  • Code. Pure, Node-tested ranking in src/library/related-pages.ts (no obsidian import); the panel in src/view/related-view.ts; what it reads from Obsidian in src/view/related-source.ts (reuses the page switcher's index and thumbnails). Tests: tests/related-pages.test.ts; harness doc=related.

Review fixes

  • Opacity is kept where ink is made for you. Snap to text lines gives each snapped highlighter band the opacity the highlighter was drawn with; the stroke a pen gesture leaves as ink after one Undo, and the built-in stamps (check, star, arrow), use the opacity of the pen in hand.
  • Opacity in a file. A value above 1 is read as full strength and saved with no opacity key (still counted as repaired); an opacity of exactly 1 stays as it is and counts as full strength. The app never writes "opacity":1.
  • Tidy up. A line never ends on top of another line that moves, whatever their horizontal overlap; invisible ink and the ink a collapsed note keeps hidden are in the way like any other ink.
  • Smooth and Straighten. Reshaped points are rounded to 0.01 pt like every other edit, so a reshaped stroke takes no more room in the file than before.
  • Pen width follows zoom. The stored width is rounded to 0.01.
  • Related pages. Opening the panel or its refresh button no longer writes the library index file; the entries it keeps are never written over a newer entry of the index.
  • Redaction measures text at its widest. Text boxes, headers and footers are measured with the widest possible characters (capitals, CJK, emoji, wide symbols), with upper bounds for every script and symbol, so a long line of wide characters under a box is dropped instead of slipping past its edge.
  • Redaction follows the real pen. The reach of a stroke follows the real width of its pen (pressure, fountain and brush nibs); the picture of a selection applies every box that touches a selected item.
  • Redaction reaches every export path. The Highlights and colour-meaning digests, the book index, the formula sheet, the figures' Copy image, the pictures sent to a checklist task, Export as Markdown and the public API's exportPdf go through the same redaction; pages shown in a drawing state, and clean copies, keep their boxes. A page header handed to a page picture is the redacted one.
  • Excerpts never leak covered content. An excerpt whose source region is covered, at any depth of excerpts showing each other, is left out of every export and refused by the figures' Copy; while a notebook has any box, its own excerpts are left out too (also one whose source page was deleted or replaced), and so are all PDF words a box touches.
  • Unreadable boxes never export unredacted. Boxes that cannot be read (damaged storage, a refusing storage, another format, or a set that would lose a page or a box) refuse the export with a notice and are kept aside in separate bounded copies, never overwritten silently. Reset redaction storage (after a confirmation) clears them. Entries with a non-boolean switch or unknown fields are treated the same way.
  • Redact dialog. Closing with Escape or the close button never saves a net-unchanged set, nor anything while the stored boxes could not be read; Done saves exactly the boxes shown, even when nothing changed; the preview drops covered excerpts like the export; the messages say what cannot be restored. A first save that fails (a full quota) holds the boxes for the session with one notice, and a notebook whose switch is on is never forgotten to make room.
  • Redaction switch and list. With boxes switched off, an export outside the dialog says so once; the not-covered list names Copy as excerpt into another notebook.
  • Saving. The unsaved-changes backup on closing a notebook or deleting its file is always written, also when an item cannot be written as it is.
  • A stroke or element with no colour no longer makes a notebook unsavable. The writer refuses a missing colour with a message naming the item; an item already in memory gets the default colour of its kind (black for strokes and text boxes) and saves, so undo and redo keep working; a repaired file is backed up first.