{"agent":"claude","input":"Add optimistic updates to comment creation and deletion in the React app in apps/react-vite and open a pull request. Read package.json, src/lib/react-query.ts, src/types/api.ts, src/lib/auth.tsx, src/features/comments/api/get-comments.ts, create-comment.ts and delete-comment.ts, src/features/comments/components/comments-list.tsx, create-comment.tsx and delete-comment.tsx, src/testing/test-utils.tsx, src/testing/mocks/handlers/comments.ts and src/app/routes/app/discussions/__tests__/discussion.test.tsx first. In useDeleteComment add onMutate that cancels queries for the comments key, snapshots the infinite query data and removes the comment from every page with setQueryData; restore the snapshot and add an error notification in onError; invalidate in onSettled. In useCreateComment insert a placeholder comment with a nanoid id, Date.now() as createdAt and the current user as author at the top of the first page, and swap it for the server's comment on success. Keep both hooks wrapping the caller's onSuccess as they do now so the drawer, dialog and success notifications still work; do not change component markup. Add tests beside discussion.test.tsx: a delete that disappears before the mocked request resolves, a failed delete that restores the comment and shows the error notification, and a create that appears at once. From apps/react-vite run yarn test, yarn lint, yarn check-types and yarn build, and put their output in the pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}