Skip to content

Commit 55105ce

Browse files
tonyespinoza1Tony Espinozaclaude
authored
fix(default-app): Make charm name updates reactive in list (#2016)
The Default Charm List was not updating charm names when they were changed from within the charm (e.g., editing a Note's title). This happened because the UI directly accessed charm[NAME] in the map function, which doesn't create a reactive binding. Changes: - Import `lift` from commontools - Add `getCharmName` lift function to extract charm names reactively - Use `getCharmName({ charm })` in the table rendering instead of direct property access This creates a proper reactive dependency so when any charm's [NAME] property changes, the UI automatically re-renders that table row. Follows the same pattern already used in chatbot-list-view.tsx. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Tony Espinoza <tonyespinoza@Tonys-MacBook-Pro.local> Co-authored-by: Claude <noreply@anthropic.com>
1 parent bcadd07 commit 55105ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/patterns/default-app.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
Cell,
44
derive,
55
handler,
6+
lift,
67
NAME,
78
navigateTo,
89
recipe,
@@ -98,6 +99,10 @@ const spawnNote = handler<void, void>((_, __) => {
9899
}));
99100
});
100101

102+
const getCharmName = lift(({ charm }: { charm: MinimalCharm }) => {
103+
return charm?.[NAME] || "Untitled Charm";
104+
});
105+
101106
export default recipe<CharmsListInput, CharmsListOutput>(
102107
"DefaultCharmList",
103108
(_) => {
@@ -177,7 +182,7 @@ export default recipe<CharmsListInput, CharmsListOutput>(
177182
<tbody>
178183
{allCharms.map((charm) => (
179184
<tr>
180-
<td>{charm?.[NAME] || "Untitled Charm"}</td>
185+
<td>{getCharmName({ charm })}</td>
181186
<td>
182187
<ct-hstack gap="2">
183188
<ct-button

0 commit comments

Comments
 (0)