Skip to content

Conversation

@DTCurrie DTCurrie self-assigned this Dec 19, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

⚠️ No Changeset found

Latest commit: 8fac6fa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

}
}

const rgbaToHex = (rgba: Uint8Array): string => {
Copy link
Member

Choose a reason for hiding this comment

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

opt: some of these functions seem more common than just for snapshot (e.x. rgbaToHex, destroyEntities, getRenderArmModels, maybe we could split them out into separate util ts (can do as follow up)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I could see them being used elsewhere. Happy to split them out into separate units now or we can hold off when we want to use them elsewhere. I'm good with whatever folks prefer.

}
}

const rgbaToHex = (rgba: Uint8Array): string => {
Copy link
Member

Choose a reason for hiding this comment

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

nit rgbToHex? since you don't use the alpha

for (const entity of subEntities) {
entities.push(world.spawn(...entity))
}
return entities
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we also spawn the parent entity and add return it in the if part of this clause too? so it returns the sub entities AND the entityTraits

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question, I actually had that originally then went to this. The issue is, the parent entity doesn't really have anything to render, since really what we are rendering are its individual assets. So I guess the question is, do we care to add a non-rendering entity that we tie to all of the sub entities, or do we just care about the rendering sub-entities.

I am not 100% sure, so definitely would like feedback on this.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should, it still has a pose and parent so we should render it as an axis like we do for the arm frames

Copy link
Collaborator

Choose a reason for hiding this comment

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

done

Base automatically changed from snapshot-component_add-traits to main December 22, 2025 18:25
@codecov
Copy link

codecov bot commented Dec 22, 2025

const entities = spawnSnapshotEntities(world, snapshot)

expect(entities).toHaveLength(1)
expect(world.query()).toHaveLength(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Simplified these tests and used koota itself instead of mocks. Since koota is mostly imperative it's very straightforward to make predictable tests that peek into what we want to know without having to mock it

@micheal-parks micheal-parks merged commit e1e1719 into main Dec 29, 2025
4 checks passed
@micheal-parks micheal-parks deleted the snapshot-component_add-snapshot-utils branch December 29, 2025 17:55
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.

4 participants