Fix Svelte reactivity edge cases and panel state handling#22
Conversation
|
I found another issue so I will fix it and then reopen this PR |
|
False alarm. It wasn't working correctly in my project and it was driving me nuts, but eventually I figured out I was importing an older version. 🤦♂️ The latest changes (in this PR) are working just fine, and moreover I've confirmed that they are necessary to have DialKit work reliably in Svelte. |
|
@banjerluke I did a big refactor today and merged all other open PRs. Would you mind taking a look at the issues that were causing this (after updating to latest version), and then if still present, update this PR after rebasing? Thank you! |
|
Sorry, took me a minute to get around to checking this and updating the branch, but I opened a new PR at #34 with the fixes (still necessary) and I did a quick test in my app with it too. |
I ran into a reactivity issue when using the Svelte integration in my project. I am a bit confused as to why this slipped through, since I tested things manually before submitting the first PR and I think I would've caught this bug... oh well, should be fixed now.
In fixing this (with Opus 4.6 and GPT 5.4) I also uncovered a couple minor issues that I also fixed in the Svelte integration.
Changes:
DialKitValuesfromcreateDialKitso property reads stay reactive after$statereassignment (major issue).currentsnapshot property fromDialKitValues(dead code removal)bind:thisrefs to$state<... | null>(null)so they match Svelte 5’s runtime shape and stop relying on non-reactive element locals