-
Notifications
You must be signed in to change notification settings - Fork 0
fix(offline): make the app a pwa #16
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 transforms the application into a Progressive Web App (PWA) with offline support capabilities. The implementation moves away from a custom offline storage system to leverage modern browser APIs and query persistence for better performance and reliability.
- Configures PWA manifest and service worker for offline functionality
- Implements query persistence using TanStack Query for offline data caching
- Refactors voting and notes system to use React Query mutations instead of custom offline hooks
- Simplifies component architecture by removing offline-specific props and state management
Reviewed Changes
Copilot reviewed 63 out of 65 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | PWA configuration with service worker and manifest setup |
| src/main.tsx | Query persistence configuration for offline data caching |
| src/hooks/useOnlineStatus.ts | New hook for detecting online/offline status |
| src/components/ui/OfflineIndicator.tsx | Visual indicator for offline state |
| Multiple voting/notes components | Refactored to use React Query mutations directly |
| Multiple offline-specific files | Removed custom offline storage and related services |
Comments suppressed due to low confidence (1)
src/pages/SetDetails/SetVotingButtons.tsx:1
- The function call uses
getVoteValue(voteType)but should useconfig.valuesincevoteTypeis already the key from VOTES_TYPES array, not the actual vote value.
import { Button } from "@/components/ui/button";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <Button | ||
| variant="outline" | ||
| size="sm" | ||
| onClick={() => handleDelete(note.id)} |
Copilot
AI
Sep 5, 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.
The function handleDelete is called but not defined in scope. The function is defined after the return statement but is not accessible due to incorrect placement.
| /> | ||
| <div className="flex items-center space-x-2"> | ||
| <Button | ||
| onClick={handleSave} |
Copilot
AI
Sep 5, 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.
The function handleSave is called but not defined in scope. The function is defined after the return statement but is not accessible due to incorrect placement.
| </Button> | ||
| <Button | ||
| variant="outline" | ||
| onClick={handleCancel} |
Copilot
AI
Sep 5, 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.
The function handleCancel is called but not defined in scope. The function is defined after the return statement but is not accessible due to incorrect placement.
| </div> | ||
| ); | ||
|
|
||
| function handleVote(voteType: number) { |
Copilot
AI
Sep 5, 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.
The function handleVote is called on line 27 but is defined after the return statement, making it inaccessible. This will cause a reference error.
| const value = getVoteValue(voteType); | ||
| if (onVote && value) { | ||
| onVote(set.id, value); | ||
| async function handleVote(voteType: number) { |
Copilot
AI
Sep 5, 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.
The function handleVote is called on line 56 but is defined after the return statement, making it inaccessible. This will cause a reference error.
No description provided.