Conversation
- Added SaveToBank component to handle saving terms with user authentication. - Integrated CHECK_TERM_SAVED query to check if a term is already saved. - Updated FlashCard component to include SaveToBank for saving terms directly from flashcards. - Removed deprecated SaveTestButton component to streamline functionality.
…erms - Introduced BATCH_UPDATE_TERMS, UPDATE_MULTIPLE_TERMS, and SAVE_MULTIPLE_TERMS mutations to handle batch operations for saving and updating terms. - Enhanced DeckCard component to support saving multiple terms from a deck to the user's word bank with progress indication. - Updated SaveToBank component to accommodate batch saving functionality, allowing for multiple terms to be saved in a single operation.
- Replaced BATCH_UPDATE_TERMS with SAVE_MULTIPLE_TERMS for batch saving functionality. - Adjusted the mutation to include a status field for newly created terms. - Enhanced comments for clarity on batch operations.
…information - Updated SAVE_TERM mutation to accept a user parameter for tracking saved terms. - Modified SaveToBank component to pass the authenticated user's ID when saving terms. - Adjusted DeckCard component to include user information in the term saving process. - Removed batch saving functionality from SaveToBank for a streamlined single term save operation.
…ty with additional metadata - Updated SAVE_TERM mutation to include new parameters for source deck ID, source term key, source definition, sync preference, and last synced timestamp. - Modified DeckCard component to create saved term inputs with enhanced metadata for better tracking. - Adjusted SaveToBank component to accept and combine additional metadata when saving terms. - Introduced SavedTerm type definitions to standardize term input structure across components.
… saving - Added CHECK_SYNCED_DECK query to verify if a deck is already synced before saving. - Introduced CREATE_SYNCED_DECK mutation to create a record for synced decks. - Updated DeckCard component to handle synced deck checks and create synced deck records upon saving terms. - Enhanced user feedback by disabling the save button if the deck is already synced.
- Extract term bank logic into useTermBank custom hook - Create dedicated TermBankDialog component - Add proper TypeScript interfaces for GraphQL responses - Improve error handling and state management - Remove duplicate code and unused variables - Add better type safety across term bank operations This refactor improves code organization, maintainability, and type safety while keeping the same functionality. The changes follow React + GraphQL + TypeScript best practices by: - Separating concerns between UI and business logic - Using proper TypeScript types instead of any - Centralizing term bank operations in a reusable hook - Improving component composition and reusability
- Updated DeckCard component to use the term bank hook for state management - Removed local state variables for dialog and saving state - Ensured the save dialog closes properly after saving a deck - Improved progress indicator to reflect saving state from the hook This fix addresses the issue where the save confirmation dialog would not close after completing the save operation, enhancing user experience and ensuring proper state management.
- Implemented the Word Bank page to display all saved terms from the user's Word Bank. - Added GraphQL query to fetch saved terms with pagination. - Created SavedTermCard component to show term details including term, definition, language, and source deck ID. - Integrated loading and error states for better user experience. - Updated navigation to include a link to the Word Bank page.
- Created a dedicated login page to handle session expiration with a clear message. - Updated AuthContext to manage session expiration and redirect users appropriately. - Implemented Apollo Client error handling for 401 errors, triggering logout and redirecting to the login page. - Refactored App component to expose AuthContext for Apollo error handling. - Enhanced Login component to work as both a modal and standalone page. - Removed duplicate Apollo Client configuration and ensured proper context usage for navigation. - Fixed routing issues by ensuring BrowserRouter wraps the AuthContextProvider.
- Updated the hasMore calculation to check if the last fetch returned fewer than TERMS_PER_PAGE items. - Handled potential undefined values for data and saved_terms to avoid TypeScript errors.
…ent linter errors - Updated the pagination logic to correctly determine if more terms are available based on the last fetch results. - Added a state variable `hasMore` to track the availability of more results. - Removed unnecessary `component` prop from the Grid item to resolve TypeScript linter errors.
- Removed the call to open the login modal when rendering the Login component. - Consolidated navigation logic into a single useEffect to prevent duplicate redirects. - Ensured session expiry warning is still displayed when applicable.
This reverts commit ec1ae59.
This reverts commit 23f6067.
- Refactored SAVE_TERM mutation to associate saved terms with existing users by ID. - Updated SAVE_MULTIPLE_TERMS mutation to accept user ID as an object with an `id` property. - Modified GET_SAVED_TERM_KEYS query to filter by source_deck.deck_id instead of source_deck.id. - Adjusted SavedTermInput type to reflect changes in user and source_deck structures. - Enhanced SaveToBank and useTermBank components to construct mutation variables correctly. - Added validation checks for user ID and deck ID in SaveToBank component. - Resolved GraphQL validation errors related to ID types and structures.
Added a robust check in the `prepareTermsForSaving` function to ensure that terms are not saved multiple times when saving both individual terms and entire decks. This check accounts for terms in both translation directions.
…th redirect to non-existing route - Removed manual user assignment in SAVE_TERM and SAVE_MULTIPLE_TERMS mutations to rely on Directus's default user_created field. - Updated related components and hooks to eliminate userId passing. - Added "Save Deck to Term Bank" feature for created decks, allowing users to save terms directly from their decks.
- Introduced GET_DECK_BY_SHEET_ID query to retrieve deck details by ID. - Updated SAVE_TERM mutation to use deck UUID for saving terms. - Enhanced SaveToBank component to fetch deck information before saving terms. - Modified SavedTermCard to navigate using both deck ID and name. - Added GET_SAVED_TERMS query to fetch saved terms with detailed deck information. - Removed deprecated savedTerms queries and updated types accordingly.
…on based on translateMode
Open
- Updated `useTermBank` to ensure terms are saved with the correct target language. - Removed reliance on external packages for language checking. - Adjusted logic in `FlashCard` to correctly determine and pass the target language. - Ensured that the `language` field in saved terms reflects the target language instead of defaulting to English.
Added checks to ensure `deck.Language1` and `deck.Language2` are strings before calling `toLowerCase()`. This prevents potential runtime TypeErrors and ensures consistent behavior when determining the target language for the Word Bank.
…okups The `getLanguageCode` function's direct lookup for language codes was failing due to case mismatches. The mapping of language names to ISO 639-1 codes has been updated to use lowercase keys, improving the efficiency of exact matches.
- Created SavedTermsReview component to facilitate the review of saved terms. - Integrated state management for tracking current term, user responses, and session progress. - Added functionality to fetch saved terms using GraphQL queries. - Implemented flashcard UI for displaying terms and definitions with user interaction. - Enhanced user experience with session progress tracking and response recording.
# Conflicts: # src/layouts/Main.tsx
- Added a dropdown to select the review direction (English → Translation or Translation → English) in the ReviewSession configuration. - Updated flashcard display logic to reflect the selected review direction.
…e UI with flashCard - Introduced AutoSpeakToggle for enabling automatic speech of questions during review sessions. - Added StackedFlashCard component for improved flashcard UI, allowing users to reveal answers and pronounce questions. - Updated ReviewSession to integrate new components and manage auto-speak preferences. - Enhanced exit confirmation dialog to support dynamic titles and labels based on review context. - Refactored styles for review page to utilize shared flashcard styles.
Owner
Author
|
bugbot run |
- Updated SaveToBank component to use 'network-only' fetch policies for improved data consistency. - Modified ReviewSession hook to accept userId as a parameter, ensuring user-specific data is fetched. - Enhanced useReviewSession to include userToken in the context for secure API requests. - Updated WordBankPage to implement 'network-only' fetch policies and include authorization headers for data operations. temp
Owner
Author
|
bugbot run |
…ession Aligns the header casing with other GraphQL requests to ensure consistent authentication handling and avoid potential failures caused by case-sensitive HTTP header checks.
There was a problem hiding this comment.
Bug: Vite Alias Change Breaks Existing Imports
The Vite alias for 'hooks' was changed from src/hooks.ts to src/hooks (a directory). This breaks existing imports, such as import { useAppSelector, useAppDispatch } from 'hooks' (found in files like Header.tsx and UserHome.tsx), because they now attempt to resolve to src/hooks/index.ts, which does not exist, causing compilation errors.
vite.config.ts#L20-L21
Lines 20 to 21 in 76fd1d6
Was this report helpful? Give feedback by reacting with 👍 or 👎
…ries # added utils/srs.ts with SM-2 algorithm # enriched saved_terms schema usage (next_review_at, interval, ease_factor, repetition) # new/update GraphQL ops: SAVE_TERM, UPDATE_SRS_DATA, GET__DUE_SAVED_TERMS # created/updated SRS defaults on term save & bulk import # enhanced review flow (useReviewSession, UI) to fetch only due cards, apply SM-2, and persist results # guarded CHECK_TERM_SAVED with auth token via lazy query to avoid public-role validation errors # updated TypeScript types to include SRS fields #fixed date/string scalar mismatch in due-term queries # BREAKING CHANGE: existing saved_terms rows need SRS fields populated (or use null-is-due filter)
Owner
Author
|
bugbot review |
Owner
Author
|
bugbot run |
Added a check to skip the GraphQL query in the useReviewSession hook until the authentication state is fully loaded and a valid user token is available. This prevents validation errors caused by unauthenticated requests after a full-page refresh.
• removed unused imports, props and state:
– SaveToBank: `createSavedTermInput`, `metadata`
– useTermBank: `userId` prop
– useReviewSession: `userId` prop and `responses` state
– Review/index: unused React import
• updated call-sites to match new hook signatures (DeckCard, ReviewSession)
• adjusted WordBank page for MUI v7:
– replaced deprecated `item={true}` usage
– introduced temporary `MGrid` alias (typed as any) to bypass strict Grid typings
• build now completes successfully (`yarn predeploy` passes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.