Skip to content

App 16362 update snapshot api to v2 style inputs returns#801

Merged
Marcus (sucrammal) merged 12 commits into
mainfrom
APP-16362-Update-Snapshot-API-to-v2-style-inputs-returns
Jul 2, 2026
Merged

App 16362 update snapshot api to v2 style inputs returns#801
Marcus (sucrammal) merged 12 commits into
mainfrom
APP-16362-Update-Snapshot-API-to-v2-style-inputs-returns

Conversation

@sucrammal

@sucrammal Marcus (sucrammal) commented Jun 30, 2026

Copy link
Copy Markdown
Member

Changes

  • draw/snapshot.go: Replaces positional-arg signatures on DrawGeometry, DrawFrame, DrawFrameSystemGeometries, DrawArrows, DrawLine, DrawModel, DrawPoints with DrawXxxOptions structs returning ([]byte, error) / ([][]byte, error); adds DrawNurbs, DrawPointCloud, DrawGeometriesInFrame, DrawFrames, DrawWorldState; adds snapshotDrawableOpts helper to consolidate UUID/parent/pose/attrs wiring across all methods; appends all 12 options structs to the same file following existing draw/ conventions

Tests:

  • Updates all snapshot_test.go call sites to DrawXxxOptions structs; updates docs/examples/snapshot/main.go fixture

Links

Docs:

  • Adds draw.Snapshot: static scene builder section to migration/v1-to-v2.mdx with quick-reference table and before/after examples; fixes stale v1 call in guides/embedding.mdx and draw/doc.go; regenerates docs/src/content/docs/api/draw.md via pnpm --dir docs gen:api
  • static/visualization_snapshot.json: Regenerated from updated example

@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d1cad73

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@viamrobotics/motion-tools Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-02 21:46 UTC

@mattmacf98

Copy link
Copy Markdown
Member

code Looks good! just confirm the dotColors is not a regression by making sure the main would generate the same snapshot

and can you run these e2e tests to sanity check https://github.com/viamrobotics/visualization/blob/main/e2e/snapshot.test.ts

Comment thread static/visualization_snapshot.json Outdated
"lineWidth": 8,
"dotSize": 10,
"dotColors": "AACL"
"dotColors": "/6UA"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this different now?

Base64 Hex Bytes RGB Color
AACL 00 00 8B (0, 0, 139) Dark Blue
/6UA FF A5 00 (255, 165, 0) Orange

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Found the bug. Updated e2e tests by running in main, brought the new standard screenshots into this branch, ran again with fixes, and all tests pass as normal, with color reverted.

Updated snapshot e2e test screenshots from main, reran with all 9 passing. Color reverted as expected.
@sucrammal Marcus (sucrammal) merged commit ed62728 into main Jul 2, 2026
9 checks passed
@sucrammal Marcus (sucrammal) deleted the APP-16362-Update-Snapshot-API-to-v2-style-inputs-returns branch July 2, 2026 21:45
@claude claude Bot mentioned this pull request Jul 2, 2026
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.

2 participants