Update project docs to reflect current state after post-Phase 10 polish

- PROGRESS.md: remove stale known issues (all fixed), add post-Phase 10
  feature polish section covering toolbar redesign, 4 pen sizes, line/box/move
  tools, edge swipe nav, page reorder, notebook rename, filter/sort, JPG
  export, clipboard ops, startup state restoration, and DB migrations
- PROJECT_PLAN.md: add Phase 11 (Server Sync Integration) and Phase 12
  (Notebook Backup/Export) with step breakdowns
- DESIGN.md: add Tools table, sync architecture section, backup/export design,
  JPG export, stroke styles, startup state restoration, edge swipe nav; update
  rendering strategy (3-layer compositing), source tree, schema, and pen sizes
- CLAUDE.md: update build commands, architecture, source tree, and key
  conventions to match current codebase

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 20:49:24 -07:00
parent b8fb85c5f0
commit 6e5c500786
4 changed files with 304 additions and 115 deletions

View File

@@ -23,7 +23,7 @@ See PROJECT_PLAN.md for the full step list.
- [x] 1.3: Lint configured — warningsAsErrors, AGP version check suppressed
(AGP 9.x needs Gradle 9.x)
- [x] 1.4: Room entities: Notebook, Page, Stroke, PageSize enum
- [x] 1.5: Converters: FloatArray ByteArray (packed little-endian)
- [x] 1.5: Converters: FloatArray <-> ByteArray (packed little-endian)
- [x] 1.6: DAOs: NotebookDao, PageDao, StrokeDao
- [x] 1.7: EngPadDatabase (Room, version 1)
- [x] 1.8: NotebookRepository, PageRepository
@@ -38,20 +38,20 @@ See PROJECT_PLAN.md for the full step list.
- [x] 2.3: NotebookListScreen — lazy list, create dialog (title + page size radio),
long-press delete with confirmation, empty state
- [x] 2.4: Auto-create page 1 in NotebookRepository.create()
- [x] 2.5: Navigation wired — tap notebook pages stub, editor stub
- [x] 2.5: Navigation wired — tap notebook -> pages stub, editor stub
- EngPadTheme: high-contrast light color scheme (black on white for e-ink)
### Phase 3: Canvas — Basic Drawing (2026-03-24)
- [x] 3.13.4: PadCanvasView — stylus input with historical points, Path/Paint
- [x] 3.1-3.4: PadCanvasView — stylus input with historical points, Path/Paint
stroke rendering, direct path drawing (no backing bitmap), 60pt grid
drawn in screen space with pixel-snapped positions, Matrix coordinate
transform (canonical screen)
- [x] 3.5: CanvasState — tool enum (PEN_FINE, PEN_MEDIUM, ERASER, SELECT, BOX),
zoom/pan state, pen width constants (4.49pt, 5.91pt)
transform (canonical <-> screen)
- [x] 3.5: CanvasState — tool enum (PEN, LINE, BOX, ERASER, SELECT, MOVE),
zoom/pan state, PenSize enum with 4 sizes
- [x] 3.6: EditorViewModel — loads strokes from Room, saves on completion
- [x] 3.7: EditorScreen + Toolbar — Compose wrapper with AndroidView,
FilterChip toolbar for pen size and eraser selection
icon-button toolbar with long-press menus for pen size and line style
- [x] 3.8: NavGraph updated — pages route auto-navigates to first page's editor,
page size passed through route params
- Used KTX Canvas extensions (withMatrix, withScale, createBitmap) per lint
@@ -59,7 +59,7 @@ See PROJECT_PLAN.md for the full step list.
### Phase 4: Zoom and Pan (2026-03-24)
- [x] 4.1: ScaleGestureDetector with focal-point zoom (dynamic min4×)
- [x] 4.1: ScaleGestureDetector with focal-point zoom (dynamic min-4x)
- [x] 4.2: Finger drag for pan with multi-pointer tracking, pan clamped
so page always fills viewport
- [x] 4.3: Input routing by tool type already in place from Phase 3
@@ -69,7 +69,7 @@ See PROJECT_PLAN.md for the full step list.
### Phase 5: Eraser (2026-03-24)
- [x] 5.15.3: Stroke-level eraser with bounding box hit test (42pt radius),
- [x] 5.1-5.3: Stroke-level eraser with bounding box hit test (42pt radius),
processes historical touch points for thorough erasing, deletes from
view + Room DB
@@ -84,7 +84,7 @@ See PROJECT_PLAN.md for the full step list.
### Phase 7: Selection — Move, Copy, Delete (2026-03-24)
- [x] 7.17.2: Rectangle selection with dashed rect and blue highlight
- [x] 7.1-7.2: Rectangle selection with dashed rect and blue highlight
- [x] 7.3: Delete, drag-to-move, copy operations with toolbar buttons
- [x] 7.4: Full undo integration — DeleteMultipleStrokesAction, MoveStrokesAction,
CopyStrokesAction
@@ -100,7 +100,7 @@ See PROJECT_PLAN.md for the full step list.
### Phase 9: PDF Export (2026-03-24)
- [x] 9.1: PdfExporter — creates PdfDocument, scales canonical 300 DPI coords
to 72 DPI PDF points (×0.24), renders strokes without grid
to 72 DPI PDF points (x0.24), renders strokes without grid
- [x] 9.2: Share via Intent.ACTION_SEND + FileProvider (configured in Phase 1)
- [x] 9.3: PDF button in editor toolbar, exports current page
@@ -120,8 +120,9 @@ Tested on DC-1, identified and fixed rendering issues:
sub-pixel positioning when scaled. Fixed by drawing grid in screen space
with pixel-snapped line positions. Now uniform squares.
- **Stroke quality**: original backing bitmap at 1/4 resolution caused blurry
strokes. Fixed by removing backing bitmap entirely and drawing paths directly.
Anti-aliasing disabled on all paint for crisp e-ink lines.
strokes. Fixed by switching to a screen-resolution backing bitmap with
incremental stroke addition. Anti-aliasing disabled on all paint for
crisp e-ink lines.
- **Viewport**: dark gray background was visible around page edges. Fixed by
clamping pan to page edges, computing dynamic min zoom, and white background.
- **Box tool**: works correctly on device.
@@ -143,11 +144,55 @@ Critical/high-priority fixes applied:
fall back to first page instead of showing blank canvas.
- **Arrow head Paint allocation**: preallocated reusable Paint object
instead of allocating per drawArrowHeads() call.
- **CopyStrokesAction**: fixed `takeLast(n)` fragile ID lookup — now
tracks copied stroke IDs directly.
- **Grid caching**: grid bitmap is now cached and only redrawn on
zoom/pan/resize changes.
Known issues still to address:
- CopyStrokesAction uses `takeLast(n)` to find new stroke IDs — fragile
- No mutex guarding concurrent page navigation + paste operations
- Grid redrawn every frame (could be cached)
### Post-Phase 10: Feature Polish (2026-03-24)
Extensive feature work after the initial 10-phase plan:
- **Toolbar redesign**: replaced FilterChip toolbar with icon-button toolbar.
Custom Canvas-drawn icons for each tool (pen dot, line, box outline,
eraser, dashed-rect select, four-way-arrow move, curved undo/redo arrows).
- **Pen size consolidation**: expanded from 2 sizes to 4 sizes (0.38mm,
0.5mm, 0.6mm, 0.7mm). Single PEN tool with long-press for size selection
dropdown; remembers last size.
- **Line tool**: dedicated LINE tool (separate from PEN) with style variants
via long-press menu: plain, arrow, double-arrow, dashed. Line style stored
in stroke `style` column in DB.
- **Box tool**: draws rectangles corner-to-corner. Uses current pen size
and style.
- **Move tool**: dedicated MOVE tool for tap-and-drag stroke relocation
(separate from select-then-drag).
- **Edge swipe navigation**: finger swipe from left/right screen edge
navigates to previous/next page. Auto-creates new page on forward swipe
past last page (if current page has strokes). Edge zone = 8% of screen
width, minimum 100px horizontal distance.
- **Page list drag-to-reorder**: long-press drag in PageListScreen to
reorder pages. Uses `longPressDraggableHandle` with reorderable lazy
column. Page numbers renumbered sequentially on drop.
- **Notebook rename**: long-press notebook in library list to rename.
Rename dialog with text field.
- **Library filter/sort**: search field to filter notebooks by title,
sort by last-edited or title (ascending/descending).
- **JPG export**: single-page JPEG export at 300 DPI via Export dropdown
menu. Uses `Bitmap.compress(JPEG, 95)`, shared via FileProvider + intents.
- **Clipboard operations**: cut, copy, paste toolbar buttons appear when
strokes are selected or clipboard is non-empty. Cut = copy + delete.
- **Startup state restoration**: SharedPreferences in EngPadApp store last
opened notebook ID and view-all-pages flag. On launch, auto-navigates to
last notebook (or page list if that was the last screen).
- **Page navigation from editor**: binder button in toolbar shows
"p1/5"-style page indicator with dropdown for "View all pages" and
"Go to page..." dialog.
- **Last page tracking**: Notebook entity has `lastPageId` column; editor
resumes at last-visited page when reopening a notebook.
- **Page delete**: delete pages from PageListScreen with sequential
renumbering of remaining pages.
- **Database migrations**: schema at version 3 (added `style` column to
strokes, `last_page_id` to notebooks).
## Backup Design (Not Yet Implemented)
@@ -168,11 +213,12 @@ portable or human-readable).
## Status
All implementation phases complete. Remaining work:
All implementation phases complete. Post-phase polish significantly extended
the feature set beyond the original plan. Remaining work:
- Test on Supernote Manta
- Verify line snap behavior on device
- Performance profiling with heavily annotated pages
- Implement notebook backup/restore
- Implement notebook backup/restore (zip format)
- Server sync integration (eng-pad-server, gRPC, manual sync)
## Decisions & Deviations
@@ -183,3 +229,11 @@ All implementation phases complete. Remaining work:
- **Coordinate system**: 300 DPI canonical points (scaled to 72 DPI for PDF export).
- **UI framework**: Compose for chrome, custom View for canvas (Compose
Canvas lacks MotionEvent access needed for stylus input).
- **Toolbar**: Icon buttons with Canvas-drawn icons (no drawable resources needed
for tool icons). Long-press for sub-menus (pen size, line style).
- **Rendering**: Screen-resolution backing bitmap with incremental stroke
addition + cached grid bitmap. Both invalidated on zoom/pan/resize.
- **Line styles**: Stored as string in stroke `style` DB column (plain, dashed,
arrow, double_arrow) rather than a separate table.
- **State restoration**: SharedPreferences for last notebook/page rather than
Compose SavedStateHandle (survives process death).