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

Use the new #Preview macro #44

Merged

Conversation

NikolaiMadlener
Copy link
Collaborator

@NikolaiMadlener NikolaiMadlener commented Oct 19, 2023

Use the new #Preview macro

♻️ Current situation & Problem

As partially described in #23, currently all previews of views are written the old way using the PreviewProvider protocol.
The new #Preview macro, introduced with iOS 17, should be used in every view instead.

⚙️ Release Notes

  • Update all previews of the TemplateApplication using the new #Preview` macro.
  • Update minimum deployment targets to iOS 17.0

📚 Documentation

  • No need for previews.

✅ Testing

  • No need for previews.

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

NikolaiMadlener and others added 3 commits October 18, 2023 15:53
adapt deployment target to iOS 17;
adjust onChange modifiers because of depreciation
@NikolaiMadlener
Copy link
Collaborator Author

NikolaiMadlener commented Oct 19, 2023

Just a very small update to take advantage of the new #Previews macro as I've been working on the TemplateApplication these days anyway.

Also, #23 mentions that some views in the app crash or are non-existent. I found all previews working fine while updating to the macro, so I guess that information is outdated @PSchmiedmayer?

I'm also thinking about a solution for StanfordSpezi/Spezi#63 atm.

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #44 (3a56947) into main (e88698d) will increase coverage by 1.00%.
The diff coverage is 83.34%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   81.59%   82.58%   +1.00%     
==========================================
  Files          35       35              
  Lines         999      987      -12     
==========================================
  Hits          815      815              
+ Misses        184      172      -12     
Files Coverage Δ
TemplateApplication/Account/AccountButton.swift 100.00% <100.00%> (ø)
...mplateApplication/Account/AccountSetupHeader.swift 100.00% <ø> (ø)
TemplateApplication/Account/AccountSheet.swift 97.83% <ø> (+12.93%) ⬆️
...eApplication/Contributions/ContributionsList.swift 100.00% <ø> (ø)
...emplateApplication/Contributions/PackageCell.swift 86.49% <ø> (ø)
TemplateApplication/Home.swift 100.00% <ø> (ø)
TemplateApplication/MockUpload/MockUpload.swift 92.31% <ø> (ø)
...lateApplication/Onboarding/AccountOnboarding.swift 88.89% <ø> (ø)
TemplateApplication/Onboarding/Consent.swift 94.12% <ø> (ø)
...eApplication/Onboarding/HealthKitPermissions.swift 95.56% <ø> (ø)
... and 8 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e88698d...3a56947. Read the comment docs.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Sorry for the delay in the review and thank you for the great additions and bringing #Preview in the template app @NikolaiMadlener!

The PR looks good and is well structured, I only had a few smaller comments and suggestions for improvements across different files.

Let me know and feel free to re-request a review once you have resolved the different comments and/or if you have any questions 👍

TemplateApplication/Account/AccountRequiredModifier.swift Outdated Show resolved Hide resolved
TemplateApplication/Contacts/Contacts.swift Show resolved Hide resolved
TemplateApplication/Contributions/PackageCell.swift Outdated Show resolved Hide resolved
TemplateApplication/Contributions/PackageCell.swift Outdated Show resolved Hide resolved
TemplateApplication/Schedule/EventContextView.swift Outdated Show resolved Hide resolved
TemplateApplication/Schedule/EventContextView.swift Outdated Show resolved Hide resolved
TemplateApplication/Schedule/ModalView.swift Outdated Show resolved Hide resolved
TemplateApplication/Schedule/ModalView.swift Outdated Show resolved Hide resolved
TemplateApplication/Schedule/ScheduleView.swift Outdated Show resolved Hide resolved
Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Thank you for the chances, this looks great! Thanks for all the work and effort that went into the PR @NikolaiMadlener! 🚀

@NikolaiMadlener NikolaiMadlener merged commit 5b529c2 into StanfordSpezi:main Nov 5, 2023
7 checks passed
@NikolaiMadlener NikolaiMadlener deleted the feature/previews branch November 5, 2023 10:31
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.

None yet

2 participants