feat: mobile flashcards tab#12680
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
overas nil. This now turnsover-idinto nil, but the code still callsarrayMovewithnew-indexequal to -1, which can persist an unintended reorder instead of leaving the list unchanged. Return early unlessover-idis present and found inidsbefore 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.
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
Validation