Adaptable

CellNoteState

Declared in src/modules/cellNote/State.ts

State of the cell-note module.

threads is the data every surface reads and writes. Without the loadThreads/persistThreads pair it is saved with the rest of the grid state; with the pair, the app owns durability and threads is kept out of the persisted grid state (see the module docs).

readMarks is per user. By default it is saved with the grid state (which is already per user / per browser); supply loadReadMarks/persistReadMarks to store it server-side instead.

#Properties

10 props

#canEdit(entry: CellNoteEntry, ctx: CellNoteCellContext) => boolean

Gates edit/delete on an entry. Default: the entry's author, or an entry without author.

#isCellNotable(ctx: CellNoteCellContext) => boolean

Gates "Add note" on a cell. Default: every cell.

#loadReadMarks(ctx: CellNoteContext) => Promise<CellNoteReadMarks>

Loads the current user's read marks from the app backend.

#loadThreads(ctx: CellNoteContext) => Promise<CellNoteThreads>

Loads all threads from the app backend, once, after grid state hydration.

#notifyOnMentionboolean

Show the built-in alert when the current user is mentioned. Default true.

#persistReadMarks( readMarks: CellNoteReadMarks, change: CellNoteReadMarksChange, ctx: CellNoteContext, ) => Promise<void | CellNoteReadMarksPersistResult>

Saves the current user's read marks after a change.

#persistThreads( threads: CellNoteThreads, change: CellNoteChange, ctx: CellNoteContext, ) => Promise<void | CellNotePersistResult>

Saves all threads after a change. A result with threads replaces the local ones.

#readMarksrequiredCellNoteReadMarks

Thread key → epoch ms when the current user last opened that thread.

#resolveMentions(query: string, ctx: CellNoteContext) => Promise<CellNoteUser[]>

Suggestions for the @ autocomplete in the note editor.

#threadsrequiredCellNoteThreads

Keyed by threadKey(): ${primaryKey}|${columnId}. Shared between users.

#Used by