Skip to content

Implement hs.canvas - #209

Merged
cmsj merged 7 commits into
mainfrom
hs.canvas
Sep 7, 2026
Merged

cmsj merged 7 commits into
mainfrom
hs.canvas

Conversation

@cmsj

@cmsj cmsj commented Sep 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

@cmsj cmsj self-assigned this Sep 7, 2026
@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Implements the hs.canvas module, including canvas window lifecycle, element rendering, transforms, mouse interaction, drag-and-drop, image export, duplication, and module registration.

  • Fixes shutdown cleanup by iterating over a snapshot of active canvases.
  • Preserves the visual top-left corner during resizing.
  • Aligns transformed bounds and hit testing with rendered geometry.
  • Adds whole-canvas and element enter/exit event handling.
  • Applies action, compositing, and transform behavior to special element types.
  • Makes visual test artifacts portable by writing them to the system temporary directory.

Confidence Score: 5/5

The PR appears safe to merge with no outstanding actionable findings.

No new correctness or repository-rule violations remain. The six previous findings covering shutdown mutation, resize positioning, transformed hit testing, enter/exit delivery, special-element rendering, and developer-specific test paths were manually resolved without explanatory replies.

Important Files Changed

Filename Overview
Hammerspoon 2/Modules/hs.canvas/Core/HSCanvas.swift Defines the canvas API and lifecycle while correcting resize and transformed-bounds behavior.
Hammerspoon 2/Modules/hs.canvas/Elements/CanvasElementDrawing.swift Implements element geometry and rendering, including unified action, compositing, and transform handling.
Hammerspoon 2/Modules/hs.canvas/Views/HSCanvasRenderView.swift Renders transformed canvases and dispatches element and whole-canvas mouse events.
Hammerspoon 2/Modules/hs.canvas/HSCanvasModule.swift Exposes canvas constants and creation while safely destroying active canvases during shutdown.
Hammerspoon 2Tests/IntegrationTests/HSCanvasElementDrawingTests.swift Adds regression coverage for transformed hit testing and enter/exit transitions.
Hammerspoon 2Tests/IntegrationTests/HSCanvasIntegrationTests.swift Adds regression coverage for top-left-preserving resize, transformed bounds, and multi-canvas shutdown.
Hammerspoon 2Tests/IntegrationTests/HSCanvasM5VisualAcceptanceTests.swift Adds visual checks for special-element actions, compositing, and transforms while using portable artifact paths.

Reviews (2): Last reviewed commit: "Write canvas image tests into a sensible..." | Re-trigger Greptile

Comment thread Hammerspoon 2/Modules/hs.canvas/HSCanvasModule.swift Outdated
Comment thread Hammerspoon 2/Modules/hs.canvas/Core/HSCanvas.swift
Comment thread Hammerspoon 2/Modules/hs.canvas/Views/HSCanvasRenderView.swift
Comment thread Hammerspoon 2/Modules/hs.canvas/Views/HSCanvasRenderView.swift
Comment thread Hammerspoon 2/Modules/hs.canvas/Elements/CanvasElementDrawing.swift
Comment thread Hammerspoon 2Tests/IntegrationTests/HSCanvasM5VisualAcceptanceTests.swift Outdated
@cmsj

cmsj commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

@greptile

@cmsj
cmsj merged commit 099d184 into main Sep 7, 2026
4 checks passed
@cmsj
cmsj deleted the hs.canvas branch September 7, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant