Skip to content

fix: persist and rehydrate draft mention context#4807

Open
ComputelessComputer wants to merge 13 commits intomainfrom
fix/chat-draft-mention-persistence
Open

fix: persist and rehydrate draft mention context#4807
ComputelessComputer wants to merge 13 commits intomainfrom
fix/chat-draft-mention-persistence

Conversation

@ComputelessComputer
Copy link
Copy Markdown
Collaborator

@ComputelessComputer ComputelessComputer commented Mar 28, 2026

  • centralize draft serialization and storage in the shared chat draft module
  • derive pending draft mention refs from stored editor state instead of effect-based sync
  • preserve restored draft refs and rehydrate draft context from the editor once it is initialized

- Return early from the context bar when there are no context chips
- Keep the add button available only once context is already present
- Hide the context bar entirely when there are no context chips
- Render the composer with full rounded corners when it is no longer attached to a context bar
- send the global shortcut to the persistent chat new-session action when the composer has focus
- centralize persistent chat session resets in shared chat state so the shortcut and header button stay in sync
- add chat state coverage for starting and selecting chat sessions
- Extract mention nodes from the chat draft into typed context refs
- Show mentioned sessions, people, and organizations in the context bar while typing
- Persist mention refs on sent messages and render contact/org context into the chat prompt
- Extract mention nodes from the chat draft into typed context refs
- Show mentioned sessions, people, and organizations in the context bar while typing
- Persist mention refs on sent messages and render contact/org context into the chat prompt
- Flatten mention nodes into plain-text @labels for the visible user message and chat title
- derive plain-text chat content and mention refs from one draft serializer
- mark editor-derived mention refs as draft context instead of removable manual context
- add regression coverage for mention text serialization and ref extraction
- move draft serialization and storage helpers into a shared input draft module
- initialize pending draft refs from stored draft state instead of syncing them in useEffect
- keep chat mention and draft tests passing with the new draft initialization flow
- remove the one-off draft context helper and initialize draft refs inline where they are consumed
- simplify draft state initialization by deriving initial content directly from stored draft data
- keep the live draft context callback flow intact for context bar updates without effect sync
Base automatically changed from fix/chat-context-foundation to main March 28, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant