Skip to content

feat(ew): comments - #1073

Open
usman-khalid wants to merge 5 commits into
mainfrom
comments
Open

feat(ew): comments#1073
usman-khalid wants to merge 5 commits into
mainfrom
comments

Conversation

@usman-khalid

@usman-khalid usman-khalid commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

To be merged with adobe/da-nx#562

Summary

Collaborative comments for Experience Workspace.

Users can select text, an image or a table (block) and attach a comment. Each comment is stored as a .json file in .da/comments/{docId}/{commentId}.json

When a selection is made, a comment icon is also added to the toolbar in EW to initiate a thread.

Supports replies/threads, resolve/unresolve & orphan threads (user comments on something, the content is deleted while the comment is still active).

Comment data will survive if a page is moved to another folder.

Keyboard Shortcuts

  • CMD+Option+M — if there is a selection, will start composing a new thread.
  • CMD+Enter to submit a comment/reply

Read-Only Users

Read only users who should have access to comment only would need to be given write permissions to /{site}/.da/comments/ + ** in the DA config.

Layout Mode

Layout mode currently doesn't show a toolbar at all when a block is selected. The comment button should be made available there as part of the work done in SITES-46128

Blocks now have a toolbar since this PR was originally raised. This is now supported.

How Has This Been Tested?

Screenshots (if appropriate)

image image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@aem-code-sync

aem-code-sync Bot commented Jul 6, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@usman-khalid usman-khalid changed the title Comments feat: comments Jul 6, 2026
@usman-khalid usman-khalid changed the title feat: comments feat(ew): comments Jul 28, 2026
@sharanyavinod

Copy link
Copy Markdown
Contributor

Thanks for your contribution and for your patience!
One architecture note: since you opened this PR, we've standardized how components talk to each other. Communication within the canvas itself now goes through a shared pub/sub bus, and communication that crosses from canvas into the panel has a standard eventing mechanism it should be going through consistently. Could you please update your PR to use these?

@usman-khalid

Copy link
Copy Markdown
Contributor Author

Thanks for your contribution and for your patience! One architecture note: since you opened this PR, we've standardized how components talk to each other. Communication within the canvas itself now goes through a shared pub/sub bus, and communication that crosses from canvas into the panel has a standard eventing mechanism it should be going through consistently. Could you please update your PR to use these?

done. routed canvas stuff through canvasBus and canvas > panel through PANEL_EVENT

Comment thread blocks/canvas/ew-tool-panel/tool-panel.js Outdated
Comment thread blocks/canvas/ew-comments/iframe-bridge.js Outdated
Comment thread blocks/canvas/canvas.js Outdated
Comment thread blocks/canvas/comments/comments-panel.css Outdated
Comment thread blocks/canvas/ew-editor-doc/ew-editor-doc.js Outdated
Comment thread blocks/canvas/comments/comments-panel.css Outdated
Comment thread blocks/canvas/ew-editor-doc/ew-editor-doc.js
Comment thread blocks/canvas/canvas.js Outdated
let visible = false;
let hideTimer = null;
const syncPanelOpen = () => getController()?.setPanelOpen(visible);
const observer = new IntersectionObserver((entries) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think intersection observer might be slightly overkill here - tool-panel already knows which is the currently active panel. Couldnt we expose this so all who want to know which panel is active only refer to it?

@usman-khalid usman-khalid Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we don't show the comment markers in the canvas if the rail is closed entirely, which is what this is for. doing the above would cause the them to still be visible if a user had the comments panel open, then closed the right rail entirely.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is already an event which is fired when the panel is closed. Couldn't we listen to that instead, and thus wouldn't a combination of this + what is the panel currently active cover this case without the need for an observer?

Comment thread blocks/canvas/comments/helpers/templates.js Outdated
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