Trim comments to the non-obvious why
Drop narration, history and restated-code comments across the repo, keep short ones for security boundaries, upstream quirks and ordering constraints, and record the convention in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package graph
|
||||
|
||||
// Hand-written helpers for box.resolvers.go. Kept out of that file because
|
||||
// gqlgen moves unknown code in a resolvers file to the end, under a warning
|
||||
// comment, on every regenerate.
|
||||
// Helpers live outside *.resolvers.go because gqlgen moves unknown code there.
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@@ -26,9 +24,7 @@ func setInt(dst *int, src *int) {
|
||||
}
|
||||
}
|
||||
|
||||
// validateBox checks the fields a box needs to render and clamps geometry
|
||||
// rather than rejecting it, because a drag that overshoots the canvas edge
|
||||
// should land at the edge, not fail.
|
||||
// validateBox clamps geometry, so an overshooting drag lands at the edge.
|
||||
func validateBox(box *models.Box) error {
|
||||
if !validPageKey(box.Page) {
|
||||
return errors.New("a box needs a valid page")
|
||||
@@ -59,9 +55,7 @@ func validateBox(box *models.Box) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// validateShadow trims a box-shadow value and bounds its length. The value is
|
||||
// not parsed: the front end sets it through a style binding, so it can only
|
||||
// ever be the one property, and an invalid value just draws no shadow.
|
||||
// validateShadow doesn't parse: a style binding confines it to one property.
|
||||
func validateShadow(shadow *string) error {
|
||||
*shadow = strings.TrimSpace(*shadow)
|
||||
if len(*shadow) > maxShadowLen {
|
||||
|
||||
Reference in New Issue
Block a user