-
Notifications
You must be signed in to change notification settings - Fork 9
fix: charm reload on charm-list change #1040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
jumble/src/components/CharmRunner.tsx:132
- Verify that casting to 'Cell' aligns with the expected type for the render function, ensuring consistency with the updated type declarations in use.
const cleanup = render(container, charm.asSchema(charmSchema).key(UI) as Cell<VNode>);
|
|
||
| // Store a reference to the current charm to detect changes | ||
| const prevCharmRef = useRef(charm); | ||
| const prevCharmRef = useRef<Charm | null>(null); |
Copilot
AI
Apr 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initializing prevCharmRef to null means the runtime error state will reset on the initial render; if preserving the initial charm state is required, consider initializing with the current charm value.
| const prevCharmRef = useRef<Charm | null>(null); | |
| const prevCharmRef = useRef<Charm | null>(charm); |
bfollington
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
LGTM |
Fixes https://linear.app/common-tools/issue/CT-160/unexpected-refresh-on-charmsspaces-across-tabs by using charmId to track whether to re-render chram view or not.