feat(decks): iOS-26 tabViewBottomAccessory für „Neues Deck"-Pille
Ersetzt den bottomBar-„+"-Button auf iOS 26 durch eine schwebende Liquid-Glass-Pille via `.tabViewBottomAccessory`, nur sichtbar wenn der Decks-Tab aktiv ist. iOS 18-Geräte behalten den bestehenden bottomBar-Button (gated via `if #unavailable(iOS 26.0)`). `showCreate` wandert als Binding von DeckListView nach RootView, damit das Accessory den Sheet triggern kann. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0e90f4b1c1
commit
6805bd78c7
2 changed files with 57 additions and 10 deletions
|
|
@ -18,9 +18,10 @@ struct DeckListView: View {
|
|||
@Environment(\.modelContext) private var context
|
||||
@Query(sort: \CachedDeck.updatedAt, order: .reverse) private var decks: [CachedDeck]
|
||||
|
||||
@Binding var showCreate: Bool
|
||||
|
||||
@State private var store: DeckListStore?
|
||||
@State private var showAccount = false
|
||||
@State private var showCreate = false
|
||||
@State private var pendingShares: [PendingShare] = []
|
||||
@State private var path = NavigationPath()
|
||||
|
||||
|
|
@ -235,7 +236,7 @@ struct DeckListView: View {
|
|||
Label("Noch keine Decks", systemImage: "rectangle.stack")
|
||||
.foregroundStyle(CardsTheme.foreground)
|
||||
} description: {
|
||||
Text("Tippe oben auf »+«, um dein erstes Deck zu erstellen, oder browse den Marketplace im Entdecken-Tab.")
|
||||
Text("Tippe unten auf »+«, um dein erstes Deck zu erstellen, oder browse den Marketplace im Entdecken-Tab.")
|
||||
.foregroundStyle(CardsTheme.mutedForeground)
|
||||
}
|
||||
}
|
||||
|
|
@ -245,14 +246,21 @@ struct DeckListView: View {
|
|||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .topBarLeading) {
|
||||
Button {
|
||||
showCreate = true
|
||||
} label: {
|
||||
Image(systemName: "plus.circle")
|
||||
.foregroundStyle(CardsTheme.primary)
|
||||
// Auf iOS 26 übernimmt das `.tabViewBottomAccessory` aus RootView die
|
||||
// „Neues Deck"-Pille. Doppelten „+"-Button im Liquid-Glass-Layout
|
||||
// vermeiden — bottomBar-Button nur auf iOS < 26 zeigen.
|
||||
if #unavailable(iOS 26.0) {
|
||||
ToolbarItemGroup(placement: .bottomBar) {
|
||||
Button {
|
||||
showCreate = true
|
||||
} label: {
|
||||
Label("Deck hinzufügen", systemImage: "plus")
|
||||
.labelStyle(.iconOnly)
|
||||
.foregroundStyle(CardsTheme.primary)
|
||||
}
|
||||
.accessibilityLabel("Deck hinzufügen")
|
||||
Spacer()
|
||||
}
|
||||
.accessibilityLabel("Deck hinzufügen")
|
||||
}
|
||||
ToolbarItem(placement: .topBarTrailing) {
|
||||
Button {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue