Move the inbox pieces left in modules/ai to modules/inbox
Why
modules/ai and modules/inbox import each other: 47 files in ai import from inbox, and 42 the other way. The rule we want is one-way: the inbox may use the AI chat, the AI chat never uses the inbox.
Two kinds of misplacement cause the cycle. Inbox pieces still sit in ai, and facts about a single thread were named inbox. This PR fixes the first kind. It is the first of three; the next one moves thread facts down, and the last adds a lint guard once the count is zero.
No behaviour change is intended.
What changes
Eight inbox pieces move from modules/ai to modules/inbox and take inbox names:
Was in modules/ai | Now in modules/inbox |
|---|---|
NavigationDrawerAiChatContent | NavigationDrawerInboxContent |
NavigationDrawerAiChatThreadSection, NavigationDrawerAiChatThreadItem | NavigationDrawerInboxThreadSection, NavigationDrawerInboxThreadItem |
MobileHomeAiChatSection | MobileHomeInboxSection |
AiChatThreadRecordOperationsEffect | InboxThreadRecordOperationsEffect |
AiChatThreadInitializationEffect | InboxThreadInitializationEffect |
useLeaveRemovedAiChatThread | useLeaveRemovedInboxThread |
filterAiChatThreadsWithinLoadedPages | filterInboxThreadsWithinLoadedPages |
They are the drawer and mobile home sections that list threads, the two effects that load the recent list and keep lists live, and two list helpers.
AiChatProvider no longer mounts inbox effects. A new InboxEffects component mounts InboxThreadInitializationEffect, InboxThreadRecordOperationsEffect and InboxChannelsEffect, and WorkspaceAppProviders renders it just inside AiChatProvider, so they stay under the same Suspense boundary.
Result: files in ai importing from inbox go from 47 to 38, and the distinct inbox things they import from 48 to 36.
Not in this PR
- Thread facts named inbox (is it a direct message, the member's state on a thread, triage status): the next PR.
- The lint guard on
@/inboximports inmodules/ai: the last PR. - Storybook titles and locale catalogs keep their old paths.
Screenshots
No UI change.