Convert pinned notes into draft posts - #364
Merged
Merged
Conversation
Add a "Convert to post" action to pinned notes: an inline button on each owned note, plus dragging a note's pin onto the Posts icon (dock and Spatial layouts) and the native Posts window. Converting spawns a draft post from the note's text (as paragraph blocks), trashes the note, and opens the draft in the editor. Undo restores the note and discards the draft. Adds a files-layer tile-payload seam so features can accept drops on a shortcut tile the files layer would otherwise reject. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mmtr
force-pushed
the
claude/convert-notes-to-posts-c5fb88
branch
from
July 17, 2026 14:34
b7cb47d to
5c08427
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a “Convert to post” workflow for pinned notes, enabling users with edit_posts to turn an owned note into a draft post (with Undo restoring the note and discarding the spawned draft). This extends the notes feature with a new REST endpoint, UI affordances, and drag-and-drop integration across dock, spatial shortcut tiles, and the native Posts window.
Changes:
- Introduces
POST /desktop-mode/v1/notes/:id/convert(server + client) to spawn a draft post from a note and link it for Undo via restore. - Adds UI + drag/drop entry points (inline note button, dock tile, spatial shortcut tile seam, native Posts window body).
- Adds documentation and both Vitest + PHPUnit coverage for conversion behavior and the new tile-payload seam.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/vitest/tile-payloads.test.ts | Adds unit tests for the new files-layer tile-payload seam registry. |
| tests/vitest/notes-rest.test.ts | Adds REST-client test for convertNote() route + response shape. |
| tests/vitest/notes-posts-drop-target.test.ts | Adds regression coverage for dock slug matching and drop behavior across surfaces. |
| tests/vitest/notes-convert.test.ts | Tests optimistic eviction, editor auto-open, Undo behavior, and rollback on failure. |
| tests/phpunit/tests/notesRest.php | Server-side tests for convert route semantics, permissions, restore/undo, and filter behavior. |
| src/types.ts | Extends DesktopConfig with canCreatePosts capability gate. |
| src/notes/rest.ts | Adds convertNote() REST client and result type. |
| src/notes/posts-drop-target.ts | Implements Posts drop targets (dock, native window, spatial shortcut tile via seam). |
| src/notes/layer.ts | Adds inline “Convert to post” button and layer-level convertNote() entry point. |
| src/notes/index.ts | Boots the Posts drop-target installer and wires canCreatePosts into NotesLayer. |
| src/notes/convert.ts | Implements convert flow orchestration: REST call, editor open, Undo toast. |
| src/desktop-files/tile-payloads.ts | New registry/seam to allow non-folder tiles to opt into accepting foreign payload types. |
| src/desktop-files/layer.ts | Routes non-folder “reject” tile claimant through the new seam for accept/label/drop dispatch. |
| includes/render/assets.php | Exposes canCreatePosts in the shell config payload (edit_posts). |
| includes/notes/rest.php | Registers convert REST route; implements conversion and restore-side draft discard. |
| docs/javascript-reference.md | Documents the new drag/drop surfaces and canCreatePosts gating + convert route. |
| docs/hooks-reference.md | Documents new desktop_mode_notes_convert_post_args filter and desktop_mode_notes_converted action. |
| docs/examples/README.md | Indexes the new conversion customization example. |
| docs/examples/notes-convert-to-post.md | New example showing how to customize conversion via hooks. |
| assets/css/notes.css | Styles the convert button and the Posts drop-target highlight state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… label Co-Authored-By: Claude Opus 4.8 <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.
Turn a pinned note into a draft post. A "Convert to post" action is available three ways: an inline button on each owned note, dragging the note's pin onto the Posts icon, or dragging it onto the native Posts window. Converting creates a draft from the note's text, removes the note, and opens the draft in the editor. Undo brings the note back and discards the draft.
Only shown to users who can author posts (
edit_posts).Testing
Prerequisites: log in as a user with Desktop Mode enabled who can create posts (Administrator or Editor).
Create a note to work with
Convert via the inline button
Convert by dragging to the Posts icon (dock layout)
Convert by dragging to the Posts icon (Spatial layout)
Convert via the native Posts window (optional)
Capability gate
🤖 Generated with Claude Code