-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add WebSocket and Telegram services #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes WebSocket and Telegram functionality into reusable React context providers, moving from utility functions to a service-based architecture with proper context management.
- Creates WebSocketProvider and TelegramProvider contexts to manage shared state and functionality
- Migrates existing lib utilities to services with backward-compatible re-exports
- Updates components to use the new service hooks for better dependency injection
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/services/websocket.tsx | Implements WebSocketProvider context and useWebSocketService hook for centralized WebSocket management |
| client/src/services/telegram.tsx | Creates TelegramProvider context and useTelegram hook for Telegram SDK functionality |
| client/src/pages/tournaments.tsx | Updates to use new WebSocket and Telegram service hooks |
| client/src/pages/tournament-detail.tsx | Migrates to use Telegram service hook with proper dependency injection |
| client/src/lib/websocket.ts | Replaces implementation with re-export for backward compatibility |
| client/src/lib/telegram.ts | Replaces implementation with re-export for backward compatibility |
| client/src/App.tsx | Wraps application with new service providers |
| client/README.md | Documents the new service architecture and usage patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| } | ||
|
|
||
| const telegramService = { |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The telegramService object only exposes a subset of the available functions. Consider including all exported functions (showMainButton, hideMainButton, showAlert, hapticFeedback, etc.) for consistency, or document why only these specific functions are included in the context.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Testing
npm testnpm run lint:checknpm run type-checkhttps://chatgpt.com/codex/tasks/task_e_689d085d8ccc8327bc09bfbcfab8927a