Configurable grid + snap-to-grid in the layout system (#45)
Build image / build-and-push (push) Successful in 7s

Closes #44. Two independent grids (garden + per-bed), each with a size and a snap toggle; snapping defaults off. See PR #45 for details.

Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #45.
This commit is contained in:
2026-07-19 07:07:14 +00:00
committed by steve
parent 9968c06243
commit e74fb308c1
23 changed files with 581 additions and 88 deletions
+22 -14
View File
@@ -120,16 +120,20 @@ type Session struct {
// Garden is a planning surface owned by one user, at real-world scale (cm).
type Garden struct {
ID int64 `json:"id"`
OwnerID int64 `json:"ownerId"`
Name string `json:"name"`
WidthCM float64 `json:"widthCm"`
HeightCM float64 `json:"heightCm"`
UnitPref string `json:"unitPref"`
Notes string `json:"notes"`
Version int64 `json:"version"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
ID int64 `json:"id"`
OwnerID int64 `json:"ownerId"`
Name string `json:"name"`
WidthCM float64 `json:"widthCm"`
HeightCM float64 `json:"heightCm"`
UnitPref string `json:"unitPref"`
Notes string `json:"notes"`
// GridSizeCM is the garden-scale grid spacing (cm) the editor draws its grid
// from; SnapToGrid, when true, snaps objects to that grid on place/move/resize.
GridSizeCM float64 `json:"gridSizeCm"`
SnapToGrid bool `json:"snapToGrid"`
Version int64 `json:"version"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
// MyRole is the requesting actor's effective role on this garden ("owner",
// "editor", or "viewer"). Computed by the service, never persisted.
@@ -174,10 +178,14 @@ type GardenObject struct {
Plantable bool `json:"plantable"`
Color *string `json:"color,omitempty"`
Props *string `json:"props,omitempty"` // kind-specific JSON
Notes string `json:"notes"`
Version int64 `json:"version"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
// GridSizeCM is this object's local grid spacing (cm); when SnapToGrid is true
// and the object is a plantable bed, plants snap to it inside the bed.
GridSizeCM float64 `json:"gridSizeCm"`
SnapToGrid bool `json:"snapToGrid"`
Notes string `json:"notes"`
Version int64 `json:"version"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
// Plant is a catalog entry. OwnerID nil means a read-only seeded built-in.