File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @plotday/twister " : minor
3+ ---
4+
5+ Added: ` Note.todayItem ` — when a message is sent while a Today item is
6+ pinned as context, the note carries ` { id } ` pointing at that item. Twists
7+ can read ` note.todayItem ` in a note handler to know which Today item a
8+ message refers to. Read-only (not settable via ` NewNote ` ).
Original file line number Diff line number Diff line change 1+ import { describe , expectTypeOf , it } from "vitest" ;
2+ import type { Note , NewNote } from "./plot" ;
3+
4+ describe ( "Note.todayItem" , ( ) => {
5+ it ( "is a required { id } | null field on Note" , ( ) => {
6+ expectTypeOf < Note [ "todayItem" ] > ( ) . toEqualTypeOf < { id : Note [ "id" ] } | null > ( ) ;
7+ } ) ;
8+ it ( "is NOT settable on NewNote" , ( ) => {
9+ expectTypeOf < NewNote > ( ) . not . toHaveProperty ( "todayItem" ) ;
10+ } ) ;
11+ } ) ;
Original file line number Diff line number Diff line change @@ -732,6 +732,15 @@ export type Note = ThreadCommon & {
732732 actions : Array < Action > | null ;
733733 /** The note this is a reply to, or null if not a reply */
734734 reNote : { id : Uuid } | null ;
735+ /**
736+ * The Today-item context this note was composed against, via the Today
737+ * thread's pin affordance (pin an item to discuss it), or null. Mutually
738+ * exclusive with `reNote` and a forward snapshot — a note is at most one
739+ * of a reply, a forward, or a Today-item reference. Read-only from a
740+ * twist's perspective: only the Plot app sets it, when the user pins a
741+ * Today item and sends a message in the Today thread.
742+ */
743+ todayItem : { id : Uuid } | null ;
735744 /**
736745 * Contacts who can see this note, or null if the note inherits thread visibility.
737746 * When set (even to []), the note is private to the listed contacts plus the creator.
@@ -795,7 +804,7 @@ export type Note = ThreadCommon & {
795804export type NewNote = Partial <
796805 Omit <
797806 Note ,
798- "author" | "thread" | "tags" | "reactions" | "mentions" | "accessContacts" | "recipients" | "id" | "key" | "reNote" | "tagActors"
807+ "author" | "thread" | "tags" | "reactions" | "mentions" | "accessContacts" | "recipients" | "id" | "key" | "reNote" | "todayItem" | " tagActors"
799808 >
800809> &
801810 ( { id : Uuid } | { key : string } | { } ) & {
You can’t perform that action at this time.
0 commit comments