The Material UI moves into MaterialChatRenderer (layouts, dropzone, MUI
theme map, enableInternalThemeProvider). ApChat from ./ap-chat now
registers it and renders ChatRoot with defaultRenderer="material",
keeping its props; rendered DOM and Emotion CSS are unchanged.
./chat exports an ApChat that defaults to the Wind renderer (for now a
placeholder) and registers Material lazily, the one allowed src/chat to
Material import. Its initial chunk carries no @mui or @emotion code.
ChatRoot falls back to defaultRenderer when config.renderer is not
registered, and passes the theme prop to ThemeProvider for the first
render so the internal MUI theme does not start in the service default.
Chat components now import ApIcon, ApButton and ApTypography directly
instead of through the material barrels, which re-export ApChat and
formed a cycle back into ap-chat.tsx.
MST-16176
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Runs the existing Material chat on
ChatRootand adds the./chatApChat(story MST-16176).MaterialChatRendererholds the Material UI: layouts, dropzone, the MUI theme map andenableInternalThemeProvider(now following the headless theme).ApChatfrom./ap-chatregisters it and renders<ChatRoot defaultRenderer="material">, keepingApChatProps. The duplicate provider stack is gone.ApChatfrom./chatdefaults to the Wind renderer, for now a placeholder that names the missing renderer, and registers Material lazily: the single allowedsrc/chat→ Material import, behind a documentedbiome-ignore(the rule does flag the dynamic import).Fixes found along the way
attachments.tsxand six other chat components imported from thematerialbarrels, which re-exportApChat, looping back intoap-chat.tsx. With registration at module load, the lazy./chatpath could register a half-loadedMaterialChatRenderer. They now importApIcon/ApButton/ApTypographydirectly;ap-chat.jsis no longer reachable fromMaterialChatRenderer.jsindist.ThemeProvidertakesinitialThemefromChatRoot, so the web component's internal MUI theme does not render one frame in the service default.ChatRootwarns and usesdefaultRendererwhenconfig.renderernames an unregistered renderer (e.g.'wind'on./ap-chat).Notes for reviewers
./chat's initial load is about 960 KB unminified: 397 KB is canvas message catalogs (the shared i18n registry imports every catalog) and 151 KB islodash/fp(oneisEqualin the attachments provider). Worth trimming before Wind ships.Verification
web-packages/ap-chat: builds; 42 tests pass; dev harness renders, dark theme applies, embedded mode renders in the shadow root, Emotion styles inject only into the shadow root./chatconsumer: 0@mui/@emotionmodules in the initial load; Material is a separate 4.8 MB lazy chunkApChatdeclarations unchanged apart from destructured parameter names; apollo-react tests: 3899 passStack
Merge in order; each PR is based on the previous one.
Plan: https://uipath.atlassian.net/wiki/spaces/CLD/pages/91226013878
🤖 Generated with Claude Code