Commit Graph
21 Commits
Author SHA1 Message Date
haraldandClaude Opus 5.5 307c803246 feat(math): offer the result next to a handwritten = (Issue #46, stage 3)
New module math_assist.rs: when the last two strokes form an = and the pen
rests for 500 ms, the strokes left of it (in a band around the =, up to a
wide gap) are recognized and computed. The suggestion appears next to
the = and shows what was read, e.g. "2⁴ = 16"; tapping it with the pen
or clicking inserts the result as a text box in the ink color and as high
as the handwriting, as one undo step. The chip is not interactive for
egui, so fingers and palms pass through. Any new stroke drops it. In a
chain like x = 2 · 3 = the part after the previous = is computed.

Off by default: ☰ → Input → "Compute formulas after =", saved in
ui.json. math::display writes the recognized expression neatly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 14:45:00 +01:00
haraldandClaude Opus 5.5 d16cd2db72 feat(math): recognize handwritten expressions (Issue #46, stage 2)
New module math_ink.rs turns the strokes of an expression into text for
math::solve. Consecutive overlapping strokes are grouped into symbols,
each symbol is classified with the $P point-cloud recognizer (plus the
turning angle and a small stroke-count penalty) against built-in
templates for digits, + ( ) / x y a b, and the structure comes from the
positions: stacked lines are =, stacked dots :, lines with symbols above
and below are fraction bars, low dots between digits decimal commas and
raised symbols exponents. Own templates can be added for stage 4.

Tested with synthetic handwriting (slanted, rotated, warped); not used by
the UI yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 14:27:25 +01:00
haraldandClaude Opus 5.5 cd490dd9a7 feat(math): exact evaluation of handwritten expressions (Issue #46, stage 1)
New module math.rs: solve() reads a recognised expression such as 2^4,
2,5 · 3 or (x + 3)² and returns its result as text (16, 7,5,
x² + 6x + 9). Own parser with exact fractions and polynomial expansion
instead of evalexpr, as implicit multiplication and expanding need it
anyway. Not used by the UI yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:34:32 +01:00
haraldandClaude Opus 5.5 6694d79f16 ci(android): ship the APK with every release (Issue #45)
The release job now waits for the android job, takes its APK, lists it in
SHA256SUMS.txt and uploads it as a release asset. The android job is no
longer optional. README describes installing the APK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 08:32:30 +01:00
haraldandClaude Opus 5.5 7584827c04 ci(android): containerized APK build and CI job (Issue #45)
- scripts/setup-android-sdk.sh installs fixed versions of the Android
  command-line tools (checksum verified), platform 34, build-tools
  34.0.0 and NDK 28.2
- packaging/android/Containerfile + scripts/build-apk-container.sh build
  the APK in a container (podman or docker) with JDK 17 and Rust 1.99
- New CI job "Android APK (experimental)": builds the APK and keeps it
  as a workflow artifact, signed with the key from the secrets
  ANDROID_KEYSTORE_B64/ANDROID_KEYSTORE_PASS/ANDROID_KEY_ALIAS if set.
  Not part of the release yet; its failure doesn't block the release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:39:35 +01:00
haraldandClaude Opus 5.5 0be321837c feat(android): Java activity for keyboard text and the system file dialog (Issue #42)
InkActivity extends NativeActivity:
- An invisible view with its own input connection receives the soft
  keyboard's text (commitText, deleteSurroundingText), so characters
  without a key event (umlauts by long press, ...) arrive as well. The
  field is a visible-password field, so keyboards commit each character
  instead of composing words.
- Import and "insert image" open the system file dialog
  (ACTION_OPEN_DOCUMENT); the chosen file is copied to the cache folder
  and handed to Rust by path.

src/android_bridge.rs calls the activity through JNI and receives its
native calls; package-android.sh compiles the class with javac and d8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:23:52 +01:00
haraldandClaude Opus 5.5 a8aef30db7 feat(android): pen input, soft keyboard and exports to Downloads (Issues #42, #44)
- Pen vs. finger (#44): the patched winit hands Android pointers with
  tool type stylus/eraser to the app separately (take_pen_samples, with
  hover and button state) instead of as touch events. src/pen.rs turns
  them, like octotablet's events on the desktop, into one PenInput
  stream, so pen buttons, the eraser end and palm rejection work the
  same everywhere. Hover exit right before touch-down does not count as
  leaving; a pen without hover leaves 150 ms after lifting.
- Soft keyboard: shown via AndroidApp::show_soft_input when a text field
  gets focus, hidden when it loses it. The patched winit now fills
  KeyEvent::text, so typed characters reach egui.
- Exports (PDF, PNG, SVG) are written to the app folder and copied to
  Download/ink-notes through the MediaStore (Android 10+, via JNI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:54:48 +01:00
haraldandClaude Opus 5.5 7faf78ddeb feat(android): follow the activity lifecycle and build an APK (Issue #42)
- The drawing surface is created once the native window exists (Resumed)
  and released when the app goes to the background (Suspended); before
  that everything is saved, as Android may stop the app at any time
- Android's back button acts like Escape instead of closing the app
- Panics are written to logcat; no update check on Android yet
- scripts/package-android.sh builds target/ink-notes_<version>_arm64.apk
  without Gradle (NDK, aapt2, zipalign, apksigner); signing key from
  ANDROID_KEYSTORE/ANDROID_KEYSTORE_PASS/ANDROID_KEY_ALIAS, otherwise
  the debug key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:23:28 +01:00
haraldandClaude Opus 5.5 e47c2b6f28 build: replace printpdf 0.7 with own PDF writer on lopdf 0.46
printpdf 0.7 pinned lopdf 0.31; newer printpdf versions are a complete
rewrite. The export now uses src/pdf_writer.rs, a small writer on top of
lopdf 0.46 with the subset of the printpdf API the export used: pages with
layers (optional content groups), paths, embedded TrueType fonts (Type0,
Identity-H, ToUnicode), images and bookmarks. Bookmark titles are written
as UTF-16BE directly, so the post-processing step for them is gone.
pdf_merge uses lopdf 0.46 as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:54:13 +01:00
haraldandClaude Opus 5.5 e5a8601f87 feat: Windows build and Android groundwork (Issues #48, #42)
Shared groundwork:
- paths.rs: folders for data, settings and downloads per system (Linux XDG
  unchanged, Windows %APPDATA%/%LOCALAPPDATA%, Android app folder)
- Linux-only parts behind cfg: Wayland on-screen keyboard (osk/wayland.rs),
  display backend and app id, the vendored winit touch extensions
- run_with(event_loop) so that other entry points can start the app

Windows (#48):
- cross-compiled with MinGW into a portable ink-notes_<version>_x86_64.exe
  (system DLLs only), no console window in release builds
- file picker: user folders and drives; held notebook locks are detected
  (ERROR_LOCK_VIOLATION)
- updater: replaces the running .exe via rename, active at the next start
- octotablet panicking without the Tablet PC components no longer crashes
  the app
- release: .exe built in CI and part of the signed checksums
- all library tests pass under wine

Android (#42):
- android_main entry point, winit with android-native-activity,
  android_logger; octotablet and arboard left out there
- cargo check and the cdylib build for aarch64-linux-android pass; the window
  surface does not follow the activity lifecycle yet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:13:37 +01:00
haraldandClaude Opus 5.5 9b34e30475 feat: sync notebooks between devices via a synced folder (Issue #49, stage 1)
- Storage location setting: the notebooks can be moved into a folder kept in
  sync by Nextcloud, Google Drive, Syncthing etc. (subfolder `ink-notes`);
  existing notebooks are copied there if it is still empty, the originals stay.
- Changes from other devices are taken over while everything local is saved:
  changed pages are reloaded, new/removed/reordered pages and titles come in
  through the manifest. A page file still being synced is retried later
  instead of being set aside as damaged.
- Conflict copies made by sync clients become pages of their own.
- `.opened_by.json` marks the device that has a notebook open; opening a
  notebook open elsewhere shows a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:09:39 +01:00
haraldandClaude Opus 5.5 397bf3bfe4 feat: import Saber notebooks (Issue #47)
The import now also accepts Saber files: .sbn2 (BSON) with its asset
files next to it, .sba archives (zip with main.sbn2 and assets) and the
old JSON .sbn, including the layout before format version 8 with
strokes outside the pages. Taken over: strokes with pen pressure and
perfect_freehand's thinning, highlighters, circle and rectangle shapes,
typed text (Quill delta as one text field), images (SVG rasterized),
background images and PDF pages as PDF backgrounds, paper patterns.

BSON and zip are read by small built-in readers, so no new
dependencies. The SVG rasterizer moved to src/import.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 12:25:29 +01:00
haraldandClaude Opus 5.5 46026eb8e5 feat: import Rnote notebooks (Issue #47)
The import (menu entry and drag & drop) now also accepts .rnote files
from Rnote 0.5.10 on, including the transformation and document config
layouts that changed in 0.13 and 0.15. Taken over: brush strokes with
their pressure curve, shapes as outlines, texts, bitmap images and SVG
images, which are rasterized with resvg (Rnote stores imported PDF
pages as SVG). Fixed-size and continuous documents keep their pages;
infinite ones become an endless notebook.

The parts shared with the Xournal++ import moved to src/import.rs.
resvg and its dependencies were added to the Flatpak cargo sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:40:51 +01:00
haraldandClaude Opus 5.5 2bd697ef82 feat: import Xournal++ and Xournal notebooks (Issue #47)
The import menu entry (formerly "Import PDF") and drag & drop now also
accept .xopp and .xoj files. Each Xournal page becomes a page of a new
notebook: strokes with pen pressure, highlighters, texts, embedded
images, lined/squared/dotted paper, image backgrounds and PDF
backgrounds (looked up at the stored path and next to the file). All
layers are flattened in order; LaTeX formulas are skipped and counted
in the status message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:10:34 +01:00
haraldandClaude Opus 5.5 b11fb2d762 refactor: move the event loop into the library as app::run (prep for Issue #42)
src/main.rs is now only the desktop entry point; the app itself lives in
src/app.rs, so other entry points such as android_main can start it. The code
is unchanged apart from crate:: paths; the source scans in the i18n and UI
tests and the docs point to app.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 14:02:43 +01:00
haraldandClaude Opus 5.5 1e34c01ad2 fix: eraser size menu, pointed shape corners, flat tiles for slides (Issues #38, #40, #41, #28)
- #38: the eraser size button opens a menu like the pens: four presets and a slider
  (2–30 mm diameter)
- #41: shape corners stay pointed down to about 14° (miter limit 8 instead of 2)
- #40: page picker tiles are as high as the tallest page needs, so slides get flat tiles;
  the frame follows the page instead of the whole tile
- #28: the fling diagnosis also logs finger starts, mouse buttons and wheel/touchpad events

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:46:49 +02:00
haraldandClaude Opus 5.5 2a06e2604a fix: palm rejection, eraser sizes, PDF thumbnails, even polygon strokes (Issues #37-#41)
- #41: snapped triangles, rectangles and polygons keep the full stroke width on every
  side; corners are mitered, sharp ones bevelled (the old corner offset thinned the edges)
- #38: four eraser sizes, cycled by a button below the eraser modes and remembered in
  ui.json
- #37: a selection made with the pen's select button can be moved with the bare pen
- #39: fingers resting on the screen when the pen comes near, or touching it while the pen
  is near (and 0.7 s after), are ignored until lifted; the vendored winit ignores touches
  on the title bar meanwhile
- #40: the page picker shows imported PDF pages, rendered small in the background

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 15:06:39 +02:00
haraldandClaude Opus 5.5 630fe31b76 feat: endless canvas grows only to the right and down (Issue #30)
The view stops 10 mm left of and above the start frame, or above and left
of content that lies further out in notebooks from 0.29/0.30, so a new
endless notebook starts at the top left like a sheet of paper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 11:57:26 +02:00
haraldandClaude Opus 5.5 1643303b47 feat: view-only mode (Issue #35)
A 👁 button below the notebooks hides the tools. Pen, finger and mouse
then only scroll and zoom (the pen glides on like a finger), editing
shortcuts are ignored, Page Down no longer appends pages, and selection,
text box and ruler are closed when entering the mode.

The toolbar size estimate now includes the measured frame overhead and
can shrink buttons to 26 px, so the extra button still fits at 768 px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 09:20:34 +02:00
haraldandClaude Opus 5.5 7cf315967a docs: Dokumentation auf Englisch, deutsche Fassungen als *.de.md
CONTRIBUTING, SECURITY, docs/ARCHITECTURE und docs/FILE_FORMAT sind jetzt englisch; die
deutschen Fassungen bleiben als *.de.md erhalten und verlinken sich gegenseitig. Inhaltlich
nachgezogen: Live-Strich mit gleicher Tessellierung, runde Ecken, Nachgleiten, eingerasteter
Textmarker, Farben im Dateiformat sind sRGB. Kommentare im Flatpak-Manifest auf Englisch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 21:12:56 +02:00
haraldandClaude Opus 5.5 023991d0a3 docs: README auf Englisch, deutsche Fassung als README.de.md
GitHub und Flathub erwarten englische Texte. Das bisherige README bleibt als README.de.md
erhalten; beide verlinken sich gegenseitig. Das englische README nutzt ein englisches Banner
(assets/ink-notes-banner-en.svg, ohne veraltete Versionsnummer). Links in CONTRIBUTING.md und
SECURITY.md zeigen auf die deutschen Abschnitte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 21:09:19 +02:00