Skip to content

feat: mobile flashcards tab#12680

Merged
tiensonqin merged 1 commit into
masterfrom
feat/ios-flashcards
May 19, 2026
Merged

feat: mobile flashcards tab#12680
tiensonqin merged 1 commit into
masterfrom
feat/ios-flashcards

Conversation

@tiensonqin
Copy link
Copy Markdown
Contributor

@tiensonqin tiensonqin commented May 19, 2026

Summary

  • add Flashcards as a configurable mobile tab with custom tab ordering
  • move mobile flashcards card-set selection and reactive progress into the native header sheet flow
  • tune mobile flashcards layout and controls, and stabilize DnD tab reordering

Validation

  • bb dev:lint-and-test
  • bb lang:lint-hardcoded --git-changed
  • bb lang:validate-translations
  • pnpm css:mobile-build

@github-actions github-actions Bot added the :type/feature New feature label May 19, 2026
@tiensonqin tiensonqin changed the title [codex] improve mobile flashcards tab feat: mobile flashcards tab May 19, 2026
@tiensonqin tiensonqin marked this pull request as ready for review May 19, 2026 00:33
Copilot AI review requested due to automatic review settings May 19, 2026 00:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Flashcards as a configurable mobile tab and adapts the mobile flashcards experience to native tab/header flows.

Changes:

  • Introduces shared mobile tab definitions, selection limits, persistence, settings UI, and tests.
  • Adds a mobile Flashcards tab surface with native header title/selector integration.
  • Updates DnD behavior for tab ordering and mobile flashcard layout/styling.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/mobile/tabs.cljs Adds mobile tab definitions and selection/reorder helpers.
src/main/mobile/bottom_tabs.cljs Uses configurable tab definitions and persisted tab order.
src/main/mobile/components/settings.cljs Adds mobile tab picker settings UI with DnD ordering.
src/main/mobile/components/app.cljs Adds Flashcards as a mobile tab page.
src/main/mobile/components/header.cljs Integrates Flashcards title and selector into native header.
src/main/mobile/state.cljs Stores flashcards header/selector state.
src/main/frontend/extensions/fsrs.cljs Adds mobile rendering/header callbacks for flashcards.
src/main/frontend/handler/events/ui.cljs Updates desktop flashcards call signature.
src/main/frontend/components/dnd.cljs Adds touch sensor and final-order DnD handling.
src/main/frontend/spec/storage.cljc Adds storage spec for mobile tab preferences.
src/main/mobile/components/app.css Adds mobile flashcards layout styles.
src/resources/dicts/en.edn Adds mobile tabs settings label.
src/resources/dicts/zh-cn.edn Adds Chinese mobile tabs settings label.
src/test/mobile/tabs_test.cljs Adds tests for mobile tab selection/reordering rules.
src/test/mobile/navigation_test.cljs Adds test that Flashcards is a normal tab, not a dialog shortcut.
Comments suppressed due to low confidence (1)

src/main/frontend/components/dnd.cljs:67

  • When a drag is cancelled or dropped outside a sortable item, dnd-kit can provide over as nil. This now turns over-id into nil, but the code still calls arrayMove with new-index equal to -1, which can persist an unintended reorder instead of leaving the list unchanged. Return early unless over-id is present and found in ids before moving items.
                               (let [active-id (.-id ^js (.-active event))
                                     over-id (some-> ^js (.-over event) .-id)]
                                 (when active-id
                                   (when-not (= active-id over-id)
                                     (let [old-index (.indexOf ids active-id)
                                           new-index (.indexOf ids over-id)
                                           new-items (arrayMove items-state old-index new-index)]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tiensonqin tiensonqin merged commit 7efb9aa into master May 19, 2026
15 checks passed
@tiensonqin tiensonqin deleted the feat/ios-flashcards branch May 19, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:type/feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants