fix: resolve 15 critical/high/medium issues from self-review

CRITICAL fixes:
- #14: Render source image on canvas via Konva Image + use-image hook
- #3: Wire move tool handlers (onClick, onDragEnd, onTransformEnd, draggable)
  to all CanvasObjectRenderer shapes
- #4: Implement image object rendering for fill/gradient output
- #2: Show fallback text in histogram panel when no imageData provided
- #1: Forward all args in zundo handleSet debounce wrapper

HIGH fixes:
- #5: Track raw screen cursor position for brush overlay instead of
  using canvas-space coordinates
- #6: Export dialog uses Konva stage.toDataURL via module-level ref
  instead of DOM querySelector for correct export at any zoom/pan
- #7: Add _historyVersion increment to setAdjustment, resetAdjustments,
  toggleFilter, and setFilterParam for undo tracking
- #8: Include lastAction in partialize so history labels display correctly

MEDIUM fixes:
- #10: Move useEditorShortcuts from EditorCanvas to EditorPage with
  save/export callbacks
- #11: Remove _historyVersion increment from updateObject to prevent
  brush strokes from flooding undo history
- #12: Apply Konva filters (Brighten, Contrast, HSL, Blur, Grayscale,
  Sepia, Invert, Pixelate, Emboss, Posterize, Noise, Solarize,
  Threshold, Kaleidoscope) to source image node based on store state
This commit is contained in:
SnapOtter
2026-05-07 10:00:12 +08:00
parent e11e3660d9
commit 3cc4ec87d7
6 changed files with 340 additions and 94 deletions
@@ -116,6 +116,7 @@ interface HistogramPanelProps {
imageData?: ImageData | null;
}
// Issue #2: When no imageData is provided, show a placeholder message
export function HistogramPanel({ imageData }: HistogramPanelProps) {
const canvasRef = useRef<HTMLCanvasElement>(null);
const [stats, setStats] = useState<HistogramStats | null>(null);
@@ -176,6 +177,11 @@ export function HistogramPanel({ imageData }: HistogramPanelProps) {
className="w-full rounded border border-border"
style={{ imageRendering: "pixelated" }}
/>
{!imageData && !stats && (
<p className="text-[10px] text-muted-foreground text-center py-1">
No histogram data available
</p>
)}
{stats && (
<div className="grid grid-cols-3 gap-1 text-[10px] text-muted-foreground">
<div>