Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

FredericRuaudel
Copy link
Contributor

@FredericRuaudel FredericRuaudel commented Feb 2, 2025

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:

  • Removed unused preview and comments in the tutorial.
  • Updated the usage of foregroundColor to foregroundStyle. Additionally, modified the delete button to utilize a destructive role to match previous changes.
  • Implemented withLock for modifying shared syncUp instances.
  • Add a missing Foundation import for Date usage.

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…

@@ -1,4 +1,5 @@
import ComposableArchitecture
import Foundation
Copy link
Contributor Author

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

Comment on lines -48 to +57
$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: ""
)
]
}
Copy link
Contributor Author

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.

Comment on lines -31 to -42

#Preview {
AppView(
store: Store(
initialState: App.State(
syncUpsList: SyncUpsList.State()
)
) {
App()
}
)
}
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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

Comment on lines -5 to -6

<!-- @Image(source: <#file#>, alt: "<#accessible description#>")-->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📓 useless commented code ? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant