There are 4 updates, 1 comment.
 
 
Cristal / cid:jira-generated-image-avatar-7c901edd-87f2-4c42-8a74-72702a215ceb CRISTAL-620 Reopened

Attachment suggestion does not show entities context with BlockNote & NextCloud

 
View issue   ·   Add comment
 

4 updates

 
cid:jira-generated-image-avatar-c89800a9-0db0-4097-a876-fe88974f7cd4 Changes by Marius Dumitru Florea on 21/Oct/25 13:01
 
Fix Version: 0.24
Fix Version: 0.23
Resolution: Fixed
Status: Closed Reopened
 
 

1 comment

 
cid:jira-generated-image-avatar-c89800a9-0db0-4097-a876-fe88974f7cd4 Marius Dumitru Florea on 21/Oct/25 13:01
 

The proposed changes are breaking some tests:

AssertionError: expected AttachmentReference{ type: 3, …(3) } to deeply equal AttachmentReference{ type: 3, …(3) }

- Expected
+ Received

@@ -1,11 +1,13 @@
  AttachmentReference {
    "_metadata": {},
    "document": DocumentReference {
      "name": "a.x",
      "space": SpaceReference {
-       "names": [],
+       "names": [
+         "a.x",
+       ],
        "type": 1,
        "wiki": undefined,
      },
      "terminal": false,
      "type": 2,

 ❯ src/__tests__/nextcloudModelReferenceParser.test.ts:48:29

Moreover, both Pierre Jeanjean and I think the proposed changes are not the right fix. If the input is space/document/attachments/image.png then you get 4 segments, where the space names are slice(0, 1) (the end index is not included). With the applied fix, the document name is included in the space names.

Pierre Jeanjean found this line that is related https://github.com/xwiki-contrib/cristal/blob/main/editors/blocknote-react/src/components/images/ImageSelector.tsx#L147 . It removes the document name from the displayed segments if the target document is not terminal, which is probably the default for Nextcloud references. The purpose of this IF is to avoid showing the technical "WebHome" page name, but this is specific to XWiki, so in the end we may need to have a back-end specific implementation for getting the list of reference segments to display.