Skip to content

shell-updates#440

Open
pr3khar wants to merge 9 commits into
mainfrom
pr3-shell-updates
Open

shell-updates#440
pr3khar wants to merge 9 commits into
mainfrom
pr3-shell-updates

Conversation

@pr3khar
Copy link
Copy Markdown
Contributor

@pr3khar pr3khar commented Apr 8, 2026

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.

@pr3khar pr3khar requested a review from ankit-thesys April 8, 2026 22:05
pr3khar and others added 7 commits April 10, 2026 15:20
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants