Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Also verify affected components, multi-monitor/DPI-sensitive geometry, loading,
## Tech stack

- Workspace: pnpm 11.14.0, TypeScript, strict mode
- Desktop: Tauri 2.11, Rust 2024, React 19, Vite 8, Tailwind CSS 4, Zod 4, webview2-com 0.38.2 + windows-core 0.61 (camera permission only, pinned to versions already in the tree)
- Desktop: Tauri 2.11, Rust 2024, React 19, Vite 8, Tailwind CSS 4, Zod 4, Rough.js 4.6 (generator only, for sketchy strokes), webview2-com 0.38.2 + windows-core 0.61 (camera permission only, pinned to versions already in the tree)
- Landing page: Next.js 16.2 App Router, React 19, TypeScript 5, Tailwind CSS 4, Framer Motion 12
- Tooling: ESLint 9, Vitest 4, Testing Library, Cargo
- Targets: Windows 11 supported; macOS, Ubuntu, and Fedora provisional
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG-PUBLIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

User-facing changes only, grouped by date under Added / Improved / Fixed.

## Unreleased

### Added

- Your own keys for toolbar tools: Settings → Toolbar → Tool keys. Smart select now comes first by default for new installs.
- Sketch level (Neat, Loose, Wild) for the Sketchy line style, and hand-drawn fills (hatching, cross-hatch, zigzag, dots) for rectangles and ellipses. Set your defaults in Settings.
- Smart select (W): hover to see an outline around the button, card or image under your pointer, then click to box it. Alt+click draws an ellipse instead; drag to draw a box yourself.
- Line styles: solid, dashed, dotted or sketchy (hand-drawn) for shapes, lines and arrows, in Capture and Screen Draw. Set your default in Settings.
- Rounded corners for rectangles, with a Corners slider and a default in Settings.
- Press any shape with a drawing tool to select and move it, without switching to the cursor. Hold Alt to draw on top of it instead. Escape deselects before it closes the capture.

### Improved

- Changing colour, size, line style, fill, corners or font now updates the shape you have selected. Smart select's outline is solid and glides from one element to the next.
- Text appears on the first click, shows a faint "Type something" hint, and clicking away leaves no empty box. Shift+Enter adds a new line, and it matches in the saved image.

## 0.5.1 — 2026-11-20

### Fixed
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react-konva": "^19.2.5",
"roughjs": "^4.6.6",
"zod": "^4.4.3"
},
"devDependencies": {
Expand Down
90 changes: 90 additions & 0 deletions apps/desktop/src-tauri/src/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,86 @@ pub struct AnnotationScene {
pub elements: Vec<Annotation>,
}

/// Pre-computed outline of a styled (dashed, dotted, sketchy) or rounded shape. The frontend owns the
/// geometry so the canvas, Screen Draw and this exporter draw identical points.
#[derive(Debug, Clone, Default, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StrokeGeometry {
/// Polylines to stroke at the annotation's stroke width.
#[serde(default)]
pub strokes: Vec<Vec<Point>>,
/// Dot centres; each is stamped as a disc as wide as the stroke.
#[serde(default)]
pub dots: Vec<Point>,
/// Closed polygon to fill with the annotation's fill colour.
#[serde(default)]
pub fill: Option<Vec<Point>>,
/// Hand-drawn pattern fill (hatching, zigzag) polylines, drawn under the outline at half weight.
#[serde(default)]
pub fill_strokes: Vec<Vec<Point>>,
/// Dot-pattern fill centres, drawn under the outline.
#[serde(default)]
pub fill_dots: Vec<Point>,
}

/// Upper bound on geometry points in one scene, so a hostile or buggy request cannot exhaust memory.
pub const MAX_SCENE_GEOMETRY_POINTS: usize = 200_000;

impl StrokeGeometry {
pub fn point_count(&self) -> usize {
self.strokes.iter().map(Vec::len).sum::<usize>()
+ self.dots.len()
+ self.fill_strokes.iter().map(Vec::len).sum::<usize>()
+ self.fill_dots.len()
+ self.fill.as_ref().map_or(0, Vec::len)
}

/// Rejects non-finite coordinates and degenerate strokes.
pub fn validate(&self) -> Result<(), String> {
let finite = |point: &Point| point.x.is_finite() && point.y.is_finite();
if self
.strokes
.iter()
.chain(self.fill_strokes.iter())
.any(|stroke| stroke.len() < 2)
{
return Err("A stroke needs at least two points".into());
}
let all_finite = self.strokes.iter().flatten().all(finite)
&& self.dots.iter().all(finite)
&& self.fill_strokes.iter().flatten().all(finite)
&& self.fill_dots.iter().all(finite)
&& self.fill.iter().flatten().all(finite);
if !all_finite {
return Err("Stroke geometry contains a non-finite coordinate".into());
}
Ok(())
}
}

impl Annotation {
pub fn stroke_geometry(&self) -> Option<&StrokeGeometry> {
match self {
Self::Line {
stroke_geometry, ..
}
| Self::Arrow {
stroke_geometry, ..
}
| Self::CurvedArrow {
stroke_geometry, ..
}
| Self::Rectangle {
stroke_geometry, ..
}
| Self::Ellipse {
stroke_geometry, ..
} => stroke_geometry.as_ref(),
_ => None,
}
}
}

#[derive(Debug, Clone, Deserialize)]
#[serde(tag = "kind", rename_all = "kebab-case")]
// Scene fields remain explicit for versioned IPC fidelity even when a renderer does not yet use
Expand All @@ -72,6 +152,8 @@ pub enum Annotation {
color: String,
#[serde(rename = "strokeWidth")]
stroke_width: f32,
#[serde(default, rename = "strokeGeometry")]
stroke_geometry: Option<StrokeGeometry>,
},
Arrow {
id: String,
Expand All @@ -80,6 +162,8 @@ pub enum Annotation {
color: String,
#[serde(rename = "strokeWidth")]
stroke_width: f32,
#[serde(default, rename = "strokeGeometry")]
stroke_geometry: Option<StrokeGeometry>,
},
CurvedArrow {
id: String,
Expand All @@ -88,6 +172,8 @@ pub enum Annotation {
color: String,
#[serde(rename = "strokeWidth")]
stroke_width: f32,
#[serde(default, rename = "strokeGeometry")]
stroke_geometry: Option<StrokeGeometry>,
},
Highlighter {
id: String,
Expand All @@ -113,6 +199,8 @@ pub enum Annotation {
fill: String,
#[serde(rename = "strokeWidth")]
stroke_width: f32,
#[serde(default, rename = "strokeGeometry")]
stroke_geometry: Option<StrokeGeometry>,
},
Ellipse {
id: String,
Expand All @@ -122,6 +210,8 @@ pub enum Annotation {
fill: String,
#[serde(rename = "strokeWidth")]
stroke_width: f32,
#[serde(default, rename = "strokeGeometry")]
stroke_geometry: Option<StrokeGeometry>,
},
Spotlight {
id: String,
Expand Down
Loading
Loading