Notes: Merge the sticky-notes into pinned notes - #497
Draft
mmtr wants to merge 7 commits into
Draft
Conversation
Removes the Guidelines-backed sticky notes and folds the two things it did better into pinned notes: a "New note" wallpaper context-menu entry and per-desktop scoping. Sticky notes rode Gutenberg's Guidelines experiment. Gutenberg renamed that storage primitive from wp_guideline to wp_knowledge, so the availability gate returned false everywhere and the layer never booted, leaving one dead notes surface next to a working one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ontext-menu-b83d9f # Conflicts: # docs/architecture.md # docs/javascript-reference.md # includes/render/assets.php
…tilt
Four fixes to the per-desktop work, all found in a real browser:
- Subscribe to DESKTOP_CREATED, and let one method own whether the
toggle is present. It was built once at paint, gated on the desktop
count, so adding a desktop mid-session never grew it in. A note bound
while the session had one desktop was then stranded: hidden on the new
desktop, with no control on the old one to unbind it, until a reload.
- Move the toggle from the meta row to the footer. The pushpin is 56px
wide, centred, jittered by up to 10px and painted above the paper's
chrome, so it covers note-relative x 62-138. A fourth control in the
right-aligned meta row pushed the visibility lock underneath it, where
elementFromPoint resolves to the pin and a click does nothing. Affects
any owner with edit_posts on a multi-desktop session.
- Seed the paper jitter from the drop position when a note has no text.
The wallpaper menu always creates empty notes and hashNoteSeed('')
is a constant, so every note from the new primary creation path got
an identical tilt and pin angle.
- Say what clampPosition actually guarantees in the testing steps: the
vertical clamp reserves a fixed 120px against a note that is ~230px
tall, so a note pinned near the bottom edge is clipped. Pre-existing
and unchanged here, but the menu makes it much easier to reach.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…h button Reverts the virtual-desktop binding. Notes are visible on every desktop again, as on trunk: the `_wpd_note_desktop` meta, the `desktop` wire field, the footer toggle and the DESKTOP_* wiring are all gone. The wallpaper "New note" entry stays. Three fixes on top: - Register a bin drop target on every surface that represents the Trash, not just the first selector match. The classic layout renders the bin as a wallpaper tile AND a dock system tile at once, so resolving "the" bin to one element left the dock tile with nothing attached: dragging a note onto the dock Trash lit up nothing and did nothing on release. Files were affected the same way. - Publish `os.wpd_note.changed` when a note is trashed, restored, or converted. The Recycle Bin badge counts deltas off that topic for every post type the bin captures, and `wpd_note` is one of them, so without it the server's count moved and the dock badge kept whatever it had at boot. Verified in a browser: badge and REST /count now agree after a drag-to-bin. - Add a "Move to Trash" button to the note, next to the other actions. It confirms first, then takes the same path as drag-to-bin. It sits in the footer rather than the meta row because the pushpin covers note-relative x 62-138 and a fourth control in the right-aligned meta row lands underneath it, unreachable with a pointer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ontext-menu-b83d9f # Conflicts: # docs/architecture.md # docs/javascript-reference.md
It sat at a constant 0.75 opacity while the colour dot, visibility and convert buttons fade in with the meta row, so every note carried a permanently visible trash icon. It can't live inside `.os-pinned-note__meta` and inherit that reveal (the pushpin covers the meta row's left half), so the fade is repeated on the button. Resting at 0.75 when revealed matches what a meta-row button resolves to: the row fades to 1 and each button sits at 0.75 inside it. The button's own :hover is scoped through the note. Bare `.os-pinned-note__trash:hover` is (0,2,0) and the reveal rule is (0,3,0), so it would never have reached full opacity — you are always hovering the note when you hover its button. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mmtr
marked this pull request as draft
August 6, 2026 15:06
…ontext-menu-b83d9f # Conflicts: # includes/render/assets.php
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.
Fixes #344.
Proposed Changes
src/sticky-notes/,includes/sticky-notes/, their CSS, their tests, and theopenstation_sticky_notes_availablefilter, theopenStationConfig.stickyNotes.availableflag and theopenstation_sticky_notes_subscribeHeartbeat channel.os.wallpaper-context-menufilter a second argument,{ x, y }, carrying the right-click position.Why are these changes being made?
We had two wallpaper note surfaces, two CPTs, two Heartbeat channels and two visual languages, and only one of them worked.
Sticky notes rode Gutenberg's Guidelines experiment (the
wp_guidelineCPT andwp_guideline_typetaxonomy). Gutenberg renamed that storage primitive towp_knowledgein #79149 and dissolved the singleton into per-scope rows in #79263, soopenstation_sticky_notes_is_available()has returnedfalseon every site since. The layer stopped booting and its menu entry stopped appearing, which is why #344 no longer reproduces. Chasing an opt-in experiment that has already renamed its storage once buys us maintenance, not a feature.Pinned notes win on everything else anyway: plugin-owned storage, server-side placement every viewer shares, a real delete path with Undo and Trash restore, colours, sharing with attribution, convert-to-post, and the test coverage.
The filter's new second argument is needed because
onClickis invoked with a syntheticMouseEvent. Any item that places something on the wallpaper would read(0, 0)off the event. It is additive, so existing filters are unaffected.The two bugs
The dock's Trash accepted nothing.
recycle-bin-targets.tsresolved "the bin" through an ordered selector list and registered a drop target on the first match. But the bin is not one element: in the default classic layout the wallpaper tile (.os-file-tile[data-file-ref]) and the dock system tile ([data-system-id]) are both on screen, and the wallpaper tile won. The dock tile had no target, so a drag over it never highlighted and a release over it did nothing. This affected file and shortcut drags too, not just notes. Now every surface registers under its own id.The Trash badge ignored notes. The badge keeps its count live by subscribing to
os.<post-type>.changedfor each type the bin captures, andwpd_noteis in that list. Nothing on the notes side ever published it, so trashing a note moved the server's count while the dock kept whatever it had at boot.trashNoteWithUndoandconvertNoteToPostnow publish the same{ source, action, ids }payload the files layer uses.On the trash button's placement
It is in the note's footer, not next to the visibility and convert buttons in the top meta row. The pushpin is 56px wide, centred, jittered by up to 10px and painted above the paper's chrome, so it covers note-relative x 62–138. The right-aligned meta row already runs back to ~136 with three controls; a fourth lands under the pin, where
document.elementFromPointresolves to.os-pinned-note__pinand clicking does nothing. Measured in a browser both ways before choosing.Per-desktop notes
An earlier revision of this branch scoped notes to a virtual desktop. That is reverted: notes are visible on every desktop, exactly as on trunk. No
_wpd_note_desktopmeta, nodesktopfield on the wire, no toggle.No data migration
Sticky notes only existed on sites running Gutenberg with the experiment enabled, and the
wp_guidelineposts survive untouched. An importer would mean guessing at term scoping for a population that is almost certainly zero.Testing Instructions
Run
npm run buildfirst.New note on the wallpaper
/wp-admin/index.php?desktop_mode_portal=1.clampPositionbehaviour, unchanged here, but the menu makes it easier to reach than the Note Pad drag did.Trash button on the note
edit_posts) the convert button; the footer carries the trash button and the save-status chip.Drag to the Trash, from both surfaces
Trash badge
wp post delete $(wp post list --post_type=wpd_note --post_status=trash --format=ids) --forcewp eval 'echo openstation_recycle_bin_count();'should match the badge at every step.Notes are not desktop-scoped
Nothing sticky left behind
Automated
npm run test:js(3784),npm run test:php(2028),npm run lint,npm run lint:php,npm run typecheck, all green.🤖 Generated with Claude Code