feat: comments#882
Open
usman-khalid wants to merge 27 commits into
Open
Conversation
18ec182 to
3ec1613
Compare
7034a47 to
3a87865
Compare
0fe8220 to
9741f47
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The EW Comments tool-panel view set the controller but never told it the panel was open, so the thread list and ProseMirror highlight decorations — both gated on panelOpen — stayed empty until a comment was added (which flips panelOpen via requestCompose). Mirror DA's behaviour by tying panelOpen to the panel element's actual visibility via IntersectionObserver, so highlights and threads appear whenever the Comments view is shown and hide when it is switched away or the rail is closed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment highlight decorations carry the class da-comment-highlight, but its CSS (and the --comment-highlight-* variables, scoped to .da-prose-mirror) lived only in the DA editor's stylesheet, which the EW document editor never loads — so the spans rendered unstyled. Extract the highlight rules to a shared blocks/shared/comments/comment-highlight.css and adopt it in both the DA editor (da-editor) and the EW document editor (ew-editor-doc). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Track a loaded flag on the comments store (notifying once after the first fetch, even with zero comments) and expose it via the controller, so the panel shows a spinner instead of flashing an empty "no comments" state while comments are still loading. - Add an `embedded` flag to da-comments that suppresses the in-panel title/close row; the EW tool-panel owns the close control, so its Comments view sets embedded and starts at the compose prompt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The panel hardcoded a white card surface and a white spinner overlay, which looked broken on EW's dark theme while the rest of the panel already used adaptive --s2-* tokens. Drive both from light-dark() so cards and the submit overlay stay white in DA's light theme and become elevated dark surfaces in EW, keeping the panel correct in both. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The highlight fills were hardcoded light-yellow/fuchsia, so EW's light editor text became unreadable on them in dark mode. Drive the highlight variables with light-dark(): light values are unchanged (DA preserved), dark values follow Spectrum's dark yellow/pink ramp so light text stays readable. Uses literals rather than --s2-* tokens so it works in both DA and EW regardless of which token set the host app loads. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # blocks/canvas/editor-utils/command-defs.js # blocks/canvas/ew-editor-doc/ew-editor-doc.js # test/fixtures/nx/blocks/shared/menu/menu.js
…files) DA is being de-emphasized in favour of Experience Workspace and comments has never shipped, so commit to EW-only rather than carrying a DA-compatible shared implementation: - Relocate the comments engine and panel into the canvas (EW) block: blocks/shared/comments -> blocks/canvas/comments blocks/shared/da-comments -> blocks/canvas/da-comments - Restore every blocks/edit/ file touched by the comments work to its upstream original (da-content, prose/index, edit.js, da-editor, slashMenu, imageFocalPoint, tableUtils) — blocks/edit/ is now identical to upstream. - canvas comment anchoring imports getTableInfo from edit's tableUtils, the same way the canvas editor already reuses other edit prose plugins. - Drop the DA-edit comments integration test; relocate engine/panel test imports to the canvas paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow the canvas naming/structure convention (ew-<feature> dirs that own their component + supporting code, à la ew-editor-doc). Merge the engine (blocks/canvas/comments) and panel (blocks/canvas/da-comments) into a single blocks/canvas/ew-comments/: - da-comments.js/.css -> ew-comments.js/.css; custom element da-comments -> ew-comments (class DaComments -> EwComments). - commentPlugin.js -> comment-plugin.js (kebab, matching editor-utils). - engine + panel helpers consolidated under ew-comments/helpers/. - Update all imports (ew-editor-doc wiring, panel view, tests) and the highlight/sheet asset paths. Internal .da-comments-* CSS class names are left as-is (scoped to the shadow root; renaming them is cosmetic and high-churn). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Give the comment command its own toolbar-comment group rendered after the image group, so it sits at the end of the toolbar next to the add-image button instead of among the inline text marks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the source move — comment engine/panel tests now live under test/unit/blocks/canvas/ew-comments/ (was test/unit/blocks/edit/...). Engine test import depths and the shared test-helpers path are updated for the new location; panel tests move at equal depth (imports unchanged). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The comment action is a no-op without an anchorable selection, so hide it unless the selection can be anchored. Add a canComment(state) predicate (non-empty text, or an image/table node selection) and use it as the add-comment command's visible() so the toolbar omits the button otherwise. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…idge Mirror the existing getPort() thunk so the comment iframe bridge always reads the current ProseMirror view (and no-ops if it's gone) rather than capturing a possibly-stale reference at subscribe time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should be merged with adobe/da-collab#132 which allows read-only users to write only to the comments map without touching actual document content.
Summary
Collaborative comments for DA.
Users can select text, an image or a table (block) and attach a comment. Comments live in a yjs map, so they stay in sync across concurrent editor and avoid last write wins.
Keyboard Shortcuts
CMD+Option+M— if there is a selection, will start composing a new thread. If not, will open the comments panel.Escto cancel.CMD+Enterto submit a comment/replyRelated Issue
Resolves #472
Other changes
da-toastcomponent as this is now being used in three places:da-list,da-sitesandda-commentsgenerateColorHow Has This Been Tested?
Screenshots (if appropriate)
Screen.Recording.2026-04-20.at.15.1.mp4
Types of changes
Checklist