Skip to content

feat: automatic shapes, ink replay, section tabs, font and highlight colours - #360

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

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

Conversation

@DWAA1660

Copy link
Copy Markdown
Collaborator

What and why

A second batch of UI parity work, stacked on #359 (built on its branch, so it merges cleanly after it). Until #359 merges, this diff also shows #359's two commits; the new work is the last commit, 9ba5d1f.

  • Draw > Automatic Shapes (Fixes [UI parity] Implement Draw > Automatic Shapes recognition #294). A toggle (kept in the settings). When it is on, a stroke that is plainly a straight line, a rectangle with sides along the page, an ellipse with axes along the page, or a triangle is redrawn clean when the pen is lifted. It keeps the stroke's tool, colour, width, gain and place, with an even pressure at the hand's average. Recognition (notecraft_ink::recognise) is strict: short strokes, writing, open loops, scribbles, stars, diamonds and pentagons stay exactly as drawn. The result is ordinary ink, so both page formats keep it. It is two undo steps: one Undo brings back what the hand drew, and Redo the clean shape. Strokes laid along the ruler are not reread, and existing ink is never reinterpreted.
  • Draw > Ink Replay (Fixes [UI parity] Implement Draw > Ink Replay with ordering, playback and a legacy-data fallback #295). Replays the page's strokes in the order the ink file keeps them, which is the order they were drawn, in both formats. Controls: play and pause (also Space), restart, previous and next stroke, speed (0.5x, 1x, 2x, 4x), and close (also Escape). No stroke has ever been saved with a time, so every stroke replays at an even speed with a short pause between strokes; the bar says so rather than inventing timings. Replay only paints: no drawing during it, no change to the file, and no part in undo. It replays the whole page; replaying only selected ink is not built.
  • View > Tabs layout (Fixes [UI parity] Enable Tabs Layout with horizontal section tabs as an alternative to the tree #268, Fixes Classic Theme #33). The open notebook's sections as coloured tabs across the top of the page, as in OneNote 2016. A section group is a tab that lists its sections, nested groups included. Choosing a tab opens that section's first page. The choice is kept; tabs scroll sideways when they overflow; they run right to left in an RTL interface; and each tab is a focusable button with its name for screen readers. The tree stays in the side panel. Not built: vertical tabs on the right, and a notebook list across the top.
  • Home > Font Colour and Text Highlight Colour (Fixes [UI parity] Add text font-colour and text-highlight palettes to Home #260). Two palettes at the end of the first Basic Text row: ten standard text colours with Automatic, and six highlights with No Colour, each swatch named for accessibility. They apply to the selection (in one line or across lines) or to what is typed next at the caret, with Undo and Redo. Span gains colour and highlight, kept as exact #rrggbb in a NoteCraft inline <span style="color: ...; background-color: ..."> in both CMGFM and HTML, with round-trip tests. Colours in other notations (names, rgb()) are not read. On screen, a colour too faint for the theme is moved towards the theme's text colour, and a highlight is washed on dark themes, so text stays readable on all 14 themes; the file keeps the chosen value. The palettes show the current colour, and the format painter carries colours too. Not built: More Colors, and colours in table cells.

docs/gaps.md describes each of these and what is still missing.

I checked that none of these issues was assigned, claimed in a comment, or referenced by an open PR before starting.

How it was checked

  • Unit tests: recognise (lines, boxes, ellipses and triangles found; ticks, waves, open loops, pentagons and back-and-forth scribbles left alone; the redrawn shape keeps pen and place), replay (order, partial strokes, play/pause/step/speed, the end, an empty drawing), sectiontabs (sections and nested groups in order) and textcolour (parsing, readability on light and dark pages).
  • Real data: crates/ink/tests/recognise_demo.rs runs recognition over the Welcome notebook's real ink.svg strokes in both html and cmgfm. The twelve handwritten letters stay writing, the drawn circle is found, and the shapes page gives a line, rectangle, ellipse and triangle while leaving the star, diamond and arrow alone.
  • Formats: text_colour_and_highlight_round_trip_through_cmgfm_and_html (exact colours, nesting, #rgb widened) and a_colour_that_is_not_a_plain_hex_value_is_not_taken. format_parity is green.
  • UI tests (all failing on main, where these were placeholders or missing):
    • automatic_shapes_redraws_a_hand_drawn_box_and_undo_brings_it_back
    • ink_replay_plays_the_strokes_in_order_and_changes_nothing (the ink file is byte-identical afterwards)
    • tabs_layout_shows_sections_as_tabs_and_opens_them
    • font_colour_and_highlight_colour_the_selected_words_in_both_formats (HTML and CMGFM: saved colours, only the picked word, Automatic removes, Undo restores)
  • The feat(draw): ruler, ink help, steadier strokes, online video, immersive reader #359 UI tests still pass on this branch.
  • Locally: cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo xtask layers, assets, docs, text, demo-check and i18n-audit all pass. I looked at screenshots of each feature (light theme). The full local UI suite was not run before pushing; hosted CI runs it.

Quality level L3

  • cargo xtask ci passes on the current branch before pushing (fmt, clippy, static checks, i18n and the focused tests passed; the full suite runs in hosted CI).
  • Hosted CI checks pass for this pull request.
  • Docs (docs/gaps.md) match the change.
  • Requirements-first UI tests for every new control; HTML/CMGFM round trips for the new span colours.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y4im4nDYbxmtByUCBaBzNq

- Draw > Automatic Shapes (AlienTechSoftware#294): when on, a hand-drawn line,
  rectangle, ellipse or triangle is redrawn clean on pen lift.
  Strict recognition (notecraft_ink::recognise), checked against
  the Welcome notebook's real strokes; one Undo restores the hand
  stroke. The setting is kept.
- Draw > Ink Replay (AlienTechSoftware#295): replays the page's strokes in their
  saved order at an even speed, with play/pause, restart, step and
  speed. It never changes the drawing or undo.
- View > Tabs layout (AlienTechSoftware#268, AlienTechSoftware#33): the notebook's sections as
  coloured tabs over the page; a group is a tab with a list.
- Home > Font Colour and Text Highlight Colour (AlienTechSoftware#260): exact
  #rrggbb colours on the selection or next typing, kept in HTML
  and CMGFM as span color / background-color, readable on every
  theme.

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 22:17
DWAA1660 and others added 2 commits November 17, 2026 15:24
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 458ef68 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