-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
ForEach(entries.indices, id: \.self) { idx in | ||
let entry = entries[idx] | ||
|
||
ForEach(entries, id: \.self) { entry in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't need the index anymore, apparently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entries should be Identifiable, so we shouldn't need the second argument at all. That would be preferable, since \.self
will consider value equality, and we would prefer to compare ID equality.
@@ -134,6 +132,7 @@ struct EntryListView: View { | |||
) | |||
} | |||
} | |||
.id(entry.address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the animations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One comment.
@@ -22,6 +22,7 @@ struct CountChip: View, Equatable { | |||
|
|||
var body: some View { | |||
Text(Self.asText(count: count)) | |||
.contentTransition(.numericText()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
ForEach(entries.indices, id: \.self) { idx in | ||
let entry = entries[idx] | ||
|
||
ForEach(entries, id: \.self) { entry in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entries should be Identifiable, so we shouldn't need the second argument at all. That would be preferable, since \.self
will consider value equality, and we would prefer to compare ID equality.
Sort / filter the notebook view. I added a few new options that occurred to me as easy and useful.
Screen.Recording.2024-04-04.at.10.59.24.AM.mov