Member Junction
    Preparing search index...

    Per-user persistence for in-progress (un-sent) composer drafts, so a message the user was writing survives conversation switches, page refreshes, and devices.

    Storage: ONE MJ: User Settings row via UserInfoEngine (never localStorage — see the root CLAUDE.md persistence rule), key COMPOSER_DRAFTS_SETTING, value = a JSON map of 'new' | <conversationId-lowercased> → the SERIALIZED draft (the composer's getPlainTextWithJsonMentions() format, so mention pills round-trip losslessly through the editor's rehydrating writeValue).

    Contracts:

    • Writes while typing are debounced (SetSettingDebounced); Flush persists immediately (blur / conversation switch).
    • Sending a message calls ClearDraft, which DELETES the key from the map and persists — the map only ever holds live drafts.
    • Empty/whitespace drafts are treated as clears; drafts are capped at MAX_DRAFT_LENGTH; the map keeps at most MAX_DRAFTS entries (least-recently-updated evicted).
    • The setting is read ONCE per session (UserInfoEngine's cache makes this a sync hit anyway); the in-memory map is authoritative afterwards. Multi-tab is last-write-wins by design.
    Index

    Constructors

    Properties

    COMPOSER_DRAFTS_SETTING: "mj.chat.drafts.v1" = 'mj.chat.drafts.v1'

    The single User Setting key holding all drafts.

    MAX_DRAFT_LENGTH: 16000 = 16_000

    Per-draft length cap (chars of serialized text).

    MAX_DRAFTS: 20

    Most drafts retained; least-recently-updated evicted beyond this.

    NEW_CONVERSATION_KEY: "new" = 'new'

    Map key for the new-conversation (not-yet-created) composer.

    Methods