Conversation
Add sliding playground layout (SimpleSidebar + sliding container + store) and toolbar button integration to open it directly + chat header/session components and hooks (SessionSelector, SessionRename, ChatHeaderTitle, use-get-flow-id, playgroundStore).
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
WalkthroughIntroduces a comprehensive chat playground feature with build duration tracking, session management, and new UI components for message rendering, input handling, and chat headers. Includes backend timing updates and frontend store/hook integration for playground state. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatInput
participant SendMessage as useSendMessage
participant FlowAPI as Build Flow API
participant EventManager
participant FlowStore
participant MessageCache
participant UI
User->>ChatInput: Type & Send Message
ChatInput->>SendMessage: sendMessage(inputValue, files)
SendMessage->>MessageCache: addUserMessage (placeholder)
MessageCache->>UI: Update cache (user msg)
SendMessage->>FlowStore: setBuildStartTime(now)
SendMessage->>FlowAPI: buildFlow(input, session)
FlowAPI->>EventManager: Emit build_start
EventManager->>FlowStore: Record startTime
FlowAPI->>EventManager: Emit add_message/token
EventManager->>MessageCache: handleMessageEvent (update)
MessageCache->>UI: Stream bot message
FlowAPI->>EventManager: Emit build_end + build_duration
EventManager->>FlowStore: setBuildDuration(ms)
EventManager->>MessageCache: updateMessageProperties (duration)
EventManager->>FlowAPI: Persist duration (PUT)
FlowAPI-->>SendMessage: Complete
UI->>User: Display final message + timing
sequenceDiagram
participant UI as Playground UI
participant Header as ChatHeader
participant SessionMgmt as useEditSessionInfo
participant SessionAPI
participant Cache as Message Cache
participant Store as PlaygroundStore
UI->>Header: Render with sessions
Header->>SessionMgmt: handleDelete/handleRename
SessionMgmt->>SessionAPI: Delete/Update session
SessionAPI-->>SessionMgmt: Success
SessionMgmt->>Store: setSelectedSession (if active)
SessionMgmt->>Cache: clearSessionMessages (if deleted)
Cache-->>UI: Clear old session msgs
Store-->>UI: Update selection
UI->>Header: Reflect changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…n chat header and session selector
…w into playground-main-fork
…one (#11576) * fix(frontend): resolve session rename bugs and prevent message loss * fix(playground): Fix session rename not showing messages immediately * [autofix.ci] apply automated fixes * fix(playground): Eliminate duplicate logic in session-selector --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
fix: pass renameLocalSession to ChatHeader to fix session rename creating new session The session rename from the chat header's more menu was creating a new session instead of renaming the existing one. This was because renameLocalSession was not being passed to useEditSessionInfo in chat-header.tsx. - Added renameLocalSession to ChatHeaderProps type - Pass renameLocalSession from flow-page-sliding-container to ChatHeader - Pass renameLocalSession to useEditSessionInfo in chat-header
…#11592) * fix(frontend): prevent menu stacking and ensure proper close behavior * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix: update Basic Prompting test to use specific test IDs for playground combobox * fix: skip voice assistant interaction test for review * test: skip voice-assistant tests pending playground refactor
* fix: update Basic Prompting test to use specific test IDs for playground combobox
* fix: skip voice assistant interaction test for review
* test: skip voice-assistant tests pending playground refactor
* fix: update Financial Report Parser and Image Sentiment Analysis tests
- Financial Report Parser: Use stop_building_button instead of button-stop
(which doesn't exist in playground chat input), wait for it to appear
before waiting for hidden state, and use div-chat-message instead of
.markdown selector which was matching node descriptions
- Image Sentiment Analysis: Replace unreliable dispatchEvent("drop") with
setInputFiles() for file upload, add proper flow completion wait, and
use img[alt$="chain.png"] to handle server timestamp prefix
…on fullscreen mode (#11596) fix(frontend): prevent duplicate session creation when renaming in non-fullscreen mode
Memory Chatbot:
- Replace fragile selectors (getByRole, getByLabel) with data-testid
- Use chat-header-more-menu and message-logs-option for message logs
- Replace .isVisible() with proper expect().toBeVisible() assertions
- Simplify test by removing session deletion
Simple Agent Memory:
- Add waitForSelector for input before filling
- Use stop_building_button instead of getByRole("button", { name: "Stop" })
- Use proper wait pattern: visible → hidden for build completion
- Add user message verification with chat-message-User-* test IDs
- Add wait for div-chat-message before asserting
…ncrease timeout (#11598) * fix: tests shard 18 - Memory Chatbot and Simple Agent Memory Memory Chatbot: - Replace fragile selectors (getByRole, getByLabel) with data-testid - Use chat-header-more-menu and message-logs-option for message logs - Replace .isVisible() with proper expect().toBeVisible() assertions - Simplify test by removing session deletion Simple Agent Memory: - Add waitForSelector for input before filling - Use stop_building_button instead of getByRole("button", { name: "Stop" }) - Use proper wait pattern: visible → hidden for build completion - Add user message verification with chat-message-User-* test IDs - Add wait for div-chat-message before asserting * fix: update News Aggregator test to streamline API key handling and increase timeout * fix: refactor Pokedex Agent test for improved readability and consistency * fix: update Pokedex Agent test to correctly retrieve chat message output and adjust length expectation * fix: improve Research Translation Loop test structure and readability * fix: enhance readability and consistency in Simple Agent Memory test * fix: generalBugs-shard-9 test * fix: simplify file upload handling in limit-file-size-upload test * fix: file upload test * fix: update chat interaction test for improved sender name handling * fix: add data-testid attribute to hidden file input for improved test targeting * fix: refactor test structure for improved readability and maintainability
This branch has the incremented implementation for the playground, I have created this draft PR to keep it up to date with main until the playground is ready to be merged to main
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.