Move thread facts from the inbox module down to the AI chat

Merged
CH
4d ago
+366-363

Why

Second step toward a one-way rule: the inbox may use the AI chat, the AI chat never uses the inbox. #30424 moved inbox pieces out of modules/ai. This PR handles the opposite misplacement: facts about a single thread that were named inbox and lived in modules/inbox.

The conversation UI needs these facts wherever a thread opens, including the side panel and the chat widget. For example the composer hides the model picker, skills and file drop when the thread is a direct message, so it read inboxThreadIsDirectMessageFamilySelector from the inbox module. Nothing in that selector is about the inbox: it reads one field of the thread record.

No behaviour change. Files in modules/ai importing from inbox go from 38 to 14.

What moves from modules/inbox to modules/ai

FactBeforeAfter
Is it a direct messageinboxThreadIsDirectMessageFamilySelector, getInboxDirectMessagePeerWorkspaceMemberIds, getInboxNewThreadDirectMessageWorkspaceMemberId, useOpenNewInboxAsDirectMessageaiChatThreadIsDirectMessageFamilySelector, getAiChatDirectMessagePeerWorkspaceMemberIds, getAiChatNewThreadDirectMessageWorkspaceMemberId, useOpenNewAiChatAsDirectMessage
The member's state on a threadinboxThreadMemberStateFamilySelector, InboxThreadStatusNotice, useUpdateInboxThreadStatusaiChatThreadMemberStateFamilySelector, AiChatThreadStatusNotice, useUpdateAiChatThreadStatus
Triage status of a threadInboxThreadTriageStatus, INBOX_THREAD_STATUS_ACTION_BY_TRIAGE_STATUS, useExecuteInboxThreadStatusAction, useMarkInboxThreadAsDoneInChannel, useReopenInboxThreadInChannel, useUpdateInboxThreadChannelCopythe same names with AiChat / AI_CHAT
Fetching and showing a threadINBOX_THREAD_LIST_FILTER, INBOX_THREAD_LIST_RECORD_GQL_FIELDS, InboxThreadListVariant, sortChatThreadsByLastActivityDescAI_CHAT_THREADS_FILTER, AI_CHAT_THREAD_RECORD_GQL_FIELDS, AiChatThreadRowVariant, sortChatThreadsByLastActivityDesc
The channel a thread belongs toInboxChannel, inboxChannelsState, inboxAccessibleChannelsSelector, InboxChannelIcon, useInboxChannelIcon, getInboxThreadChannelIdOutsideInbox, inboxNewThreadChannelIdStateAiChatChannel, aiChatChannelsState, aiChatAccessibleChannelsSelector, AiChatChannelIcon, useAiChatChannelIcon, getAiChatThreadChannelIdOutsideInbox, aiChatNewThreadChannelIdState

24 files move with their tests. They form a closed set: none of them imports anything that stays in modules/inbox.

Channel data moves down because the composer's recipient picker and the thread details both need it. What stays in the inbox is the inbox as a place: thread lists, the selected list, channel management and summaries, the drawer sections and the page.

Not in this PR

  • The 14 remaining imports from modules/ai into modules/inbox. They are real places the AI chat reaches into (the selected list, the recent list, the list loader) and need the importer to change, not a move: the next PR.
  • The lint guard on that import direction: after that.
  • String literals (state keys of persisted states, Storybook titles) and locale catalogs.

Screenshots

No UI change.