-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Building Sync-ups Tutorial] fixes in "Record meeting" chapter #3582
base: main
Are you sure you want to change the base?
[Building Sync-ups Tutorial] fixes in "Record meeting" chapter #3582
Conversation
Change foregroundColor to foregroundStyle. Update the delete button to use a destructive role.
and add missing Foundation import
@@ -1,4 +1,5 @@ | |||
import ComposableArchitecture | |||
import Foundation |
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.
📓 Added to compile de Date
$0.syncUp.meetings.insert( | ||
Meeting( | ||
id: UUID(0), | ||
date: Date(timeIntervalSince1970: 1234567890), | ||
transcript: "" | ||
), | ||
at: 0 | ||
) | ||
$0.$syncUp.withLock { | ||
$0.meetings = [ | ||
Meeting( | ||
id: UUID(0), | ||
date: Date(timeIntervalSince1970: 1234567890), | ||
transcript: "" | ||
) | ||
] | ||
} |
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.
📓 I've slightly change the assertion by matching the exact array of meeting to match your recommandation to test against the real result instead of mimicking the code in production.
|
||
#Preview { | ||
AppView( | ||
store: Store( | ||
initialState: App.State( | ||
syncUpsList: SyncUpsList.State() | ||
) | ||
) { | ||
App() | ||
} | ||
) | ||
} |
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.
📓 I removed this preview because it brings no special changes in the tutorial and was creating a confusing diff.
Button("Delete") { | ||
Button("Delete", role: .destructive) { |
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.
📓 These changes are here to match the changes made in previous part of the tutorial
|
||
<!-- @Image(source: <#file#>, alt: "<#accessible description#>")--> |
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.
📓 useless commented code ? 🤔
Hi!
Following my last PR, I'm currently reviewing the "Building Sync-ups" tutorial and so far, there is a lot of changes so I've splitted up into one PR per chapter to ease the review of them, finishing with the "Record meeting" chapter here…
Changes Made:
foregroundColor
toforegroundStyle
. Additionally, modified the delete button to utilize a destructive role to match previous changes.withLock
for modifying shared syncUp instances.And this should conclude this review… Thanks for your review of all these changes! 🙏
Note: When trying the last steps of the tests where we cancel the long living timer effect, my test was already passing without the cancel call. It seems to be useless now or maybe the production code had a regression on this part ? Anyway, I left it as an insightful example of how to deal with these problem which tends to occurs sometimes…