@AppStorage lässt sich nicht animieren
Der Umschalter stand in einem `withAnimation`, und trotzdem sprang die Leiste von einer Stellung in die andere. `@AppStorage` schreibt in die Voreinstellungen und meldet die Änderung erst danach zurück — sie kommt also außerhalb der Animation an, und die Animation hat nichts, woran sie sich festhalten könnte. Jetzt führt ein Zustand dieser Ansicht, und gespeichert wird hinterher. Die Bindung an die Leisten bringt die Animation gleich mit. Nachgesehen, nicht vermutet: mit versuchsweise zwei Sekunden Dauer und einer Serienaufnahme von außen ist der Zwischenzustand fotografiert — Seitenleiste halb nach links draußen, Leiste oben im Einblenden, Inhalt auf dem Weg. Danach zurück auf knappe 0,32 Sekunden. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9a5412dc5d
commit
5b2d902cd9
@@ -178,7 +178,7 @@ struct FlixySidebar: View {
|
||||
|
||||
if !isEditing {
|
||||
Button {
|
||||
withAnimation(.snappy(duration: 0.25)) { placement = .top }
|
||||
placement = .top
|
||||
} label: {
|
||||
Image(systemName: "rectangle.topthird.inset.filled")
|
||||
.font(.flixyRowHeader)
|
||||
@@ -337,7 +337,7 @@ struct FlixyTopBar: View {
|
||||
var body: some View {
|
||||
HStack(spacing: FlixySpacing.tight) {
|
||||
Button {
|
||||
withAnimation(.snappy(duration: 0.25)) { placement = .sidebar }
|
||||
placement = .sidebar
|
||||
} label: {
|
||||
Image(systemName: "sidebar.leading")
|
||||
.font(.flixyBody)
|
||||
|
||||
Reference in New Issue
Block a user