add interactive chats to the Home canvas - #178
Merged
Merged
Conversation
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.
Category: new-feature
User Impact: Users can expand pinned chats into live, interactive conversation cards on Home without leaving the canvas.
Problem: Opening a pinned chat currently replaces the Home canvas, breaking spatial context and making it harder to keep several active conversations in view. Solution: This opt-in experiment lets pinned chats expand in place with a bounded recent-history window and the shared composer, while full chat remains available for complete history and deeper work.
Refs #143
Product behavior
Architecture
Verification
just checkFile changes
src/app/AppShell.tsx / src/app/ui/AppShellContent.tsx
Keep session dispatch route-neutral and pass the shared composer/session callbacks into Home.
src/features/chat/capabilities/ConversationComposerCapability.tsx
Extract the shared conversation composer authority and presentation policy used by full chat, Home, and canvas cards.
src/features/chat/hooks/useChat.ts
Keep session-addressed sends and compaction from changing route selection.
src/features/chat/hooks/useChatTranscriptReadModel.ts
Provide a read-only, session-addressed transcript model for non-route chat surfaces.
src/features/chat/hooks/useSessionAddressedComposerAdmission.ts
Centralize session failure, read-only, security, and separate-window admission across chat surfaces.
src/features/chat/lib/boundedConversationProjection.ts
Project the ten most recent complete user-led exchanges for the in-the-moment canvas window.
src/features/chat/stores/chatStore.ts
Retain independently mounted transcripts safely through cache trimming and session-ID promotion.
src/features/chat/ui/ChatInput.tsx
Support the shared composer’s bare embedded presentation.
src/features/chat/ui/ChatTranscriptSurface.tsx
Extract the reusable transcript/loading/artifact surface from the route workspace.
src/features/chat/ui/ChatView.tsx
Compose the full workspace from the shared transcript and composer owners.
src/features/chat/ui/MessageTimeline.tsx / VirtualMessageTimelineGate.tsx
Support bounded start content and owning-surface renderer selection.
src/features/experiments/experimentDefinitions.ts
Register Chat on Canvas as manual-only and off by default.
src/features/home/lib/homeLayoutMapper.ts
Persist expanded/collapsed chat presentation and per-profile size memory.
src/features/home/ui/HomeComposer.tsx
Adopt the shared composer capability without changing Home’s pending-chat behavior.
src/features/home/ui/HomeView.tsx
Hydrate and compose pinned chat sessions for Home.
src/features/home/ui/WidgetCanvas.tsx / WidgetFrame.tsx
Own ephemeral canvas-chat focus, contained wheel gestures, lifecycle, and header-only drag behavior.
src/features/home/ui/useWidgetDragSuppression.ts
Suppress activation after cancelled pointer gestures.
src/features/home/widgets/ChatCanvasCard.tsx
Add the interactive expanded card: project identity, bounded transcript, composer, history boundary, and card controls.
src/features/home/widgets/ChatPinWidget.tsx
Expand chat pins in place under the experiment while preserving stable default behavior.
src/features/home/widgets/catalog.ts / types.ts
Define expanded chat sizing profiles and widget integration contracts.
src/shared/i18n/locales/en/*.json / es/*.json
Add experiment, card action, history-boundary, loading, and unavailable copy.
Changed test files
Cover composer parity and admission, bounded exchange projection, transcript retention, route neutrality, renderer ownership, experiment registration, layout persistence, multi-card lifecycle, drag/scroll/focus behavior, and bounded-history performance.