forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on dcf123a8823bd55f0a656ce94de6b865f41dc08aFiltered to src/api/__tests__/questions/solutions.test.tsClear filter

2026-08-03

feat: 🖼️ let question and solution images be replaced or removed - add the two endpoints the API layer never covered, DELETE /questions/{id}/image and DELETE /questions/{id}/solutions/{sid}/image, and export the upload calls that were buried inside postQuestion and postSolution so an existing record can be re-imaged - editing a solution silently discarded the picked image and offered no way to drop the stored one: patchSolutionById only ever sent the body. The dialog now shows the current attachment with a remove control, and a newly picked file replaces it server-side - the question bank could attach pictures but never delete them, leaving deleteBankQuestionImage and deleteBankChoiceImage unused. The detail page gets remove controls for the question image and each choice image, behind the same owner/admin gate as every other editBurak Boduroğlu · f923bbf
feat: 🖼️ let question and solution images be replaced or removed
- add the two endpoints the API layer never covered, DELETE
  /questions/{id}/image and DELETE /questions/{id}/solutions/{sid}/image,
  and export the upload calls that were buried inside postQuestion and
  postSolution so an existing record can be re-imaged
- editing a solution silently discarded the picked image and offered no
  way to drop the stored one: patchSolutionById only ever sent the body.
  The dialog now shows the current attachment with a remove control, and
  a newly picked file replaces it server-side
- the question bank could attach pictures but never delete them, leaving
  deleteBankQuestionImage and deleteBankChoiceImage unused. The detail
  page gets remove controls for the question image and each choice
  image, behind the same owner/admin gate as every other edit

2026-07-22

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

2026-07-21

refactor: 🗃️ restructure API layer into domain folders and add vitest coverage - move 110+ flat API endpoints into domain-specific subdirectories (e.g., auth, courses, exams, notes, etc.) - add index.ts exports to each domain folder for clean namespace imports - update 70+ components and pages to use the new domain-based API import paths - add comprehensive vitest unit tests (~150 tests) for all API endpoints using fetch mocking - update AGENTS.md rulebook to mandate domain-based folder structure for future API additions - migrate existing bun:test test files in src/lib/ to vitest for consistencyBurak Boduroğlu · 6452b17
refactor: 🗃️ restructure API layer into domain folders and add vitest coverage
- move 110+ flat API endpoints into domain-specific subdirectories (e.g.,
  auth, courses, exams, notes, etc.)
- add index.ts exports to each domain folder for clean namespace imports
- update 70+ components and pages to use the new domain-based API import
  paths
- add comprehensive vitest unit tests (~150 tests) for all API endpoints
  using fetch mocking
- update AGENTS.md rulebook to mandate domain-based folder structure for
  future API additions
- migrate existing bun:test test files in src/lib/ to vitest for consistency
chore: 🧪 migrate tests from bun:test to vitestBurak Boduroğlu · b0a9db1
chore: 🧪 migrate tests from bun:test to vitest

- replace bun:test imports with vitest in all 3 test files
- add vitest.config.ts with @ alias and test config
- add vitest dev dependency and test/watch npm scripts
- create src/api/__tests__/ directory for future API tests