Skip to content

0.28.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 06:18
· 161 commits to main since this release

Eight features: rotate and crop PDF pages (#76), per-page undo (#98, a setting, off by default), hand-drawn tables (#41), a paint bucket (#184), a line handle to reorder lines (#256), a live lecture mode (#132), numbered boxes with an index (#205) and actions suggested by the selection's geometry (#403). The notebook format moves to version 26 (PDF page rotation and crop): the migration from version 25 is automatic, and Notebook 0.27 and older open a v26 notebook read-only and never overwrite it. Three review rounds are folded in (see Review fixes).

pdfrotate

  • Rotate and crop imported PDF pages (#76) and document format 26. The page sheet (and All actions) has Rotate PDF page right, Rotate PDF page left and Crop PDF page… for pages that show a PDF. The crop dialog shows the whole page with a frame (finger, S Pen or mouse drag on the corners, edges or inside; arrow keys on a focused handle), turn buttons, Whole page to reset, and, for a PDF with several pages in the notebook, All N pages of this PDF. One edit is one undo step (PDF page rotated / PDF page cropped in the history panel, in English and Italian).
  • Nothing moves on the PDF. The ink, highlights, areas, pictures, boxes, comment regions and the pivots and poses of states are carried with the page by a quarter turn and a shift (strokes and areas turn exactly; pictures turn; text boxes, equations, graphs, sticky notes and checkboxes keep their orientation and size and only their centre goes where it would go, with the ink written on them). Locked pages refuse the change; hidden ink, groups, locked elements and page times are respected.
  • Nothing is lost or clipped. Ink that would end up beyond the left, right or bottom edge of the new page makes the page margins grow just enough to hold it, so it stays visible and editable beside the PDF. Ink that would end up above the top edge (a page has no top margin) stops the change for that page, with a notice; nothing is changed. Comment regions are kept inside the page.
  • Every page, every output. The canvas, thumbnails, the zoomed-out levels, PDF text search, selection, links and the text-following highlighter, annotation and digest exports, the PDF, PNG, SVG and interactive HTML exports (the PDF re-embeds the turned, cropped picture), hand-in, presentation, the reference window and the hover preview all draw the same page. The view-only Crop PDF margins option still works, on top of a stored crop (it fits the white margins inside it).
  • Document format v26. Two optional fields on a PDF page background: rotate (90, 180 or 270, clockwise, on top of the PDF's own rotation) and crop (x, y, width, height in PDF points of the upright page, applied before the turn). The v25 to v26 migration is the identity apart from the version; invalid values are dropped and counted when reading and refused when writing; a v26 notebook opens read-only in 0.27. Schema docs/schema/notebook-v26.schema.json, documented in docs/format.md.
  • Code. src/model/pdf-view.ts (geometry and plan), pdf-view-format.ts (the file form), pdf-view-command.ts (SetPdfView), pdf-view-ops.ts (this page or all), src/view/pdf-view-actions.ts and pdf-crop-logic.ts (the actions and the dialog), PdfStore.render(asset, page, scale, view), boxesOnPage / pageToPdf / pdfRectToPage with a view.

pageundo

  • Per-page undo (#98). A new switch, Undo on this page only (Settings > Pages, off by default), makes Undo and Redo act on the page in view (in a two-page spread, the page you touched last): the latest change made on that page is taken back even if you wrote on other pages since, and the other pages are never touched. The toolbar buttons then read Undo on this page / Redo on this page (tooltip and long-press help). With the switch off nothing changes.
  • One history, not several. The notebook still keeps ONE history; each step knows which pages it touched. Undo on a page takes the newest step that touches that page out of the middle of the history and runs the step's own inverse (never a snapshot), so later edits of other pages are never dropped. It is safe because no later step touches that page. A step that touched several pages (moving ink between pages, copies to a page), the page list (add, delete, move, reorder, insert) or the whole notebook (properties, saved views, files) is global: it is never undone out of order, and a notice says so and points to the history panel.
  • Redo. An undone step stays redoable while you write on other pages; a new edit on the same page (or any global change) drops it, as a new edit always does. Redo on a page brings back the step that page undid last. The guards are the ones of an ordinary Undo: locked pages, the document check (a step that would make the notebook unsavable is refused), groups (a macro run is one step) and the read-only mode.
  • History panel. With the switch on, the panel marks the steps of the page in view ("this page") and the steps that touch the whole notebook ("whole notebook") and says so; the list, the order and the jumps stay global.
  • Code. src/model/page-undo.ts (which pages a step touches, pageRules), src/model/page-scope.ts (types and pure rules the History needs), History.undoOnPage / redoOnPage / peekOnPage / setPageRules / setPagewise in src/model/history.ts; no format change. Tests: tests/page-undo.test.ts, tests/page-undo-review.test.ts, tests/page-undo-r2.test.ts, tests/page-undo-panel.test.ts; harness scenario doc=pageundo.

linehandle

  • Line handle (#256). Reorder lines (page menu, All actions, command palette) shows a small handle at the left of every handwritten line of the page in view. Drag a handle and the whole line moves between the other lines; the lines in between shift up or down by the moved line's height, so the spacing is kept. Up and down buttons in a small bar (and the arrow keys on a focused handle) do the same one place at a time. A handle that is only tapped chooses its line.
  • What moves. The line's line-pen handwriting (pen, fountain pen, brush), its invisible ink, and every element wholly inside the line's strip (an area highlighter behind it, a text box, checkbox or picture at its end, a sticky note with the ink it keeps hidden, a graph with its bound ink) move together, as rigid translations (same points, pressure, width, taper, id and layer). One undo step per drop (UpdateItems, titled Line moved in the history panel); the page times and the document format do not change.
  • What refuses. A locked element on the line, a group that reaches beyond the line, a shape, drawing or highlighter stroke across it, an item that two lines would both move, a locked page, a read-only notebook, a line that would land on something that stays put or outside the page: the handle is dimmed, and the message says why. Nothing is moved on a refusal.
  • Code. Pure planner src/ink/line-reorder.ts (reuses analyseBaseline and the line joining of tidy.ts), the handles layer src/view/line-handles.ts (DOM over the canvas, no change to the pointer controller or the input policy), registry action page-reorder-lines. English and Italian texts, long-press help, context ranking. Tests tests/line-reorder.test.ts; harness doc=linehandle. Not verified on Android hardware.

tables

  • Hand-drawn tables (#41). Table in the insert sheet asks for rows, columns, cell size, line width, line style, colour and a thicker line under the first row, then draws the grid at the centre of the view: straight shape lines of one group, one undo step, exported like any shape (taper never applies). With the table selected the All actions sheet offers Add row, Add column, Remove last row, Remove last column and Even out cells, each one undo step (fresh lines, same group; a locked page refuses them). A row or column insert moves the ink that lies fully inside the table beyond the new line by the cell size (only ungrouped, visible ink); the other edits leave ink where it is. Snap now also pulls to the row and column lines of a table. No format change: a table is recognised again from its lines.
  • Code. src/ink/table.ts (geometry, detection, snap lines), src/ink/table-edit.ts (History commands), src/view/table-dialog.ts, src/view/table-tools.ts; tests tests/table.test.ts; harness doc=tables. Not verified on Android hardware.

bucket

  • Paint bucket (#184). A Paint bucket button at the end of the colour row (pen, highlighter and shape options; also a command and in the All actions sheet): tap it, then tap inside an area closed by ink and the area is filled with the colour in use, behind your lines. A light tint by default (Settings, Writing: Paint bucket fills as a tint; off = solid), with the pen's opacity. Gaps of about a pen width in the outline are closed; an outline that is not closed, a tap on a line, a tiny pocket, an area as large as the page or a page with too much ink gives one clear notice and adds nothing. One undo step ("Area filled"). The mode ends with each fill, like the eyedropper.
  • Stays vector, no format change. The ink of the page is drawn into a low-resolution mask (2 to 4 cells per pt, at most 2 million cells; a window around the tap on a huge page), the area under the tap is flooded against a time budget, and its outline is traced and simplified to a polygon of at most 400 corners in page coordinates (then resampled every 3 pt like any shape). That polygon is stored as an ordinary filled shape stroke (format 22 fill, fillTint, format 24 opacity) with a hairline, placed after the earlier fills and before all the ink, so every renderer and export already draws it under the lines. Known limit: the fill is one polygon without holes, so a closed shape inside the area is coloured inside too (tap it to give it its own colour).
  • Code. src/ink/paint-bucket.ts (pure: mask, dilation, flood, tracing, simplification), src/view/paint-bucket.ts (armed tap, mask drawing), registry action paint-bucket, bucketTint setting. Tests: tests/paint-bucket.test.ts, timing in tests/paint-bucket.perf.ts; harness doc=bucket (dev/harness/bucket-check.ts). Not verified on Android hardware.

livelecture

  • Live lecture bar (#132). While a lecture runs, a small floating bar at the bottom left shows the elapsed time and two quick buttons: New page (after the current page) and Important moment, which bookmarks the current page with a time stamp such as "★ 12:34" (several moments on a page are joined). The end-of-lecture panel lists the moments with their pages; tapping one jumps there. The bar folds to the timer, fades with the toolbar while writing, works in the two-page spread and can be switched off in Settings > Study. No format change: the stamps live in the page bookmark title.

boxnum

  • Numbered boxes (#205). Definition, theorem, example and remark boxes show a number on their tab ("Def. 3.2", Italian "Def.", "Teor.", "Es.", "Oss."), on screen and in every export that draws box labels (PDF, PNG, SVG, print, share). Numbers are worked out from the document each time and never stored (no format change): moving or deleting a box renumbers the rest. Order is page order, then position on the page; proofs are not numbered. The chapter prefix counts the large level-1 headings of the notebook (boxes above the first heading have none). Settings, Pages: numbering on/off (default on), chapter prefix, one counter for all kinds.
  • Index of definitions and theorems. A dialog lists every numbered box with its colour, number, title and page, and jumps to it; Write index note writes <Notebook> — Definitions.md next to the notebook between owner markers (same safety rules as the formula sheet: only the region is rewritten, a note of yours is never touched, boxes under a redaction box are left out).
  • Code. src/model/box-numbering.ts (pure), src/view/box-numbers.ts (cached labels), src/view/box-index.ts.

geosuggest

  • Actions suggested by the selection's shape (#403). A selection bar can show up to two chips above its rows, from plain geometric rules (no AI, nothing leaves the device): one horizontal row of handwriting offers Highlight (a new action: an area highlighter behind the words, one undo step) and Insert into note; two groups of ink joined by an arrow-like stroke offer Link to a note… and Group; a loop drawn around ink offers Group. A paragraph of several lines, a single stroke, and any selection with pictures, text or objects offer nothing. Each chip runs the ordinary action through its normal path (History included); the chips sit in a row of their own, so no slot of the bar moves, also on a phone. Setting Suggest actions from the selection (Appearance, on by default). Highlight is also in the All actions sheet and the command palette; long-press on a chip shows its help. No format change.
  • Code. suggestFromGeometry in src/ui/selection-kind.ts, src/ui/selection-suggest.ts, suggest in the selection part of UiContext and in ContextBarPlan, ContextBar.chip, NotebookView.highlightSelection.

Review fixes

  • PDF pages: redaction fails closed. Redaction boxes are in page coordinates, so a page that has boxes is never turned or cropped (Remove or redo the redaction boxes on this page first; with All pages it is skipped and the notice says so), and each box remembers the turn and crop of the page it was drawn on: when a page no longer shows that view (an undo of a turn, a copy from another device, a re-published slide) every export, hand-in, print, picture and the API refuse with A page was turned or cropped after its redaction boxes were drawn… until the boxes of that page are redrawn. Nothing is ever written unredacted. Boxes of 0.26 and 0.27 (no view recorded) count as drawn on the upright, whole page.
  • PDF pages: what turns and what follows. Text boxes, equations, graphs, sticky notes, checkboxes and excerpts keep their size and orientation when the page turns, and the plan measures them that way (a tall note that would end up above the page refuses the change, a wide one makes the margins grow); same-notebook excerpts and saved views of a changed page follow it in the same undo step (excerpts of the page in other notebooks keep their saved picture and may jump to the old region; region links in notes are not rewritten; the reading position is only a scroll hint); a crop hides text, links and search hits it leaves out; the page navigator, copy-as-image and live excerpts no longer show a stale picture after a half turn or a moved crop; ink that already touches the top edge no longer blocks a crop; All pages skips a locked page instead of refusing everything; ink written on a text box no longer rotates a state's pivot about the wrong point; a frame too small to be a crop is refused instead of removing the crop; repair keeps a valid turn when only the crop is damaged; four turns of an A4 page give back its exact size.
  • Per-page undo: shared tables. The file table, the slide table and the cover belong to every page, so a step that added a picture file or a slide link is only undone in order (a notice says so and points to the history panel), a redo never jumps past an undone step that is global or registers one, and removing a file (the storage manager's repoint) blocks every page. The content check now validates picture, background and cover references on every edit, undo and redo instead of trusting its cache, so a missing reference is a refused step and never a notebook that cannot be saved. A step taken out of order that the check refuses stays in the history where it was (with its own notice); a refused redo clears no other page's undone steps; a macro run is filtered as one step; the undone steps are bounded by the same limit as the undo list. Unclassified commands block every page.
  • Per-page undo: redo after a new edit. When a new edit (or a refused redo) drops an undone step that added a picture file or a slide link, or that was global, the undone steps below it on the other pages are dropped too, because they may point at what that step would have put back. Before, a redo on another page could bring back ink whose slide link was then silently lost on save, or a picture refused with an error notice. Undone steps that share nothing with the new edit still stay redoable.
  • Line handle: everything that moves is checked. Everything that moves with a line is now checked, not only its handwriting: a note's hidden ink or expanded box, an underline, a text box or a picture can no longer be pushed off the page or land on something that stays, and a mark drawn on a moved element refuses the line instead of being left behind. Margin comments inside a line's band move with it in the same undo step (a region that touches the writing without being inside the band refuses the line). Lines that would overlap each other after the move, lines holding a part of a drawing with states, and pages with a PDF or picture background are refused with their own messages. A drag whose page changed meanwhile (undo, sync, reload) is cancelled with a notice and never makes an empty step; the plan is made once per frame and only the handles in view are touched; the mode stops when the notebook is closed; a refusal by the history is not reported as "page locked". Ink a collapsed note keeps hidden no longer refuses lines it does not belong to.
  • Redaction boxes are never moved out from under. Reorder lines, and a table row or column insert that pushes ink along, are refused with a notice when any ink they move is under a redaction box of the page now, would land under one, or when the stored boxes cannot be read: a bulk move must not let the line a box was drawn over slide away and another take its place unredacted. Remove or redo the boxes first.
  • Table edits are all or nothing and stay on the page. Add row and Add column are refused, with a notice, when the grown table or the ink they push along would end up beyond the page edge (the bottom edge only on a page of fixed height); nothing is changed. A table whose lines belong to a part of a drawing with states cannot be edited (fresh line ids would drop the lines from the part), and an edit whose lines are not all on the page any more is refused instead of adding the whole grid next to the old lines. Tests tests/table-line-fixes-w28.test.ts.