Skip to content

Conversation

@bfollington
Copy link
Contributor

@bfollington bfollington commented Sep 30, 2025

This is a strange bug, it might imply mixing up the result and source cell somewhere? Or [ID] missing in some objects?


Summary by cubic

Fixes backlink creation and charm lookup in the code editor. Enter now creates a new backlink reliably, and charm matching handles both ID forms.

  • Bug Fixes
    • Match charms by checking IDs from both mentionableArray.get()[i] and mentionableArray.key(i].
    • When no backlink matches: use pattern-based creation if available; otherwise emit backlink-create.
    • Apply the same pattern-aware creation to the “Create new backlink” action.

This is a strange bug, it might imply mixing up the result and source cell somewhere? Or [ID] missing in some objects?
@bfollington bfollington merged commit c9c33c7 into main Sep 30, 2025
7 checks passed
@bfollington bfollington deleted the fix/2025-09-30-code-editor-enter branch September 30, 2025 04:12
Copy link
Contributor

@seefeldb seefeldb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might overmatch.

The other concerning part is that if these mentionables are all runnable charm, then they must be result cells and so always their own docs. The case where [ i ] isn't a link, but an inline object (what you get when not setting [ID] on a .set) would mean we copied the results away from the runnable stuff, possibly.

Oh, or is mentionables an object that boxes the charm reference? If so, just compare the actual charm reference!

const charmId = charmIdObj?.["/"] || "";
if (charmId === id) {
const charmIdObjA = getEntityId(mentionableArray.get()[i]);
const charmIdObjB = getEntityId(mentionableArray.key(i));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to double check, but I think that getEntityId ignores to path part, so all of these IDs will be the same irrespective of i.

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