forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on dcf123a8823bd55f0a656ce94de6b865f41dc08aFiltered to src/components/ui/draw-canvas.tsxClear filter

2026-07-24

feat: 🖊️ tool-aware cursors on the drawing pad - canvas cursor now mirrors the active tool via a reactive cursor() - pen shows a pencil-nib glyph with the hotspot on its writing tip - eraser shows an eraser glyph, hotspot centred on the block - pan shows grab, flipping to grabbing while a drag is in progress - glyphs baked as one white-halo-under-black svg data-uri so they stay visible over any stroke colour (cursor lists can't composite two urls)Ahmet Kaan Gümüş · dc6b2a9
feat: 🖊️ tool-aware cursors on the drawing pad
- canvas cursor now mirrors the active tool via a reactive cursor()
- pen shows a pencil-nib glyph with the hotspot on its writing tip
- eraser shows an eraser glyph, hotspot centred on the block
- pan shows grab, flipping to grabbing while a drag is in progress
- glyphs baked as one white-halo-under-black svg data-uri so they stay
  visible over any stroke colour (cursor lists can't composite two urls)
chore: ⬆️ update all dependencies; migrate Tailwind v3 → v4 - bump within-range: @tanstack/solid-router 1.170.18, @kobalte/core 0.13.12, solid-js 1.9.14, tailwind-merge 3.6.0, autoprefixer/postcss/ vite-plugin-solid patches - @types/node 24 → 26 (types only) - vite 6 → 8: no config change needed; build/proxy/alias intact, vitest 4 stays compatible (246 tests green) - tailwindcss 3 → 4 via official @tailwindcss/upgrade codemod: - CSS-first config: theme moved into @theme in src/index.css, tailwind.config.js deleted, dark selector kept via @custom-variant - postcss plugin tailwindcss → @tailwindcss/postcss; autoprefixer removed (v4 built-in) - 81 files auto-migrated: shadow-sm→shadow-xs, min-w-[7.5rem]→min-w-30, /[0.08]→/8 opacity shorthand, data-[expanded]:→data-expanded: - fix codemod false-positive: it rewrote the cva variant="outline" prop string to "outline-solid" in role-badge, course-sessions-panel, my-students-page — reverted to "outline" - verified emitted CSS carries the renamed utilities (data-expanded, color-mix opacity, var(--color-*), shadow-xs)Ahmet Kaan Gümüş · b085a74
chore: ⬆️ update all dependencies; migrate Tailwind v3 → v4
- bump within-range: @tanstack/solid-router 1.170.18, @kobalte/core
  0.13.12, solid-js 1.9.14, tailwind-merge 3.6.0, autoprefixer/postcss/
  vite-plugin-solid patches
- @types/node 24 → 26 (types only)
- vite 6 → 8: no config change needed; build/proxy/alias intact,
  vitest 4 stays compatible (246 tests green)
- tailwindcss 3 → 4 via official @tailwindcss/upgrade codemod:
  - CSS-first config: theme moved into @theme in src/index.css,
    tailwind.config.js deleted, dark selector kept via @custom-variant
  - postcss plugin tailwindcss → @tailwindcss/postcss; autoprefixer
    removed (v4 built-in)
  - 81 files auto-migrated: shadow-sm→shadow-xs, min-w-[7.5rem]→min-w-30,
    /[0.08]→/8 opacity shorthand, data-[expanded]:→data-expanded:
  - fix codemod false-positive: it rewrote the cva variant="outline"
    prop string to "outline-solid" in role-badge, course-sessions-panel,
    my-students-page — reverted to "outline"
- verified emitted CSS carries the renamed utilities (data-expanded,
  color-mix opacity, var(--color-*), shadow-xs)

2026-07-22

fix: ✏️ prevent DrawCanvas from resetting strokes when drawing or updating props - guard initialScene effect in DrawCanvas with lastLoadedScene check to prevent resetting strokes mid-session - set default background ruling to grid for new drawing canvases - verify production build passes and 202/202 vitest unit tests passBurak Boduroğlu · 7e8f653
fix: ✏️ prevent DrawCanvas from resetting strokes when drawing or updating props
- guard initialScene effect in DrawCanvas with lastLoadedScene check to prevent resetting strokes mid-session
- set default background ruling to grid for new drawing canvases
- verify production build passes and 202/202 vitest unit tests pass
feat: 🎨 add drawing button to NoteForm and remove floppy disk save icon - add Add Drawing button and lazy DrawCanvas modal trigger to NoteForm for staging drawings when creating a new note - remove floppy disk icon from DrawCanvas Save button to render clean typography - verify production build and 202/202 vitest unit tests passBurak Boduroğlu · ec8cb82
feat: 🎨 add drawing button to NoteForm and remove floppy disk save icon
- add Add Drawing button and lazy DrawCanvas modal trigger to NoteForm for staging drawings when creating a new note
- remove floppy disk icon from DrawCanvas Save button to render clean typography
- verify production build and 202/202 vitest unit tests pass
feat: 🎬 draw-and-replay for question-pool photos, DPR-correct playbackAhmet Kaan Gümüş · 0fbb97c
feat: 🎬 draw-and-replay for question-pool photos, DPR-correct playback

- ask/solution forms gain a draw option alongside the existing file
  input, not instead of it: photographing a textbook problem is still
  the common case, drawing is now just another way to fill the same
  photo field
- both pool photo displays (question and solution) are now replayable
  the same way a student's answer drawing already was, via new
  getQuestionImageBlob/getSolutionImageBlob blobClient fetchers
- the img/playback toggle used to live inline in answer-sheet-view's
  AnswerDrawing; pulled out to a shared ReplayableImage (its third call
  site) so the pool views reuse it instead of a copy, and DrawingPlayback
  moved from components/exams to components/ui since it's no longer
  exam-only
- fixed a DPR mismatch in playback: an exported PNG bakes its pixel
  dimensions at the author's device-pixel-ratio, but the scene JSON only
  carried world (DPR-free) width/height, so replay on a viewer with a
  different ratio than the author rendered at half or double the
  correct size. DrawScene now carries the export's dpr, DrawCanvas
  stamps it when exporting, and a shared canvasPx() sizes both the
  export canvas and the playback canvas off the same number
- hardened parseScene's bounds: the scene JSON is recovered from a
  user-uploaded PNG's tEXt chunk and its w/h/dpr size a canvas
  allocation on the viewer's machine, so all three are now range-checked
  (0 < w,h <= 16384, 0 < dpr <= 8) instead of just type-checked
- regression tests for the bounds, canvasPx, and the new blob fetchers
feat: 🎨 infinite canvas, notebook paper, and floating draw controls - pan an unbounded pad (hand tool, middle-mouse drag, right-click erases) with world-coord strokes; export the drawn bounding box instead of the viewport so saved PNGs follow the content - view-only zoom (buttons + wheel, 0.25×–4×); exports stay at 1× - notebook backgrounds plain / ruled / squared grid, baked into the PNG under a transparent stroke layer so the eraser can't cut the lines; the choice rides in the embedded scene JSON (no backend change) - strokesBounds ignores eraser strokes so a far erase can't pad the export box; paintPaper draws the ruling (both unit-tested) - floating glass control islands: tools+size top-left, colours top-middle, paper top-right, undo/clear + zoom in the corners - pen/eraser size and paper style open as hover/tap/keyboard menus driven by an openMenu signal (closes on select, outside, Escape, leave) - transient tool highlight while middle/right button held; EN/TR i18nAhmet Kaan Gümüş · 0ae3da9
feat: 🎨 infinite canvas, notebook paper, and floating draw controls
- pan an unbounded pad (hand tool, middle-mouse drag, right-click
  erases) with world-coord strokes; export the drawn bounding box
  instead of the viewport so saved PNGs follow the content
- view-only zoom (buttons + wheel, 0.25×–4×); exports stay at 1×
- notebook backgrounds plain / ruled / squared grid, baked into the
  PNG under a transparent stroke layer so the eraser can't cut the
  lines; the choice rides in the embedded scene JSON (no backend change)
- strokesBounds ignores eraser strokes so a far erase can't pad the
  export box; paintPaper draws the ruling (both unit-tested)
- floating glass control islands: tools+size top-left, colours
  top-middle, paper top-right, undo/clear + zoom in the corners
- pen/eraser size and paper style open as hover/tap/keyboard menus
  driven by an openMenu signal (closes on select, outside, Escape, leave)
- transient tool highlight while middle/right button held; EN/TR i18n

2026-07-21

feat: 🎨 editable freehand drawings for notes and text examsAhmet Kaan Gümüş · 3758bf0
feat: 🎨 editable freehand drawings for notes and text exams

- add a canvas drawing pad (pen, eraser, 5 colors, 3 widths, undo, clear)
  that saves a PNG with its stroke JSON embedded in a tEXt chunk, so a
  saved drawing displays as a normal image and reopens for editing
- lib/png-meta embeds/extracts PNG text chunks (crc32); draw-stroke gains
  DrawScene + parseScene; drawing-file turns canvas+scene into a PNG File
  and parses stored bytes back to a scene (all pure, unit-tested)
- reopened drawings rescale to the current pad (aspect preserved); when
  editing you can clear a drawing and save the blank to erase it
- notes: draw new attachments and edit saved *.hzdraw.png ones in place
  (create-new-then-delete-old, no data loss); PNG/JPEG device export
- teacher exam questions: draw or re-edit the question illustration
- student text answers: draw the answer in the exam room, reopen to edit
  or remove; teacher sees it in the grading answer sheet
- answer-image api wrappers + question-image blob fetch, answer_image on
  AttemptAnswer/StudentAnswer, EN/TR i18n keys
- DrawCanvas is its own lazy chunk (~2.6KB gzip); main bundle unchanged