Skip to content

Conversation

@anotherjesse
Copy link
Contributor

@anotherjesse anotherjesse commented Jul 2, 2025

Summary by cubic

Added logic to ensure charms are added to the charm manager when navigating to them in Jumble, and fixed an issue where navigating to a charm could fail or reuse cells incorrectly.

  • Bug Fixes
    • Prevented navigation to undefined charms.
    • Fixed cell sharing issues when creating multiple charms from the compiler.

we were creating the charm cells improperly (a second charm would share cells with the first due to cause naming) - additionally navigate shouldn't navigate if it returns undefined
@linear
Copy link

linear bot commented Jul 2, 2025

return this.charms;
}

private async add(newCharms: Cell<Charm>[]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsantell given your (upcoming) work on internal charm apis/functions, this should probably be considered

an action in jumble can mean "actually, you know this charm, plz remember it for me!)

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic found 2 issues across 6 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

}

runtime.navigateCallback(target);
if (target && target.get()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The check target.get() assumes that target is an object with a get method, but there is no type guard to ensure target has a get function. This could throw a runtime error if target is not the expected type.

Suggested change
if (target && target.get()) {
if (target && typeof target.get === 'function' && target.get()) {

@anotherjesse
Copy link
Contributor Author

fyi @bfollington not sure if you saw weirdness with compileAndRun. I was hitting errors trying to navigate to the second charm I generated due to issues with navigate & sharing cells...

@anotherjesse anotherjesse requested a review from seefeldb July 2, 2025 21:00
@anotherjesse anotherjesse merged commit b418ca5 into main Jul 2, 2025
7 checks passed
@anotherjesse anotherjesse deleted the navigate-add-charm branch July 2, 2025 21:04
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