Deck creation flow: match design + Listen/Speak fixes + card images - #12
Merged
Conversation
Add listen_enabled/speak_enabled to the deck manifest and an optional url field to media refs (web images saved by URL, no blob). Add SpeakMatcher for pronunciation comparison. All additive — schema stays version 1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…aste flow Deck creation now always starts at the Paste import flow (design h9wya) — the home empty-state and Decks 'Create' no longer open the manual editor. Add a Triage/Review-cards screen (U92Nh) between paste preview and publish: keep, discard, edit, or approve-all each parsed card. ImportRepository tracks the per-row decisions and edits; publish consumes keptRows(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… speech recognizer Add platform edges (MediaProcessor + SpeechRecognizer expect/actual on Android), an Unsplash client (HttpFetcher gains header support), a reusable ImagePickerSheet (web grid via Coil + system photo picker with JPEG compression), CardMediaImage, and ImageSheetViewModel. Unsplash key flows from BuildConfig (local.properties); blank key degrades to gallery-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PublishDeckViewModel uploads a gallery cover (compressed) or saves a web URL, and persists listen/speak opt-ins; the Publish screen gains a Card Options section and an image-picker cover sheet. EditCardViewModel/Screen let a card front image be picked from gallery or web, with a removable preview chip. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nition Add Listen/Speak gating to the study session from the deck's opt-ins. The back card gains a Speak (mic) action that requests RECORD_AUDIO, records via the native SpeechRecognizer, and compares the transcript to the answer via SpeakMatcher — surfacing Listening/Correct/Wrong sheets (sIqOr/n3bMb7/BlcXn). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update journey 02 with the triage step and card-options assertions; add journeys 07 (triage edit), 08 (image select), 09 (speak study). Set testTagsAsResourceId on the image and speak bottom-sheet roots so their tags surface to UiAutomator (ModalBottomSheet renders in a separate window). Verified on emulator-5554. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…back on unavailable The card-back Listen (TTS) button was labelled "Speak" (both buttons read "Speak"), so users tapped the wrong one and the record button never asked for mic permission. Rename the TTS button to "Listen" (peach) and the practice button to "Speak" (purple) — matching design aLoMj — drop the redundant study_speak_practice string, and stop showing Listen/Speak on the card front (design w1CAm). Show the front-side image as a circular avatar on the back. Surface a Toast when speech recognition is unavailable or the mic permission is denied instead of silently returning to the card, and make the Listening sheet mic a solid purple circle (design sIqOr). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ion icons Redesign the cards-ready badge to the peach panel with a solid orange check and an "N discarded in review" subtitle (design yFOOS), make the title/description fields solid white cards, and add leading icons to the Listen (peach headphones) and Speak (purple mic) option rows. Track discardedCount in PublishDeckUiState. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…election Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ion flow The triage card editor only had text fields, so the primary create flow could not set per-card images (design vU2cv/cEXuT). Add a DraftCardImage model and per-row image storage on ImportRepository, a front+back image picker (Unsplash or gallery) to the triage editor, and resolve/upload those images when building cards at publish — mirroring the existing cover-image path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Edit Card only handled a front image; add back-side image selection/upload and move the image affordance into each card side (front + back), matching the design's per-side image action (vU2cv). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…mage pill) Replace the bordered text field + plain image button + full-width remove row with a shared CardSideEditor: a white rounded card (design vU2cv) holding the input, with the side label and a peach 'Add image' pill in the header. When an image is set the pill becomes a thumbnail preview (tap to change) with a circular remove button. Used by both the post-publish Edit Card and the paste/triage editor so they stay consistent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use CenterAlignedTopAppBar for Paste, Review cards, Edit card, and the deck editor so titles are centered (Publish already centers via its custom header). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Brings the deck-creation flow and Study Listen/Speak in line with the Pencil design (
design/main/phone-echo.pen), and adds per-card images end-to-end. Android only; business logic inshared, UI incomposeApp.Deck creation flow (paste → triage → publish)
h9wya); fixed the empty-state/CTA routing.U92Nh) — keep / discard / edit / approve-all per card.yFOOS) — peach "N cards ready" badge with solid orange check + "N discarded in review", solid white fields, Listen/Speak option rows with leading icons, Card-Options toggles, working cover Change.MJ1SR) — bottom orange Next button.Image selection (
cEXuT/OQ2QL/vU2cv)ImagePickerSheet: Unsplash web search + gallery (system photo picker), filled "Done" pill.CardSideEditorthat matches the design's white card + "Add image" pill / thumbnail-preview.Study — Listen & Speak (
w1CAm/aLoMj/sIqOr/BlcXn)Schema
listen_enabled/speak_enabledon the manifest, optionalurlon media refs (schema stays v1, forward/backward compatible).Polish
Testing
:sharedunit tests +detektAllgreen;composeAppassembles.02/07/08/09recorded injourneys/RESULTS.md.Known limitation (not fixed here)
Publishing on a physical arm64 device can panic with
expect rustls-platform-verifier to be initialized. Root cause:pkarr's internal relay client (DHT republish) uses reqwest's default verifier; the earlier TLS pin only covered the SDK's ICANN client. It does not reproduce on the x86_64 emulator, so it needs a native (pubky-sdk/pkarr) fix +libpubkycore.sorebuild, validated on-device — tracked separately.🤖 Generated with Claude Code