Skip to content

Add in-editor deck selector for the Study-tab 'Add more cards' flow#17

Merged
bootuz merged 6 commits into
mainfrom
feature/card-editor-deck-selector
Jun 5, 2026
Merged

Add in-editor deck selector for the Study-tab 'Add more cards' flow#17
bootuz merged 6 commits into
mainfrom
feature/card-editor-deck-selector

Conversation

@bootuz
Copy link
Copy Markdown
Owner

@bootuz bootuz commented Jun 5, 2026

Summary

  • The Study tab's "All caught up → Add more cards" button now opens the card editor directly (new no-arg cardForm route) instead of bouncing to the Library.
  • In this picker mode the editor shows a Deck dropdown; the user must pick a deck before Save is enabled (no pre-selection). The chosen deck is preserved across saves for rapid entry and resets when you leave the editor.
  • The Front field autofocuses on open and re-focuses after each save, so you can start typing immediately.
  • Adding a card from a deck (the existing cardForm/{deckId} route) is unchanged: fixed deck, no selector. The brand-new-user "Go to Library" button is also unchanged.

Implementation

  • CardFormViewModel: nullable deckId, pickDeck/decks/selectedDeckId state, onSelectDeck, canSave requires a deck, save() persists to the selected deck and preserves it on reset; checkNotNull(deckRepository) guard for picker mode.
  • CardFormScreen: ExposedDropdownMenuBox deck selector (mirrors the existing ApkgImportScreen idiom) + FocusRequester autofocus.
  • CardFormArgs.deckId nullable + Koin wiring; new cardForm nav route; StudyQueueScreen onAddCards callback.

Test Plan

  • ./gradlew :app:testDebugUnitTest — green (3 new picker-mode unit tests + existing fixed-deck tests)
  • ./gradlew :app:assembleDebug — debug APK builds
  • ./gradlew :app:compileDebugAndroidTestKotlin — androidTest compiles (CardFormContentTest updated)
  • Manual (emulator): Study tab → all caught up → Add more cards → editor opens with keyboard up + Front focused; Deck dropdown present; Save disabled until a deck is picked; after save the form clears, deck stays selected, Front re-focuses; back → reopening shows no deck pre-selected.

🤖 Generated with Claude Code

@bootuz bootuz merged commit 1b114b0 into main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant