Add session chat and Agent diff review#42
Conversation
…production. Clean up package-lock.json by removing extraneous entries and updating versions for several Babel packages. Adjust layout styles in MonacoEditorPage for improved responsiveness.
- Introduced a new `DiffReview` component to handle proposed changes. - Updated `App` component to manage pending diffs and handle accept/reject actions. - Modified `MonacoEditorPage` to display the `DiffReview` when there are pending diffs. - Switched server URL to local development for testing purposes.
- Configured TypeScript and JavaScript defaults to improve diagnostics handling. - Ignored specific TypeScript-only diagnostic codes when JavaScript files are processed. - Enabled JSX support and allowed JavaScript files in TypeScript settings for better compatibility.
… Close Diff View Button
| }); | ||
| window.onbeforeunload = () => { | ||
| collabApi?.leaveRoom(); | ||
| const [collabApi, setCollabApi] = useState<MonacoCollabApi | null>(null); |
There was a problem hiding this comment.
thats quite alot of state here. Could it make sense to intruduce a zustand store?
There was a problem hiding this comment.
Then maybe one could also create some component to not have all these long effects and callbacks in here
| // TS-only syntax reported as JS diagnostics when a model is classified | ||
| // as JS script kind (e.g. because its URI has no .ts/.tsx extension). | ||
| // Example: "'interface' declarations can only be used in TypeScript files." | ||
| const tsOnlyInJsCodes = [8002, 8003, 8004, 8005, 8006, 8008, 8009, 8010, 8011, 8012, 8013]; |
There was a problem hiding this comment.
wat?
Do i have to understand this? Could you maybe improve the comment i don't get what exactly this is about
jonah-iden
left a comment
There was a problem hiding this comment.
All in all seems to work great and code looks ok to me. I believe a state management library like zustand could make some of the stuff simpler.
Maybe let copilot review this as well?
Co-authored-by: Cursor <cursoragent@cursor.com>
…features - Introduced Zustand for state management in the playground, encapsulating collaboration API interactions. - Added hooks for initializing collaboration API, handling routing, and syncing proposals. - Updated the App component to utilize the new state management and hooks, improving code organization and readability. - Added Zustand store to manage application state, including user authentication, page navigation, and pending diffs. - Updated package dependencies to include Zustand and Zustand middleware for better state handling.
spoenemann
left a comment
There was a problem hiding this comment.
Please add basic documentation comments to keep the codebase better maintainable, particularly to the new hooks and to more complex components. Otherwise good to go.
Adds two features to the OCT Playground:
Session chat (SessionChat.tsx) — real-time chat for everyone in a room, wired to the OCT connection's chat channel. Resolves peer names, shows a typing indicator, tags direct messages, and degrades gracefully when the client/server lacks chat support.
Diff review (DiffReview.tsx, wired in App.tsx / MonacoEditorPage.tsx) — a side-by-side Monaco diff overlay for changes proposed by an Agent or peer. Supports Accept/Reject diffs, and detects when the file changed in the background (showing a "Close diff" action instead). Proposal lifecycle is synced across peers via closeProposal, cancelProposal, and onCloseProposal.
Test plan: