core, web: pin, archive and reorder a note someone shared with you

Schema v12 adds notes.state_at: a recipient's own pin, archive and order are
stamped there instead of on updated_at, which stays the text's time. Push sends
them only to a server advertising `shared_state` (push::Accepts), a view share
included; the first pull at that level starts the feed over once so held copies
drop their owner's pins. The client speaks protocol 7 and lists `shares` and
`shared_state` among the features a server may lack.

The web card and editor offer pin, archive and drag on shared notes; share and
trash stay the owner's, and the board's trash key skips notes you don't own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 17:13:58 -04:00
co-authored by Claude Opus 5.5
parent 63955bbe97
commit 89cd1c76bb
9 changed files with 304 additions and 91 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ import { useNotesStore, type Note, type NoteView } from "../stores/notes";
import { useConfigStore } from "../stores/config";
import { useUiStore } from "../stores/ui";
import { facetCount, facetsFromQuery, facetsToQuery } from "../notes/facets";
import { isOwnNote } from "../notes/sharing";
import { useNoteEditor } from "../composables/useNoteEditor";
import AsyncState from "../components/AsyncState.vue";
import EmptyState from "../components/EmptyState.vue";
@@ -127,7 +128,8 @@ function onBoardKey(e: KeyboardEvent) {
if (key === "Enter") {
e.preventDefault();
openEditor(note);
} else if (key === "x" && !inTrash.value) {
} else if (key === "x" && !inTrash.value && isOwnNote(note)) {
// Trash is the owner's; archive and pin below are everyone's own (#5176).
e.preventDefault();
void notes.trash(note.id);
} else if (key === "e" && !inTrash.value) {