Skip to content

Fix transform controls & fragment editing#833

Merged
Micheal Parks (micheal-parks) merged 6 commits into
mainfrom
transform-controls-fix
Jul 9, 2026
Merged

Fix transform controls & fragment editing#833
Micheal Parks (micheal-parks) merged 6 commits into
mainfrom
transform-controls-fix

Conversation

@micheal-parks

@micheal-parks Micheal Parks (micheal-parks) commented Jul 9, 2026

Copy link
Copy Markdown
Member

Overview

This PR fixes an issue that silently popped up during instanced rendering updates and was exposed by #821. The selected transform controls anchor themselves to Object3Ds, which no longer exist with instanced rendering. However, before the cleanup PR, ghost object3Ds were still being created via the <Frame> component that the selected transform controls could anchor to. The cleanup PR removed those and broke transform controls. This PR switches these controls over to use WorldMatrix like everything else, fixing the issue.

When fixing this, I discovered another fragment editing bug - fixed here - that recently became apparent due to vino2 config changes. Fragment tagging was incomplete in some scenarios when reading from the robot config, causing transform changes to not trigger the isDirty flag.

More details in comments.

@micheal-parks Micheal Parks (micheal-parks) changed the title Fix transform controls & Fix transform controls & fragment editing Jul 9, 2026
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e31589e

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 Patch

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 Jul 9, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-09 15:57 UTC

Comment on lines +56 to +75
const moddedComponentNames = (mods: unknown[]): string[] => {
const names: string[] = []
for (const mod of mods) {
if (!mod || typeof mod !== 'object') {
continue
}
for (const opValue of Object.values(mod as Record<string, unknown>)) {
if (!opValue || typeof opValue !== 'object') {
continue
}
for (const path of Object.keys(opValue as Record<string, unknown>)) {
const match = /^components\.([^.]+)/.exec(path)
if (match) {
names.push(match[1])
}
}
}
}
return names
}

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.

nit: code convention/style question, not related to these actual changes except they are a good example.

We oftentimes inline single-statement if conditions. Generally, I find it more readable, but I can see cases where it could make them harder to read, especially when nested inside loops like the one above.

Do we think this is more or less readable?

Suggested change
const moddedComponentNames = (mods: unknown[]): string[] => {
const names: string[] = []
for (const mod of mods) {
if (!mod || typeof mod !== 'object') {
continue
}
for (const opValue of Object.values(mod as Record<string, unknown>)) {
if (!opValue || typeof opValue !== 'object') {
continue
}
for (const path of Object.keys(opValue as Record<string, unknown>)) {
const match = /^components\.([^.]+)/.exec(path)
if (match) {
names.push(match[1])
}
}
}
}
return names
}
const moddedComponentNames = (mods: unknown[]): string[] => {
const names: string[] = []
for (const mod of mods) {
if (!mod || typeof mod !== 'object') continue
for (const opValue of Object.values(mod as Record<string, unknown>)) {
if (!opValue || typeof opValue !== 'object') continue
for (const path of Object.keys(opValue as Record<string, unknown>)) {
const match = /^components\.([^.]+)/.exec(path)
if (match) names.push(match[1])
}
}
}
return names
}

@micheal-parks Micheal Parks (micheal-parks) Jul 9, 2026

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.

I'm naturally very biased towards one statement per line, which is why a lot of my stuff gets written this way. Two statements per line seems arbitrary to me intuitively. It's sort of in the same bucket as const a = 1; const b = 2; being on the same IMO. I'm not opposed to the alternative style though if y'all feel differently, I'd just recommend we make it an auto-formatting rule rather than pointing it out in nits

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.

yeah that is why I am asking, I am wondering if we set this up as a linter/formatter thing

@micheal-parks Micheal Parks (micheal-parks) merged commit 6b481e4 into main Jul 9, 2026
11 of 12 checks passed
@micheal-parks Micheal Parks (micheal-parks) deleted the transform-controls-fix branch July 9, 2026 15:56
@claude claude Bot mentioned this pull request Jul 9, 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.

3 participants