Skip to content

Deck creation flow: match design + Listen/Speak fixes + card images - #12

Merged
jvsena42 merged 20 commits into
mainfrom
fix/deck-creation-flow
Jun 18, 2026
Merged

Deck creation flow: match design + Listen/Speak fixes + card images#12
jvsena42 merged 20 commits into
mainfrom
fix/deck-creation-flow

Conversation

@jvsena42

Copy link
Copy Markdown
Owner

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 in shared, UI in composeApp.

Deck creation flow (paste → triage → publish)

  • Create-deck now always starts at Paste-to-import (h9wya); fixed the empty-state/CTA routing.
  • Triage / Review-cards step (U92Nh) — keep / discard / edit / approve-all per card.
  • Publish (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.
  • Paste preview (MJ1SR) — bottom orange Next button.
  • Cover-change button uses a Material image icon (not an emoji).

Image selection (cEXuT / OQ2QL / vU2cv)

  • Reusable ImagePickerSheet: Unsplash web search + gallery (system photo picker), filled "Done" pill.
  • Web images saved as a URL ref; gallery images compressed (≤1024px JPEG) and uploaded as blobs.
  • Front + back card images in both the triage editor (creation flow) and the Edit Card screen, via a shared CardSideEditor that matches the design's white card + "Add image" pill / thumbnail-preview.

Study — Listen & Speak (w1CAm / aLoMj / sIqOr / BlcXn)

  • Fixed the label bug (both buttons read "Speak") → Listen (peach) + Speak (purple); front card shows neither.
  • Mic permission is now requested from the Speak button, with a Toast when recognition is unavailable / permission denied (previously failed silently).
  • Solid-purple Listening sheet mic; back-card image avatar.

Schema

  • Additive: listen_enabled / speak_enabled on the manifest, optional url on media refs (schema stays v1, forward/backward compatible).

Polish

  • Reduced Edit Card side-card elevation; centered top-bar titles across the deck-creation flow.

Testing

  • :shared unit tests + detektAll green; composeApp assembles.
  • Verified on emulator: full paste → triage → publish, Listen/Speak names + permission + unavailable feedback, front/back card image selection, centered titles.
  • Journeys 02/07/08/09 recorded in journeys/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.so rebuild, validated on-device — tracked separately.

🤖 Generated with Claude Code

jvsena42 and others added 20 commits June 16, 2026 20:34
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>
@jvsena42
jvsena42 merged commit 825fcaf into main Jun 18, 2026
2 checks passed
@jvsena42
jvsena42 deleted the fix/deck-creation-flow branch June 18, 2026 22:00
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