| Age | Commit message (Collapse) | Author |
|
The deck list was showing all due cards without applying the
newCardsPerDay limit or review card limit (100), causing a mismatch
with the actual number of cards available in the study screen.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Defer API submission of reviews by storing them as pending. The
previous pending review is flushed when the next card is rated, and
on unmount via fire-and-forget. Undo discards the pending review and
returns to the previous card without any API call.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
countTodayNewCardReviews was using midnight (0:00) as the start of day,
inconsistent with the 3 AM study day boundary used elsewhere. Reviews
between 0:00-3:00 AM were incorrectly counted as the next day's budget.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
findDueNewCardsForStudy and findDueReviewCardsForStudy were still using
lte(cards.due, now) while findDueCards and countDueCards had been updated
to use the study day boundary in d4489f2. This caused inconsistency
between the displayed due count and actual cards returned by the study API.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Update all dependencies to latest patch/minor versions.
Explicitly specify HS256 algorithm in JWT verify to prevent
algorithm confusion attacks.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Replace built-in jotai atomFamily with jotai-family package for better
parameter-based atom family support.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Split due card fetching into new cards and review cards, applying
the deck's newCardsPerDay limit to new cards while leaving review
cards unrestricted. New cards are placed before review cards in
the response.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Reduce layout shift during data loading by using content-shaped
skeleton placeholders instead of generic spinners in DeckDetailPage,
DeckCardsPage, and StudyPage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Instead of comparing due timestamps exactly (card.due <= now), compare
against the next 3 AM boundary so all cards due within the current
study day appear at once. This prevents new cards from trickling in
throughout the day when FSRS fuzz spreads due times.
https://claude.ai/code/session_01FeDztLcyGofd6nxh8ct7a3
|
|
|
|
Prevent cards with similar intervals from always appearing on the same
day by enabling ts-fsrs built-in fuzz factor.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Allow continuous study flow by pressing Space repeatedly - first to
flip the card, then to rate as Good (3).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Replace custom createReloadableAtom/createReloadableAtomFamily with
atomWithSuspenseQuery from jotai-tanstack-query, leveraging TanStack
Query's built-in caching, invalidation, and Suspense support.
- Add @tanstack/query-core and jotai-tanstack-query dependencies
- Create shared QueryClient instance (src/client/queryClient.ts)
- Migrate all data atoms (decks, cards, study, noteTypes) to atomWithSuspenseQuery
- Update page components to use .data destructuring and queryClient.invalidateQueries()
- Update all test files to use QueryClient for data hydration
- Remove src/client/atoms/utils.ts (no longer needed)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add a debounced (500ms) search input using use-debounce that filters
note groups by matching card front/back content (case-insensitive).
Pagination resets to page 1 when the search query changes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Separate the card list view from the deck learning page to prevent users
from seeing cards they are about to study. The deck detail page now shows
only study statistics with a "Study Now" button and a "View Cards" link.
- Add new DeckCardsPage component at /decks/:deckId/cards for managing cards
- Simplify DeckDetailPage to show deck stats and navigation buttons
- Update routing in App.tsx with proper route ordering
- Add comprehensive tests for both pages
|
|
Display a badge with the number of cards due for study today next to
each deck name on the home page. The count is fetched along with deck
data from the API to minimize additional network requests.
|
|
Replace AuthProvider and SyncProvider with Jotai atoms for more granular
state management and better performance. This migration:
- Creates atoms for auth, sync, decks, cards, noteTypes, and study state
- Uses atomFamily for parameterized state (e.g., cards by deckId)
- Introduces StoreInitializer component for subscription initialization
- Updates all components and pages to use useAtomValue/useSetAtom
- Updates all tests to use Jotai Provider with createStore pattern
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Cards are now randomized using Fisher-Yates algorithm to improve
learning by preventing users from memorizing card order.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Show actual note types and their fields in the expected format section
instead of a hardcoded example. Fields are sorted by order.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Since import is initiated from deck context, the deck is already known
via props. Simplifies CSV format to: note_type,Field1,Field2,...
BREAKING CHANGE: CSV format changed from deck,note_type,... to note_type,...
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Replace raw fetch() calls with apiClient.rpc typed client across all
modal and page components. This provides better type safety and
eliminates manual auth header handling.
- Make handleResponse public for component usage
- Update all component tests to mock RPC methods instead of fetch
- Change POSTGRES_HOST default to kioku-db for Docker compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add client-side CSV parsing and bulk import API endpoint for importing
notes from CSV files. Supports quoted fields, newlines in values, and
escaped quotes.
- New POST /api/decks/{deckId}/notes/import endpoint for bulk creation
- CSV parser with RFC 4180 compliance
- Multi-phase import modal (upload → validate → preview → import)
- Client-side validation with per-row error reporting
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Change template input fields from single-line <input> to <textarea>
elements to support multiline content in front/back templates.
Fixes #5
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
When the refresh token fails (session expired), the ApiClient now
notifies the AuthProvider via a callback. This triggers a logout
and React state update, causing ProtectedRoute to redirect to /login.
Closes #7
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
The client session was too short because access tokens (15 min) weren't
being automatically refreshed using the refresh token (7 days). Now the
ApiClient intercepts 401 responses, attempts token refresh, and retries
the original request. This extends effective session duration to 7 days.
Closes #6
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Ensures deterministic ordering for all multi-row SELECT queries:
- deck/note/noteType findByUserId/findByDeckId: order by createdAt
- card findByNoteId: order by isReversed (normal card first)
- note field values: order by noteFieldTypeId
- sync pull queries: order by id
This guarantees consistent UI display and sync results regardless
of PostgreSQL's internal row ordering.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
The empty state sections already have create buttons in the page header,
making these inline buttons redundant.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Replace manually defined AuthResponse and User types with Hono's
InferResponseType to automatically derive types from server definitions.
This ensures client types stay in sync with server responses.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Server returns `{ error: { message, code } }` but client expected
`{ error: string, code }`, causing "[object Object]" to display
on login failure.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Eliminates duplicate configuration by building the connection URL
from POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, POSTGRES_HOST,
and POSTGRES_PORT instead of requiring a separate DATABASE_URL.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Remove ConflictResolutionItem type since resolution field was always
"server_wins" and provided no useful information. Resolution arrays
now contain entity IDs directly instead of objects.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Remove the unused "local_wins" strategy and ConflictResolverOptions
interface from ConflictResolver. The CRDT-based conflict resolution
now always uses Automerge merge with server_wins fallback when CRDT
data is unavailable. This simplifies the codebase by removing
configuration options that were never used in production.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Remove the deprecated "newer_wins" strategy from the conflict resolver
as CRDT is now the default and validated approach. The system now uses
only "crdt", "server_wins", and "local_wins" strategies.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add one-time migration script to convert existing local IndexedDB
entities to Automerge CRDT documents. Includes:
- Migration with idempotency check (runs only once)
- Batch processing option for large datasets
- Progress callback for UI feedback
- Unit tests for migration logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add comprehensive test suite covering multi-device concurrent editing:
- Two devices editing different fields (no conflicts)
- Two devices editing same field (deterministic resolution)
- Concurrent edit and delete scenarios
- Card FSRS field concurrent updates
- Incremental sync simulation
- Three-way merge scenarios
- Serialization roundtrip with concurrent edits
- Edge cases (null handling, rapid edits)
- Offline queue simulation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add crdtChanges field to sync push/pull endpoints for CRDT document
synchronization. The server now stores and retrieves CRDT binaries
from the crdt_documents table, enabling conflict-free sync between
clients.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add Drizzle migration to create the crdt_documents table with:
- UUID primary key with auto-generation
- Foreign key to users table with cascade delete
- Unique index on (user_id, entity_type, entity_id)
- Indexes for entity_type and sync_version queries
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add PostgreSQL schema for storing Automerge CRDT documents with
indexes for efficient querying by user, entity type, and sync version.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
- Store CRDT document binaries after successful push operations
- Update CRDT sync metadata (lastSyncAt, syncVersionWatermark) after sync
- Add getCrdtSyncStats(), clearCrdtState(), hasCrdtDocument() methods
- Add crdt_documents_stored event and crdtDocumentsStored to SyncResult
- Include all entity types in conflict resolution count
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
The ConflictResolver now defaults to CRDT strategy which uses Automerge
to merge local and server documents during sync conflicts. This provides
conflict-free resolution that preserves changes from both sides.
Key changes:
- Add CRDT merge methods for all entity types (deck, card, note, etc.)
- Update resolve methods to accept optional CRDT binary data
- Fall back to server_wins when CRDT data is unavailable or invalid
- Add comprehensive tests for CRDT conflict resolution scenarios
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add applyCrdtChanges function to process CRDT payloads received from
the server during pull operations. The function merges remote documents
with local ones using Automerge and stores the result in sync state.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add CRDT document generation to the sync push flow. Each pending entity
is now converted to an Automerge CRDT document and included as base64-
encoded binary in the push payload alongside the existing entity data.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add Phase 2 of the CRDT implementation:
- CRDT-aware repository wrappers for all entity types (Deck, Card, Note, etc.)
- Sync state management with IndexedDB storage for CRDT document binaries
- Base64 serialization utilities for network transport
- Comprehensive test coverage (53 new tests)
|
|
Implement document-manager.ts with core CRDT operations:
- Document creation, update, merge, save/load functions
- Conversion functions between local entities and CRDT documents
- Actor ID management for client identification
- Conflict detection utilities
Completes Phase 1 of CRDT implementation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Add CRDT document types for all entities (Deck, NoteType, NoteFieldType,
Note, NoteFieldValue, Card, ReviewLog) with LWW Register pattern.
Includes utility functions for document ID creation/parsing and metadata
management. Part of Phase 1 for CRDT-based sync implementation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
When a card is deleted, now also soft-deletes its parent Note and all
sibling cards (other cards generated from the same note). This matches
the specified behavior in the roadmap where deleting any card from a
note-based group should remove the entire note and all its cards.
Also adds tests for deletion constraint behaviors:
- NoteType deletion blocked when Notes exist
- NoteFieldType deletion blocked when NoteFieldValues exist
- Note deletion cascades to all related Cards
- Card deletion cascades to Note and sibling Cards
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
All cards now require note association - legacy card support removed.
This aligns with the note-based card architecture introduced in Phase 8.
- Add database migration for NOT NULL constraints
- Update client Dexie schema to version 3
- Remove LegacyCardItem component and legacy card handling
- Update sync schemas and type definitions
- Update all tests to use note-based cards
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|