Skip to content

Conversation

@ubik2
Copy link
Contributor

@ubik2 ubik2 commented Oct 2, 2025

Summary by cubic

Refactored ct-code-editor to use normalized links and raw data for charm mentions, replacing getEntityId-based lookups. This fixes incorrect IDs in completions and backlinks and makes mention storage and resolution more reliable.

  • Refactors

    • Switched to parseLink and getRaw for mentionable arrays and charm links.
    • Treat IDs as URIs without the "of:" prefix for editor UI and logic.
    • Used rt.getCellFromLink for ALL_CHARMS instead of getCellFromEntityId.
    • Updated completions and mention extraction to work with { id, item } pairs.
    • Compared mentioned charms by URI sets to avoid unnecessary writes.
  • Bug Fixes

    • Correctly match charms by link ID, avoiding array ID confusion.
    • Backlink insertion now uses the charm ID from sourceURI.
    • Prevent stale or duplicate mention updates with set comparison.

@linear
Copy link

linear bot commented Oct 2, 2025

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.

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/ui/src/v2/components/ct-code-editor/ct-code-editor.ts">

<violation number="1" location="packages/ui/src/v2/components/ct-code-editor/ct-code-editor.ts:950">
JavaScript `Set` has no `symmetricDifference` method, so this line throws at runtime and prevents mentioned charms from updating correctly.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.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

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.

1 participant