# Resolved comments disappear. Bug or by design? + our Comments database set-up

**URL:** <https://community.fibery.io/t/resolved-comments-disappear-bug-or-by-design-our-comments-database-set-up/4610>\
**Category:** Get Help\
**Created:** [June 12, 2023, 6:30pm UTC](https://community.fibery.io/t/resolved-comments-disappear-bug-or-by-design-our-comments-database-set-up/4610 "2023-06-12T18:30:36Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [June 14, 2023, 7:11pm UTC](https://community.fibery.io/t/resolved-comments-disappear-bug-or-by-design-our-comments-database-set-up/4610/10 "2023-06-14T19:11:10Z")

</div>

> [@YvetteLans](#):
>
> Would it be possible to tweak the entity URL in a way so that the systems thinks it’s an ‘internal link’ and therefor opens the entity in split screen/side bar like we currently have with normal notifications? With the normal URL every entity opens in a new tab. When you have a lot of notifications to resolve, it would be awesome if we can somehow show the task in split screen.

I don’t think the URL field can be made to open a link in an adjacent panel, but I’ll note that as a feature request.

> [@YvetteLans](#):
>
> Would it be also possible to link that ULR?

If you modify the code (for the second automation script) as follows, the URL will be appended with an anchor which will take the user to the comment (or at least to the first paragraph in the comment if there are multiple).  
(note: this may not be the paragraph that contains a specific user mention)

```auto
const fibery = context.getService('fibery');

function getMentions(text) {
    const regex = /(?<=\[\[#\@[a-f0-9-]+\/)[a-f0-9-]+/g;
    const found = text.match(regex);
    return found;
}

function findAnchor(text) {
    const regex = /(?<=^<p data-guid=")[a-f0-9-]+/g
    const found = text.match(regex);
    return found;
}

for (const entity of args.currentEntities) {
    const entityWithSecret = await fibery.getEntityById(entity.type, entity.id, ['Comment secret','URL']);
    const content = await fibery.getDocumentContent(entityWithSecret['Comment secret'], 'md');
    const matches = getMentions(content);
    if (matches) {
        for (const match of matches) {
            await fibery.addCollectionItem(entity.type, entity.id, 'Mentions', match);
        }
    }
    const contenthtml = await fibery.getDocumentContent(entityWithSecret['Comment secret'], 'html');
    const anchor = findAnchor(contenthtml);
    await fibery.updateEntity(entity.type, entity.id, { 'URL': entity['URL'] + '/anchor=' + anchor });
}

```

Comment: as well as adding the anchor functionality, I added a bit of code to prevent errors which would occur if there were no @mentions in the comment.

> [@YvetteLans](#):
>
> And don’t know if it’s by design or a bug that resolved comments don’t go to the resolved tab?

~~Certainly seems like not the ideal behaviour(!)  
Will look into this.~~  
I checked, it’s a known bug

---

_[View the full topic](https://community.fibery.io/t/resolved-comments-disappear-bug-or-by-design-our-comments-database-set-up/4610)._
