Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relations for memos which connected through REFERENCED_CONTENT or EMBEDDED_CONTENT node #4220

Open
chriscurrycc opened this issue Dec 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@chriscurrycc
Copy link

Describe the solution you'd like

It would be great to have relations between memos linked through the REFERENCED_CONTENT or EMBEDDED_CONTENT node.

I can link the memos through embed (block style by default, can switch to inline style) or reference (default method). However, the relations are only added when using the latter method. I believe relations should be incorporated into all methods.

Type of feature

API

Additional context

Here is one of my demo memo that you can have a check:

{
    "name": "memos/15",
    "uid": "5v2j9DmUS97aeApnBRehaG",
    "rowStatus": "ACTIVE",
    "creator": "users/1",
    "createTime": "2024-12-21T13:27:01Z",
    "updateTime": "2024-12-21T15:11:13Z",
    "displayTime": "2024-12-21T13:27:01Z",
    "content": "This is an inline embedding [[memos/EEPa5S3nv5F7e93kQVSMep]]\n\nThis is a block embedding:\n![[memos/EEPa5S3nv5F7e93kQVSMep]]\n\nThere is also a reference footer.",
    "nodes": [
        {
            "type": "PARAGRAPH",
            "paragraphNode": {
                "children": [
                    {
                        "type": "TEXT",
                        "textNode": {
                            "content": "This is an inline embedding "
                        }
                    },
                    {
                        "type": "REFERENCED_CONTENT",
                        "referencedContentNode": {
                            "resourceName": "memos/EEPa5S3nv5F7e93kQVSMep",
                            "params": ""
                        }
                    }
                ]
            }
        },
        {
            "type": "LINE_BREAK",
            "lineBreakNode": {}
        },
        {
            "type": "LINE_BREAK",
            "lineBreakNode": {}
        },
        {
            "type": "PARAGRAPH",
            "paragraphNode": {
                "children": [
                    {
                        "type": "TEXT",
                        "textNode": {
                            "content": "This is a block embedding:"
                        }
                    }
                ]
            }
        },
        {
            "type": "LINE_BREAK",
            "lineBreakNode": {}
        },
        {
            "type": "EMBEDDED_CONTENT",
            "embeddedContentNode": {
                "resourceName": "memos/EEPa5S3nv5F7e93kQVSMep",
                "params": ""
            }
        },
        {
            "type": "LINE_BREAK",
            "lineBreakNode": {}
        },
        {
            "type": "LINE_BREAK",
            "lineBreakNode": {}
        },
        {
            "type": "PARAGRAPH",
            "paragraphNode": {
                "children": [
                    {
                        "type": "TEXT",
                        "textNode": {
                            "content": "There is also a reference footer."
                        }
                    }
                ]
            }
        }
    ],
    "visibility": "PRIVATE",
    "tags": [],
    "pinned": false,
    "resources": [],
    "relations": [
        {
            "memo": {
                "name": "memos/15",
                "uid": "5v2j9DmUS97aeApnBRehaG",
                "snippet": "This is an inline embedding \n\nThis is a block embedding:\n\nThere ..."
            },
            "relatedMemo": {
                "name": "memos/12",
                "uid": "mN5e5xNRRhE2ApNkFRidUQ",
                "snippet": "This is a memo.\n"
            },
            "type": "REFERENCE"
        },
        {
            "memo": {
                "name": "memos/16",
                "uid": "jr4MFRpEjonTXZi6dWYwXL",
                "snippet": "comment test.\n"
            },
            "relatedMemo": {
                "name": "memos/15",
                "uid": "5v2j9DmUS97aeApnBRehaG",
                "snippet": "This is an inline embedding \n\nThis is a block embedding:\n\nThere ..."
            },
            "type": "COMMENT"
        }
    ],
    "reactions": [],
    "property": {
        "tags": [],
        "hasLink": false,
        "hasTaskList": false,
        "hasCode": false,
        "hasIncompleteTasks": false
    },
    "snippet": "This is an inline embedding \n\nThis is a block embedding:\n\nThere ..."
}
@chriscurrycc chriscurrycc added the enhancement New feature or request label Dec 21, 2024
@chriscurrycc
Copy link
Author

The API document defines three types of relation: TYPE_UNSPECIFIED, REFERENCE, and COMMENT. Consider adding REFERENCED_CONTENT and EMBEDDED_CONTENT (or choose a better name) for clearer distinction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant