Skip to content

Conversation

@tonyespinoza1
Copy link
Contributor

@tonyespinoza1 tonyespinoza1 commented Nov 4, 2025

Summary

Fixes a bug where the Default Charm List does not update charm names when they are changed from within the charm (e.g., editing a Note's title).

Problem

When you open a Note from the Default Charm List and change its title, the title does not update in the list when you navigate back. The list continues to show the old name.

Root Cause: The UI was directly accessing charm?.[NAME] inside a .map() function, which doesn't create a reactive binding. When a charm's title changes internally, it updates that charm's [NAME] property, but since the allCharms array reference itself doesn't change, the reactive system doesn't know to re-render.

Solution

This PR implements the same reactive pattern already used in chatbot-list-view.tsx:

  1. Import lift from commontools
  2. Create a getCharmName lift function to extract charm names reactively
  3. 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 specific table row.

Changes

File: packages/patterns/default-app.tsx

  • Added lift import (line 6)
  • Added getCharmName lift function (lines 102-104)
  • Updated table rendering to use getCharmName({ charm }) instead of charm?.[NAME] (line 185)

Testing

To test this fix:

  1. Start the development server with deno task dev-local (shell) and the toolshed backend
  2. Open the Default Charm List
  3. Click "📄 Note" to create a new note
  4. Change the note's title (e.g., from "New Note" to "My Test Note")
  5. Navigate back to the Default Charm List
  6. Expected: The charm name in the list should now show "My Test Note"
  7. Before this fix: It would stay as "New Note"

References

  • Pattern established in packages/patterns/chatbot-list-view.tsx:221-223
  • Related to reactive data flow documentation in docs/common/RECIPES.md

Summary by cubic

Fixed non-reactive charm name rendering in the Default Charm List. Renaming a charm now updates its name in the list immediately.

  • Bug Fix
    • Import lift and add getCharmName to derive the name reactively.
    • Replace charm[NAME] in the table with getCharmName({ charm }).
    • Aligns with the existing pattern in chatbot-list-view.tsx.

Written for commit 28bd690. Summary will update automatically on new commits.

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: Claude <noreply@anthropic.com>
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.

No issues found across 1 file

@jsantell jsantell self-requested a review November 5, 2025 00:24
@tonyespinoza1 tonyespinoza1 merged commit 55105ce into main Nov 5, 2025
9 checks passed
@tonyespinoza1 tonyespinoza1 deleted the fix/default-charm-list-name-update branch November 5, 2025 00:25
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.

3 participants