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

Add InfoButton for list rows #50

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Add InfoButton for list rows #50

merged 7 commits into from
Dec 18, 2024

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Dec 15, 2024

Add InfoButton for list rows

♻️ Current situation & Problem

This PR adds a new icon-only InfoButton that is useful in List views to provide additional context to a row element.

⚙️ Release Notes

  • Added new InfoButton.

📚 Documentation

Added the new button to the documentation catalog.

✅ Testing

Tested via UI tests.

📝 Code of Conduct & Contributing Guidelines

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

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 75.44%. Comparing base (292a5ac) to head (d4cc1af).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/SpeziViews/Views/List/ListHeader.swift 87.81% 5 Missing ⚠️
Sources/SpeziViews/Views/Button/InfoButton.swift 82.61% 4 Missing ⚠️
Sources/SpeziValidation/ValidationEngine.swift 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   74.91%   75.44%   +0.54%     
==========================================
  Files          52       54       +2     
  Lines        1586     1657      +71     
==========================================
+ Hits         1188     1250      +62     
- Misses        398      407       +9     
Files with missing lines Coverage Δ
...tion/ValidationState/CapturedValidationState.swift 100.00% <100.00%> (ø)
...on/ValidationState/ReceiveValidationModifier.swift 100.00% <100.00%> (ø)
...SpeziViews/Views/Controls/CaseIterablePicker.swift 69.50% <ø> (ø)
Sources/SpeziValidation/ValidationEngine.swift 93.83% <0.00%> (ø)
Sources/SpeziViews/Views/Button/InfoButton.swift 82.61% <82.61%> (ø)
Sources/SpeziViews/Views/List/ListHeader.swift 87.81% <87.81%> (ø)

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 292a5ac...d4cc1af. Read the comment docs.

@Supereg Supereg force-pushed the feature/list-info-button branch from be12cbb to d4cc1af Compare December 15, 2024 21:57
Copy link
Member

@philippzagar philippzagar left a comment

Choose a reason for hiding this comment

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

Nice addition!

@Supereg Supereg merged commit 69b0857 into main Dec 18, 2024
14 checks passed
@Supereg Supereg deleted the feature/list-info-button branch December 18, 2024 08:08
Supereg added a commit to StanfordSpezi/SpeziDevices that referenced this pull request Dec 23, 2024
# Decompose Nearby Device Row

## ♻️ Current situation & Problem
The `NearbyDeviceRow` was a monolith-style view that encompassed all
functionality without a lot of configuration possibilities to vitalizes
a nearby device in, e.g., a Bluetooth scanning view. This design is not
really flexible if you want to show your own information or want to
adjust the layout. Previously you were forced to write your own view
completely from scratch. This PR decomposes the view into multiple
subview allowing you to build your custom `NearbyDeviceRow`-like
experience without reinventing the wheel completely. The new
`PeripheralLabel`, `PeripheralSecondaryLabel`, and `InfoButton` views
(see StanfordSpezi/SpeziViews#50) allow you to
fully customize the appearance of your `NearbyDeviceRow`.


## ⚙️ Release Notes 
* Decompose the `NearbyDeviceRow` into `PeripheralLabel`,
`PeripheralSecondaryLabel`, and `InfoButton` views for greater
customizability.


## 📚 Documentation
Added new views to the DocC documentation target.


## ✅ Testing
The new tests are implicitly tested via the `NearbyDeviceRow`.


## 📝 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).
Supereg added a commit that referenced this pull request Jan 19, 2025
# improve `onPreferenceChange` closure MainActor handling

## ♻️ Current situation & Problem
In response to Apple changing the `onPreferenceChange` API to no longer
MainActor-constrain its closure parameter,
#48 and
#50 updated all
`onPreferenceChange` calls to either schedule the change onto the
MainActor, or (in some cases) check if the closure is being called on
the MainActor, and then run it directly.

This PR fixes this, by using the `runOrScheduleOnMainActor` function
from SpeziFoundation


## ⚙️ Release Notes 
- Improve MainActor interactions in `onPreferenceChange` closures.


## 📚 Documentation
n/a


## ✅ Testing
There are no dedicated new tests but these changes do in fact fix tests
elsewhere.

## 📝 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).

---------

Co-authored-by: Andreas Bauer <[email protected]>
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.

2 participants