Skip to content

feat(draw): ruler, ink help, steadier strokes, online video, immersive reader - #359

Merged
DWAA1660 merged 3 commits into
AlienTechSoftware:mainfrom
DWAA1660:feat/draw-view-insert-batch
Nov 17, 2026
Merged

DWAA1660 merged 3 commits into
AlienTechSoftware:mainfrom
DWAA1660:feat/draw-view-insert-batch

Conversation

@DWAA1660

@DWAA1660 DWAA1660 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

One batch of UI parity work, built on main after #357 merged (a2a47b7), so it does not conflict with the portable export work. Four "not built" placeholders become working features, and pen strokes get steadier.

  • Draw > Ruler (Fixes [UI parity] Implement Draw > Ruler for positioned straightedge ink #293). A straightedge laid on the page. Drag it to move it; drag its round handle, or press [ and ] (Shift for 15 degrees), to turn it; the angle is shown on it. A stroke begun just outside one of its long edges is laid along that edge, half the pen's width out, so it comes out straight and touches the ruler. A press on the ruler moves it and draws nothing. The ruler is window state only: it is never written to the page, and pressing the button again puts it away. Geometry is in notecraft_ink::ruler (no egui) and tested there.
  • Smoother strokes and highlighter edges (Fixes the smoothing half of Pen improvement suggestion #44; the shortcut half was feat(ui-egui): Alt+1..9 pick up a pen, Alt+0 goes back to typing (#44) #235). When the pen is lifted, Stroke::settled takes out hand tremor: each reading between the ends moves towards the average of its neighbours, but never more than a third of a point, or an eighth of the nib's width. Ends and pressure stay exact, and deliberate corners keep their shape. shape::sides and the round caps now read the stroke's direction over a quarter of the nib's width (shape::heading_reach) instead of from the next 0.34 pt sample, so a wide highlighter's edges no longer fold back on themselves. A see-through highlighter painted those folds twice, which was the zigzag in the report. The screen and the saved SVG outline share this code.
  • Draw > Ink Help (Fixes [UI parity] Enable Draw > Ink Help with contextual drawing assistance #296). Opens the Welcome notebook's Handwriting and drawing page in the interface language, falling back to English. The notebook is found by its contents among the open notebooks. With no Welcome notebook open, the status line says where the help is. The current note is not changed.
  • Insert > Online Video (Fixes [UI parity] Enable Insert > Online Video with persistent, safe playback links #284). A themed modal asks for the address, refuses anything that is not an http(s) web address (scripts, file:, user-info hosts, bad ids), and puts Video (Site): address as a link at the caret, replacing any words selected in one line. YouTube (watch, youtu.be, shorts, embed, nocookie) and Vimeo addresses are tidied to their watch page; Dailymotion and TED are named; any other https address is kept as pasted, named by its host. Nothing is embedded, fetched or played in the window. The video opens in the browser only when the link is clicked. The link is ordinary page text, so HTML and CMGFM already round-trip it, and one Undo takes it out.
  • View > Immersive Reader (Fixes [UI parity] Implement View > Immersive Reader as a focused, accessible reading surface #299). The open page as plain, large reading over the window. It has text size (14 to 48), line spacing (1.2 to 2.6), and a line focus of 1, 3 or 5 lines (Up and Down move it). Headings, lists, task boxes, quotes, code, equations and table rows read in the order the page keeps them. Pictures are named by their description, and handwriting is said to be there but not shown. Escape or Close returns to the page untouched. Read aloud is not built: there is no speech service on any platform, and the reader says so.

docs/gaps.md now describes all of this, including what is still missing.

Not included: #356 (notebooks folder in Options), because #358 already covers it.

How it was checked

  • Unit tests: notecraft_ink::ruler (4 tests: page and ruler coordinates, hold vs draw zones, a shaky line along a turned ruler is straight, angle display), Stroke::settled (tremor reduced 3x or more, corners within a tremor, ends and pressure exact), shape (a wide shaky highlighter's edges fold before settling and never after), onlinevideo (4 tests: known sites, other sites, refused addresses, the link), reader (2 tests: reading order and named non-text content, limits), and Ink Help against the checked-in Welcome notebook in both html and cmgfm.
  • UI tests (crates/ui-egui/tests/ui.rs), all failing on main, where the controls were disabled placeholders:
    • the_ruler_lays_a_shaky_stroke_straight_and_moves_without_drawing: a wobbly drag beside the edge saves readings with zero vertical spread beside the ruler; dragging the ruler moves it and draws nothing; [ and Shift+] turn it; it is put away and not in the saved page.
    • online_video_puts_a_link_to_the_video_at_the_caret (HTML and CMGFM): a bad address is refused, a youtu.be address is saved as a link to the watch page, and Undo removes it.
    • the_immersive_reader_shows_the_page_as_reading_and_changes_nothing: the reading, the controls, line focus, Escape, and the page not dirty.
    • ink_help_opens_the_drawing_page_of_the_welcome_notebook: the missing-notebook message, then the English drawing page.
  • ui.inspect gained ink.ruler, ink.lastStroke and reader for these tests and for scripts.
  • New strings are in en.tsv, en-XA.tsv and ar-XB.tsv.
  • I looked at screenshots of the ruler, the Online Video dialog and the reader (light theme).
  • Local cargo xtask ci on the final commit (Linux): fmt and workspace clippy (-D warnings) passed. The test phase was still running when this was pushed, at the owner's request; the new tests above passed in focused runs. Hosted CI is the full check.

Not tested: a real pen tablet with the ruler (only synthetic mouse input), and the web build.

Quality level L3

  • cargo xtask ci passes on the current branch before pushing (fmt and clippy passed; tests were still running at push).
  • Hosted CI checks pass for this pull request.
  • Docs (docs/gaps.md) match the change.
  • Requirements-first UI tests for every new control.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y4im4nDYbxmtByUCBaBzNq

Replaces four "not built" placeholders and improves pen strokes:

- Draw > Ruler (AlienTechSoftware#293): a straightedge on the page. Drag to move,
  drag the handle or press [ and ] to turn it. A stroke begun just
  outside a long edge is laid along that edge. Never saved.
- Pen strokes (AlienTechSoftware#44): tremor is taken out when the pen is lifted, and
  a wide nib's edges follow the line over a quarter of its width, so
  highlighter edges and ends no longer zigzag.
- Draw > Ink Help (AlienTechSoftware#296): opens the Welcome notebook's handwriting
  page in the interface language, else English.
- Insert > Online Video (AlienTechSoftware#284): a checked link to the video at the
  caret. Nothing is loaded until the link is clicked.
- View > Immersive Reader (AlienTechSoftware#299): the page as plain reading with
  text size, line spacing and a line focus. Read aloud is not built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4im4nDYbxmtByUCBaBzNq
@DWAA1660
DWAA1660 enabled auto-merge November 17, 2026 21:33
DWAA1660 and others added 2 commits November 17, 2026 14:42
The wide-nib edge change (AlienTechSoftware#44) moves the outline points written into
each ink.svg; the readings are unchanged. Regenerated with cargo xtask
demo; demo-check is clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4im4nDYbxmtByUCBaBzNq
DWAA1660 added a commit to DWAA1660/notecraft that referenced this pull request Nov 17, 2026
Brings in main with AlienTechSoftware#358 and the AlienTechSoftware#359 test fix. The i18n catalogs
conflicted only where both sides appended; both kept. Tabs layout is
built here (AlienTechSoftware#268), so the placeholder test lists it as working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4im4nDYbxmtByUCBaBzNq
@DWAA1660
DWAA1660 merged commit 74818a4 into AlienTechSoftware:main Nov 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant