shell-updates#440
Open
pr3khar wants to merge 9 commits into
Open
Conversation
- Sidebar: stop click propagation on toggle button and collapsed
NewChatButton so toggle/new-chat intent always wins over the
container's click-to-expand handler
- Sidebar: collapse the two isMobile effects into one, using a
previousIsMobileRef to detect viewport transitions and avoid the
stale-closure race between the open-state setter and animation
state machine
- useComposerState: emit a one-shot dev-mode warning when the hook
is used outside a ComposerStateProvider (silent fallback to local
state otherwise breaks cross-component features like isDrafting)
- ThreadListContainer (BottomTray, CopilotShell): apply
portalThemeClassName to portaled DropdownMenu.Content so non-default
themes propagate into the dropdown subtrees
- ConversationStarter (Shell, BottomTray, CopilotShell): type
isValidElement<{ children?: ReactNode }>(icon) so icon.props.children
is accessible under React 19's stricter ReactElement typing
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… drafting
WHY:
This PR introduced a React Context (ComposerStateProvider + useComposerState)
to share composer draft state across siblings so that conversation starters
can hide while the user is typing. With no external consumer of the new API
yet, the same visual behavior can be expressed declaratively in CSS — which
removes ~80 lines of provider/warning/memoization plumbing, eliminates the
per-keystroke re-renders of every reader (WelcomeScreen + three
ConversationStarter components), and removes a public API surface that the
PR would otherwise have to support indefinitely.
WHAT:
- hooks/useComposerState.ts: revert to a 4-line useState wrapper. Removes
ComposerStateContext, ComposerStateProvider, the dev warning, the local
fallback path, useRef/useEffect/useMemo.
- Composer roots (Shell, BottomTray, CopilotShell, DesktopWelcomeComposer):
add `data-drafting={textContent.length > 0 || undefined}` on the root div.
React skips the attribute when undefined, so the DOM only carries it while
the input is non-empty.
- Thread containers (3 shells): drop the <ComposerStateProvider> wrap and
its import.
- WelcomeScreen + three ConversationStarters: stop reading useComposerState();
drop the `isDrafting` derivation and the `--drafting` / `--hidden` modifier
classes.
- thread.scss (3 shells): add a `:has([data-drafting])` rule on the thread
container (plus the welcome-screen on Shell) that fades out the conversation
starters via opacity + pointer-events, with a 150ms transition.
- conversationStarter.scss (3 shells) + welcomeScreen.scss: remove the
now-dead `&--hidden` modifier rules.
Verified end-to-end in openui-chat dev server:
- data-drafting toggles "true" / absent as the user types and clears.
- Starters fade to opacity 0 / pointer-events none and back.
- No --hidden modifier class lingers anywhere in the DOM.
- Old dev-warning string is no longer present in any of the 42 bundled JS
files served by Next.js.
Net: 19 files changed, -92 LOC. Type-check clean. Build clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Shell parity and layout (Shell, Bottom tray, Copilot Shell)
Aligned behavior and visuals across standalone Shell, BottomTray, and CopilotShell: containers, headers, threads, thread lists, welcome screens, conversation starters, and composers.
CopilotShell: added a ThreadListContainer plus threadList.scss so its thread list matches the other layouts more closely.
API and state:
SharedChatUIProps / OpenUIChat: new optional showAssistantLogo; composed layouts pass it through.
useScrollToBottom: respects scroll-padding-top when scrolling to the last user message, and clamps scroll position with Math.max(..., 0) to avoid odd negative scrolls.