Stop the AI chat from reaching into the inbox for menus and thread lookup
Why
Third step toward a one-way rule: the inbox may use the AI chat, the AI chat never uses the inbox. After #30424 and #30428, 13 files in modules/ai still imported from modules/inbox. These are not misplaced names any more: they are places where AI chat code reaches into the inbox. This PR removes the ones that need no behaviour change, taking the count from 13 to 9.
What changes
Two menus move up to modules/inbox. Nothing in modules/ai uses them; their users are the inbox lists, the pages and the side panel.
Was in modules/ai | Now in modules/inbox | Why it belongs there |
|---|---|---|
AiChatThreadActionsDropdown | InboxThreadActionsDropdown | the actions on a row of a thread list, with the triage buttons |
AiChatThreadDetailsDropdown, AiChatThreadDetailsStatus, useAiChatThreadDetailsStatus | InboxThreadDetailsDropdown, InboxThreadDetailsStatus, useInboxThreadDetailsStatus | the thread's filing: status as seen from the list on screen, and its channel |
AiChatPageHeader takes its icon as a prop. It used to render the inbox's list toggle itself. The page that mounts it now passes <InboxNewThreadListToggle />.
useOpenAskAiThread looks the thread up by id. It used to search the threads of the inbox's selected list. It now reads the thread record directly and keeps ignoring deleted threads. One difference: a thread that is loaded but not part of the selected list is now found, where before the hook fell back to selecting it by id and opening the side panel. Both paths open the same thread.
Not in this PR
The 9 remaining imports need a design choice each, so they come next:
useAiChatSubscriptionreloads the recent list when the open chat is not found.useApplyAiChatThreadUpdateprepends a thread to the recent list.AiChatThreadParticipantOperationsEffectrefreshes the inbox counts.AiChatPageThreadUrlSyncEffect,currentAiChatThreadDataSelector,aiChatIsLoadingSelectoranduseShouldShowAiChatEmptyStateread whether the recent list is loaded.useSelectAiChatThreadresets the inbox's closing thread.- One story helper in
modules/ai/testing.
The lint guard on the import direction follows once the count is zero.
Screenshots
No UI change.