feat: artifact system with side-panel support and folder restructure - #364
Merged
Conversation
…imitive - Sidebar collapse: reduce width to 52px, remove background/full border, add smooth logo transition (36px to 28px), new toggle icons - NewChatButton: render as IconButton when sidebar is collapsed - SidebarHeader: accept children prop for flexible layout - Composer: extract into components/ for Shell, CopilotShell, and BottomTray; add attachment prop, action-bar layout, scrollbar styling, isLoadingMessages guard - DesktopWelcomeComposer: same attachment support and layout improvements - ThreadHeader: new component for desktop-only header actions - Portal: new component wrapping @radix-ui/react-portal - Update all Storybook stories with new patterns Made-with: Cursor
…to feature/shell-sidebar-composer-redesign
…to feature/shell-sidebar-composer-redesign
…hub.com/ankit-thesys/openui-comp into feature/shell-sidebar-composer-redesign
…r restructure Introduce a complete artifact system for displaying rich side-panel content alongside chat conversations. This includes: - Zustand artifact store (createArtifactStore) with open/close/remove/reset actions - Consumer hooks: useArtifact, useActiveArtifact, useArtifactPortalTarget - Cross-store subscription to reset artifacts on thread switch - UI components: ArtifactPanel (portal-based), ArtifactPortalTarget, ArtifactOverlay - Comprehensive JSDoc documentation across all public APIs - Folder restructure: extract shared infra (store, artifact, types, utils) into _shared/ to eliminate dependency tangles between Shell, BottomTray, and CopilotShell - Refactor ArtifactPanel to use only public headless hooks (no @internal access) - 30 tests covering store logic, thread-switch cleanup, and hook behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…to feature/shell-sidebar-composer-redesign
- Add `threadHeader` (desktop) and `mobileHeaderActions` props to FullScreen - Add `headerActions` prop to Copilot and BottomTray layouts - Fix composer textarea collapsing to 0px height in all layouts (use height: 0px instead of auto for scrollHeight measurement) - Add Storybook stories demonstrating header customization - Update MDX docs with header customization section and props tables Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…to feature/Artifact
ankit-thesys
commented
Mar 20, 2026
abhithesys
reviewed
Mar 23, 2026
abhithesys
reviewed
Mar 23, 2026
ankit-thesys
force-pushed
the
feature/Artifact
branch
from
March 24, 2026 00:39
674aa1b to
5b3987d
Compare
abhithesys
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a complete artifact system that enables chat messages to display rich side-panel content (code previews, generated UIs, charts) alongside conversations. Also restructures
react-uito eliminate dependency tangles between layout variants.Artifact System (
react-headless)createArtifactStore) withsubscribeWithSelectormiddleware — manages artifact registry, active state, and portal target nodeartifactTypes.ts):ArtifactMeta,ArtifactMetaInput,ArtifactState,ArtifactActions,ArtifactStoreuseArtifact(id)— per-artifact state + actions (isActive, meta, open, close, toggle, triggerProps)useActiveArtifact()— global "is anything open?" state for layout componentsuseArtifactPortalTarget()— public hook for registering/reading the portal target DOM nodeuseArtifactStore()— escape hatch for raw store accessChatProvider: resets artifacts automatically on thread switchcreateChatStorewrapped withsubscribeWithSelectormiddleware (no logic changes — enables slice-level subscriptions)Artifact UI Components (
react-ui)ArtifactPanel— portals artifact content intoArtifactPortalTargetwhen active; includes error boundary, theme-scoped class names, configurable header (true/false/custom ReactNode)ArtifactPortalTarget— registers a DOM node as the portal render target (display: contents)ArtifactOverlay— shared overlay wrapper with slide-in/slide-out CSS animations, used by Shell (mobile), BottomTray, and CopilotShell layoutsThreadContainer— desktop: resizable artifact panel with drag separator; mobile: overlay mode@internalfield access)Folder Restructure (
react-ui)Extracted shared infrastructure into
components/_shared/to eliminate dependency tangles:Shell/store.tsx_shared/store/Shell/ArtifactPanel.tsx+ArtifactPortalTarget.tsx_shared/artifact/ArtifactOverlay/_shared/artifact/OpenUIChat/types.ts(shared types)_shared/types/OpenUIChat/utils/(isChatEmpty)_shared/utils/Result: All layout variants (Shell, BottomTray, CopilotShell) are now true peers importing from
_shared/. No backwards dependencies. Zero public API breaking changes —Shell.*namespace re-exports from_shared/.JSDoc Documentation
Comprehensive JSDoc across all new public APIs:
@category,@param,@returnswith{@link},@exampleblocks@internalOther Changes
isArtifactActiveandrenderArtifactprops fromThreadContainer(replaced by hook-based artifact activation)OpenUIChat/types.tsprop (SharedChatUIPropsno longer duplicates shared types).gitignorefor Claude Code workspace filesTest Coverage (30 tests)
createArtifactStore.test.ts(18 tests): open/close/remove/reset, metadata merging, timestamp behavior, DOM node managementartifactThreadSwitch.test.ts(5 tests): cross-store subscription — artifacts clear on thread switch, new thread, thread deletion; same-thread re-selection preserves artifacts; rapid switches handleduseArtifact.test.ts(7 tests): isActive state, open/close/toggle, multiple artifacts, metadata preservationTest plan
pnpm --filter @openuidev/react-headless build— passespnpm --filter @openuidev/react-headless test— 71/71 tests passpnpm --filter @openuidev/react-ui build— passespnpm --filter @openuidev/react-ui lint:check— 0 errorspnpm -r build— full monorepo build passes (all packages + docs + examples)🤖 Generated with Claude Code