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

Introduce SpeziPersonalInfo target #20

Merged
merged 14 commits into from
Nov 3, 2023
Merged

Introduce SpeziPersonalInfo target #20

merged 14 commits into from
Nov 3, 2023

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Nov 1, 2023

Introduce SpeziPersonalInfo target

♻️ Current situation & Problem

Previously, SpeziViews was treated like a catch all for any UI-component-based API interfaces. This PR introduces SpeziPersonInfo that paves the way for a more granular grouping of UI components. In this PR we move out any UI components that deal with personal information. There might be future additions coming from a SpeziAccount refactoring.

This brings some breaking changes, where we removed the NameFields view and instead replaced it with new optimized views NameTextField and NameFieldRow. These address specific parts of a PersonNameComponents and remove a lot of the complexity like focus state handling. As you now can directly access the individual TextFields, this can be more cleanly handled by the users themselves.

Further this PR removes the unused HTMLView (and DocumentView). MarkdownView remains.

This PR updates the project to target a deployment target of iOS 17 and migrates to use the new String Catalogs. We made sure to use the explicit init(verbatim:) initializer for Text views where necessary. We exposed similar functionality with our LazyText und Label views. External parameters were changed and induce a breaking change.

⚙️ Release Notes

  • The new SpeziPersonalInfo target is the entry point for all View components that deal with personal information.
  • The NameFields view was removed and replaced with row-based views NameTextField and NameFieldRow.
  • The HTMLView and DocumentView were removed.
  • New initializer argument labels for LazyText and Label views.
  • Added Documentation Catalogs to structure documentation more clearly.
  • Upgraded to use String Catalogs.
  • Updated target platform to iOS 17.

📚 Documentation

The PR adds documentation catalogs to both targets which were previously missing. Through these documentation catalogs we create a structure that allows to more easily explore SpeziViews and SpeziPersonalInfo packages. Certain documentation was optimized to more clearly communicate the technical details.

✅ Testing

Testing was update to separate functionality of the two new targets to provide a clear separation between both.

📝 Code of Conduct & Contributing Guidelines

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

@Supereg
Copy link
Member Author

Supereg commented Nov 1, 2023

@PSchmiedmayer are there any other changes we want to bring to SpeziViews?

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 improvements, looks great! 👍

Sources/SpeziViews/Views/Text/LazyText.swift Show resolved Hide resolved
Sources/SpeziViews/Views/Text/TextContent.swift Outdated Show resolved Hide resolved
@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Nov 2, 2023
@PSchmiedmayer PSchmiedmayer linked an issue Nov 2, 2023 that may be closed by this pull request
1 task
@vishnuravi
Copy link
Member

Nice work @Supereg!

@PSchmiedmayer
Copy link
Member

@PSchmiedmayer are there any other changes we want to bring to SpeziViews?

Oh, sorry, missed the message here. The main thing would be the re-organization that we alluded to in our meeting yesterday but that might be a separate PR but maybe something we address before we tag a new breaking release?

@Supereg Supereg changed the title Upgrade to String Catalogs Introduce SpeziPersonInfo target Nov 2, 2023
@Supereg Supereg changed the title Introduce SpeziPersonInfo target Introduce SpeziPersonalInfo target Nov 2, 2023
@Supereg
Copy link
Member Author

Supereg commented Nov 2, 2023

@PSchmiedmayer as discussed I extended the scope of the PR to start with splitting SpeziViews into multiple targets. As this substantially changed the scope of the PR, I just re-requested a review from you. Looking through the updated PR description should give you a good overview of the updated scope.

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.

Looks great, thank you for the work here!

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #20 (38d7e18) into main (4b7cc42) will decrease coverage by 2.14%.
The diff coverage is 73.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
- Coverage   75.47%   73.33%   -2.14%     
==========================================
  Files          23       21       -2     
  Lines         856      686     -170     
==========================================
- Hits          646      503     -143     
+ Misses        210      183      -27     
Files Coverage Δ
...ources/SpeziPersonalInfo/Fields/NameFieldRow.swift 100.00% <100.00%> (ø)
Sources/SpeziPersonalInfo/UserProfileView.swift 100.00% <ø> (ø)
...eziViews/Environment/DefaultErrorDescription.swift 100.00% <ø> (ø)
...Views/Environment/ProcessingDebounceDuration.swift 50.00% <ø> (ø)
Sources/SpeziViews/Model/ViewState.swift 97.83% <100.00%> (ø)
...urces/SpeziViews/Utilities/AnyLocalizedError.swift 87.50% <ø> (ø)
...iViews/Utilities/StringProtocol+Localization.swift 0.00% <ø> (-66.66%) ⬇️
Sources/SpeziViews/ViewModifier/OnTapFocus.swift 0.00% <ø> (-87.50%) ⬇️
Sources/SpeziViews/Views/Text/TextContent.swift 100.00% <100.00%> (ø)
Sources/SpeziViews/Views/Drawing/CanvasView.swift 88.61% <0.00%> (ø)
... and 5 more

... and 1 file with indirect coverage changes


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 4b7cc42...38d7e18. Read the comment docs.

@Supereg Supereg merged commit b27cb60 into main Nov 3, 2023
7 checks passed
@Supereg Supereg deleted the feature/ios17-upgrade branch November 3, 2023 03:31
Supereg added a commit that referenced this pull request Nov 6, 2023
# Add PersonalInfo and Validation to SPI documentation targets

## ♻️ Current situation & Problem
#20 and #21 introduced additional documentation targets. This PR adds
them to the spi.yml such that the Swift Package Index properly builds
them.


## ⚙️ Release Notes 
* Configured new documentation targets to be exported to SPI.


## 📚 Documentation
--


## ✅ Testing
--

## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use String Catalogues
3 participants