Skip to content

Commit c49c969

Browse files
Merge pull request #108 from kirill-markin/codex/split-ios-domain-types
Split iOS flashcards domain types
2 parents dfd37a2 + d81194e commit c49c969

19 files changed

Lines changed: 1291 additions & 1259 deletions

File tree

apps/android/app/src/main/java/com/flashcardsopensourceapp/app/navigation/TopLevelDestinations.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import com.flashcardsopensourceapp.app.R
1313
/*
1414
Keep Android navigation destinations aligned with:
1515
- apps/web/src/routes.ts
16-
- apps/ios/Flashcards/Flashcards/FlashcardsTypes.swift
16+
- apps/ios/Flashcards/Flashcards/App/AppNavigationTypes.swift
1717
*/
1818

1919
sealed interface TopLevelDestination {

apps/android/data/local/src/main/java/com/flashcardsopensourceapp/data/local/model/FlashcardsModels.kt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ package com.flashcardsopensourceapp.data.local.model
33
/*
44
Keep these shared data contracts aligned with:
55
- apps/web/src/types.ts
6-
- apps/ios/Flashcards/Flashcards/FlashcardsTypes.swift
6+
- apps/ios/Flashcards/Flashcards/Cards/CardDeckTypes.swift
7+
- apps/ios/Flashcards/Flashcards/Cards/CardDeckSnapshotTypes.swift
8+
- apps/ios/Flashcards/Flashcards/Cards/TagTypes.swift
9+
- apps/ios/Flashcards/Flashcards/Cloud/CloudTypes.swift
10+
- apps/ios/Flashcards/Flashcards/Cloud/Sync/CloudSyncTypes.swift
11+
- apps/ios/Flashcards/Flashcards/Database/WorkspaceLocalTypes.swift
12+
- apps/ios/Flashcards/Flashcards/Review/FsrsTypes.swift
13+
- apps/ios/Flashcards/Flashcards/Review/ReviewTypes.swift
714
*/
815

916
data class WorkspaceSummary(
@@ -363,7 +370,7 @@ data class PersistedOutboxEntry(
363370
val operation: SyncOperation
364371
)
365372

366-
// Keep in sync with apps/backend/src/schedule.ts::FsrsCardState, apps/web/src/types.ts::FsrsCardState, and apps/ios/Flashcards/Flashcards/FlashcardsTypes.swift::FsrsCardState.
373+
// Keep in sync with apps/backend/src/schedule.ts::FsrsCardState, apps/web/src/types.ts::FsrsCardState, and apps/ios/Flashcards/Flashcards/Review/FsrsTypes.swift::FsrsCardState.
367374
enum class FsrsCardState {
368375
NEW,
369376
LEARNING,
@@ -401,7 +408,7 @@ data class DeckSummary(
401408
val updatedAtMillis: Long
402409
)
403410

404-
// Keep in sync with apps/backend/src/workspaceSchedulerSettings.ts::WorkspaceSchedulerSettings, apps/web/src/types.ts::WorkspaceSchedulerSettings, and apps/ios/Flashcards/Flashcards/FlashcardsTypes.swift::WorkspaceSchedulerSettings.
411+
// Keep in sync with apps/backend/src/workspaceSchedulerSettings.ts::WorkspaceSchedulerSettings, apps/web/src/types.ts::WorkspaceSchedulerSettings, and apps/ios/Flashcards/Flashcards/Review/FsrsTypes.swift::WorkspaceSchedulerSettings.
405412
data class WorkspaceSchedulerSettings(
406413
val workspaceId: String,
407414
val algorithm: String,
@@ -413,7 +420,7 @@ data class WorkspaceSchedulerSettings(
413420
val updatedAtMillis: Long
414421
)
415422

416-
// Keep in sync with apps/backend/src/cards.ts::Card, apps/web/src/types.ts::Card, and apps/ios/Flashcards/Flashcards/FlashcardsTypes.swift::Card.
423+
// Keep in sync with apps/backend/src/cards.ts::Card, apps/web/src/types.ts::Card, and apps/ios/Flashcards/Flashcards/Cards/CardDeckTypes.swift::Card.
417424
data class CardSummary(
418425
val cardId: String,
419426
val workspaceId: String,

apps/backend/src/workspaceSchedulerConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type SchedulerAlgorithm = "fsrs-6";
22

3-
// Keep in sync with apps/ios/Flashcards/Flashcards/FlashcardsTypes.swift::WorkspaceSchedulerSettings.
3+
// Keep in sync with apps/ios/Flashcards/Flashcards/Review/FsrsTypes.swift::WorkspaceSchedulerSettings.
44
export type WorkspaceSchedulerSettings = Readonly<{
55
algorithm: SchedulerAlgorithm;
66
desiredRetention: number;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Foundation
2+
3+
enum AIChatPresentationRequest: Hashable, Sendable {
4+
case createCard
5+
case attachCard(AIChatCardReference)
6+
}
7+
8+
struct AIChatCardReference: Hashable, Sendable {
9+
let cardId: String
10+
let frontText: String
11+
let backText: String
12+
let tags: [String]
13+
let effortLevel: EffortLevel
14+
}
15+
16+
func makeAIChatCardReference(card: Card) -> AIChatCardReference {
17+
AIChatCardReference(
18+
cardId: card.cardId,
19+
frontText: card.frontText,
20+
backText: card.backText,
21+
tags: card.tags,
22+
effortLevel: card.effortLevel
23+
)
24+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import Foundation
2+
3+
/**
4+
Keep workspace navigation aligned with web and Android:
5+
the primary destinations are Review, Progress, AI, Cards, and Settings.
6+
Decks and tags belong under workspace settings on both platforms.
7+
Web exposes account settings from the account menu, while iOS nests account
8+
settings inside the Settings tab. Android keeps the same product destinations
9+
in `apps/android/app/src/main/java/com/flashcardsopensourceapp/app/navigation/TopLevelDestinations.kt`,
10+
with nested settings destinations in `apps/android/app/src/main/java/com/flashcardsopensourceapp/app/navigation/SettingsDestinations.kt`.
11+
*/
12+
enum AppTab: Hashable, CaseIterable, Sendable {
13+
case review
14+
case progress
15+
case ai
16+
case cards
17+
case settings
18+
}
19+
20+
enum SettingsNavigationDestination: Hashable, Sendable {
21+
case currentWorkspace
22+
case device
23+
case access
24+
case accessPermissionDetail(AccessPermissionKind)
25+
case workspace
26+
case workspaceNotifications
27+
case workspaceOverview
28+
case workspaceScheduler
29+
case workspaceExport
30+
case workspaceDecks
31+
case workspaceTags
32+
case account
33+
case accountStatus
34+
case accountLegalSupport
35+
case accountOpenSource
36+
case accountAdvanced
37+
case accountServer
38+
case accountAgentConnections
39+
case accountDangerZone
40+
}

0 commit comments

Comments
 (0)