-
Notifications
You must be signed in to change notification settings - Fork 1
Fix 'Practice later' button issue #7
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
base: main
Are you sure you want to change the base?
Conversation
Fixes #6 Add logic to handle the 'Practice later' page specifically and ensure the 'B' button works correctly without requiring an additional click. * **src/widgets/gamePadQueueHandler.tsx** - Add `isPracticeLaterPage` state to track if the current slide is the 'Practice later' page. - Update `fetchCardSlide` function to set `isPracticeLaterPage` when the slide is 'PracticeLater'. - Modify `showAnswer` and `rateCard` functions to include checks for `isPracticeLaterPage`. * **src/widgets/funcs/checkNonCardSlide.ts** - Update `checkNonCardSlide` function to include a check for the 'Practice later' page. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/remnoteio/remnote-gamepad/issues/6?shareId=XXXX-XXXX-XXXX-XXXX).
WalkthroughThe changes adjust the logic handling specific slide types in two modules. The Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant G as GamepadInput
participant F as fetchCardSlide
U->>+G: Trigger gamepad input event
G->>+F: Call fetchCardSlide()
F-->>-G: Return current slide type
alt Slide equals "PracticeLater"
G->>G: Set isPracticeLaterPage = true
Note right of G: Skip showing answer/rating card
else
G->>G: Set isPracticeLaterPage = false
G->>G: Proceed with showAnswer & rateCard logic
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (5)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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 fixes the "Practice later" button issue by implementing dedicated logic for the Practice Later page and ensuring the gamepad's "B" button functions correctly without needing an extra click.
- Added isPracticeLaterPage state tracking in gamePadQueueHandler.tsx.
- Enhanced the fetchCardSlide, showAnswer, and rateCard functions to respect the Practice Later page.
- Updated checkNonCardSlide.ts to return false for a "PracticeLater" slide.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/widgets/funcs/checkNonCardSlide.ts | Added a check for the "PracticeLater" slide to filter out non-card slides appropriately. |
| src/widgets/gamePadQueueHandler.tsx | Introduced isPracticeLaterPage state and updated functions to correctly handle the Practice Later page. |
Comments suppressed due to low confidence (2)
src/widgets/gamePadQueueHandler.tsx:29
- The setter function name 'setIsCardSlide' does not clearly match the state variable 'isNonCardSlide'. Consider renaming it to 'setIsNonCardSlide' for consistency.
const [isNonCardSlide, setIsCardSlide] = useState(false);
src/widgets/funcs/checkNonCardSlide.ts:5
- [nitpick] Consider abstracting the magic string 'PracticeLater' into a well-named constant or enumeration to improve clarity and maintainability.
const practiceLaterPage = 'PracticeLater';
Fixes #6
Add logic to handle the 'Practice later' page specifically and ensure the 'B' button works correctly without requiring an additional click.
src/widgets/gamePadQueueHandler.tsx
isPracticeLaterPagestate to track if the current slide is the 'Practice later' page.fetchCardSlidefunction to setisPracticeLaterPagewhen the slide is 'PracticeLater'.showAnswerandrateCardfunctions to include checks forisPracticeLaterPage.src/widgets/funcs/checkNonCardSlide.ts
checkNonCardSlidefunction to include a check for the 'Practice later' page.For more details, open the Copilot Workspace session.
Summary by CodeRabbit