Skip to content

feat: comments#12672

Merged
tiensonqin merged 17 commits into
masterfrom
feat/comments
May 19, 2026
Merged

feat: comments#12672
tiensonqin merged 17 commits into
masterfrom
feat/comments

Conversation

@tiensonqin
Copy link
Copy Markdown
Contributor

@tiensonqin tiensonqin commented May 18, 2026

@github-actions github-actions Bot added the :type/feature New feature label May 18, 2026
@tiensonqin tiensonqin marked this pull request as ready for review May 18, 2026 10:03
Copilot AI review requested due to automatic review settings May 18, 2026 10:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a built-in block-level Comments feature for DB graphs. It adds a new :logseq.class/Comments tag and :logseq.property.comments/blocks property (with a schema migration to 65.28), a comments component/model pair, a comments handler, a /Add comment slash command + ctrl+space shortcut, an action-bar button and context-menu entries to add comments, plus extensive editor changes so navigation/indent/move/expand-collapse/slash-commands behave correctly around comment areas. Block-rendering, drag-and-drop, asset paste, and graph-view filtering are updated to recognize and protect the new comment containers.

Changes:

  • Add a Comments tag/property/migration and surface a comments UI (component, handler, CSS, i18n strings, slash command, shortcut, action bar/context menu).
  • Teach editor logic (move/indent/outdent/up-down/expand-collapse/slash/navigation) and DnD to skip or protect comment areas and their children, including a new navigable-sibling-block helper.
  • Extend db-based-save-assets! with an explicit :target-block and add outliner deletion cleanup of orphaned range-comment areas; add many cljs tests for the new behaviors.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
deps/db/src/logseq/db/frontend/class.cljs Add built-in :logseq.class/Comments class.
deps/db/src/logseq/db/frontend/property.cljs Add :logseq.property.comments/blocks and register logseq.property.comments namespace.
deps/db/src/logseq/db/frontend/schema.cljs Bump schema version to 65.28.
deps/db/test/logseq/db/frontend/property_test.cljs Tests for the new built-in property.
deps/outliner/src/logseq/outliner/core.cljs Cascade-delete orphaned range comments when all targets are deleted.
deps/outliner/test/logseq/outliner/core_test.cljs Tests for orphan range-comment deletion behavior.
src/main/frontend/commands.cljs New /Add comment slash command and step handler.
src/main/frontend/common/graph_view.cljs Filter the new Comments class from graph view.
src/main/frontend/components/block.cljs Render comments-area inline, comment-thread button, draggable guards.
src/main/frontend/components/block.css Styles for comments area, rows, actions, reply box.
src/main/frontend/components/block/comments.cljs New comments UI components (box, rows, area view).
src/main/frontend/components/block/comments_model.cljs New comments model/helpers (drafts, formatting, guards).
src/main/frontend/components/content.cljs Add "Add comment" entries to context menus.
src/main/frontend/components/selection.cljs Add comment action to selection action bar.
src/main/frontend/components/views.cljs Suppress outliner-only actions in table selection bar.
src/main/frontend/handler/block.cljs Skip comment-protected blocks during indent/outdent.
src/main/frontend/handler/comments.cljs New comments handler (ensure area, insert/save/delete, paste assets).
src/main/frontend/handler/dnd.cljs Block moves involving protected comment blocks.
src/main/frontend/handler/editor.cljs Comment-aware navigation, slash suppression, expand/collapse guard, asset target-block.
src/main/frontend/handler/editor/lifecycle.cljs Respect new :skip-focus? editor config.
src/main/frontend/handler/events.cljs Register :editor/add-comment event.
src/main/frontend/modules/shortcut/config.cljs New mod+alt+c shortcut + category registration.
src/main/frontend/worker/db/migrate.cljs Migrations adding the Comments class and blocks property.
src/resources/dicts/en.edn, zh-cn.edn i18n strings for comments.
src/test/* New/expanded tests for editor, migrate, comments-model, comments handler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/frontend/handler/dnd.cljs Outdated
Comment thread src/main/frontend/handler/comments.cljs Outdated
Comment thread src/main/frontend/components/block/comments_model.cljs Outdated
Comment thread src/main/frontend/components/block/comments.cljs Outdated
Comment thread src/main/frontend/components/content.cljs Outdated
Comment thread src/main/frontend/handler/dnd.cljs Outdated
@tiensonqin tiensonqin merged commit 0e87a83 into master May 19, 2026
24 of 25 checks passed
@tiensonqin tiensonqin deleted the feat/comments branch May 19, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:type/feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants