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

fix(web): rating stars accessibility #11966

Merged
merged 7 commits into from
Aug 23, 2024
Merged

fix(web): rating stars accessibility #11966

merged 7 commits into from
Aug 23, 2024

Conversation

ben-basten
Copy link
Member

@ben-basten ben-basten commented Aug 21, 2024

Description

Fixes #11829

Fixes the user feedback from Discord

Accessibility improvements include:

  • using native HTML radio buttons for star interactivity, which allows for predictable keyboard navigation
  • only a single tab stop for the stars
  • visible focus ring around focused star
  • "Clear ratings" button to set ratings back to 0, if desired. According to the previous PR, it looks like there's no way to "reset" ratings
  • add labels to each individual star and the grouping of stars, so the screen reader will announce what they are

Other improvements:

Changed the focusOutside Svelte action to also trigger if the relatedTarget is falsy. This means that scenarios like clicking outside of the browser window are handled, and it allows the action to function as a standalone equivalent to the clickOutside action.

The downside is that a tabindex needs to be added to the container that focusOutside is used with, to guarantee that all mouse clicks inside of the container have a relatedTarget when focus changes.

This is an important change to guarantee that the focus ring around the stars behaves like real focus, and never gets stuck on a star when the user clicks away from the immich window.

How Has This Been Tested?

  • VoiceOver screen reader testing for Safari, Firefox, Chrome
  • Test other usages of focusOutside Svelte action to check that they still work as expected

Screenshots (if appropriate):

No stars selected

no-stars

Stars selected

2-stars

@ben-basten ben-basten changed the title fix(web): ratings star accessibility fix(web): rating stars accessibility Aug 21, 2024
@ben-basten ben-basten marked this pull request as ready for review August 22, 2024 03:44
Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I think we talked about clearing actually sending back null instead of zero.

@stumpigit
Copy link
Contributor

Thank you very much for these adjustments. We have already had some discussions about this in PR #11580 . I think these are clear improvements.
Would it also be possible to check that PR #11829 is taken into account? If the component is readonly, the hover effect should not work. That would be great.

@ben-basten
Copy link
Member Author

ben-basten commented Aug 22, 2024

Would it also be possible to check that PR #11829 is taken into account? If the component is readonly, the hover effect should not work. That would be great.

@stumpigit Thanks for bringing attention to this! Yes, the radio buttons are disabled and the hover animation is turned off in read-only mode. The setHoverRating method does this.

I indicated the #11829 will be fixed in the PR description.

@ben-basten
Copy link
Member Author

I think we talked about clearing actually sending back null instead of zero.

@jrasm91 I totally agree - it would be preferred to be able to completely reset any changes made to the star rating, rather than setting it to 0.

When I try allowing nulls on the server, I'm seeing type errors from the ExifTool because Rating only allows numeric inputs:

const exif = _.omitBy<Tags>(
{
Description: description,
ImageDescription: description,
DateTimeOriginal: dateTimeOriginal,
GPSLatitude: latitude,
GPSLongitude: longitude,
Rating: rating,
},
_.isUndefined,
);

I'm not sure how to resolve this, do you have thoughts about how to proceed? There's a similar comment about this on the previous PR:

#11580 (comment)

@jrasm91
Copy link
Contributor

jrasm91 commented Aug 22, 2024

I think when star rating is null it needs to be deleted from the sidecar file itself. I'm not sure how exactly to do that. One option, if that isn't really doable, is to write zero, but map that to null when we read it and put it in the database

@ben-basten
Copy link
Member Author

ben-basten commented Aug 22, 2024

@jrasm91 I built a proof of concept with the nullable ratings. Here's a diff comparing it to the PR branch:

fix/ratings-a11y...ben/null-rating-poc

When the exiftool processes a null rating, it completely removes Rating from the sidecar file. This means that the ratings data will go back to being sourced from the original file, rather than being overwritten by the sidecar.

If the original file has a rating of null or 0, this is a non-issue. However, this becomes a confusing experience if the original file has a non-zero rating, and clicking the "Clear ratings" button repopulates the rating stars based on the original file's metadata.

With this in mind, I think that it makes the most sense to reset the stars with 0, because this most accurately matches the user intention when clearing ratings. It also means the empty rating would be maintained if a user ever moved their data to a different service.

What do you think about sticking with sending 0 to clear the ratings?

@jrasm91
Copy link
Contributor

jrasm91 commented Aug 22, 2024

I am fine writing 0 to the sidecar to imply null, but I think we should have null in the database for search purposes.

Is it possible to:

  • send null in the API
  • write null to the database
  • map null to 0 when writing tags
  • map 0 to null when reading tags

Copy link
Member Author

@ben-basten ben-basten left a comment

Choose a reason for hiding this comment

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

Thanks for the context, that's very helpful! I haven't explored the server code much, so I'll do some digging to find a solution for this.

@jrasm91
Copy link
Contributor

jrasm91 commented Aug 23, 2024

Thanks for the context, that's very helpful! I haven't explored the server code much, so I'll do some digging to find a solution for this.

I'm happy to implement the server changes if you want. Just let me know. I can always do it in a sister PR as well.

@ben-basten
Copy link
Member Author

ben-basten commented Aug 23, 2024

I'm happy to implement the server changes if you want. Just let me know. I can always do it in a sister PR as well.

Yes, I will take you up on that. Whether it's in a separate PR or not is ok by me - if you do a sister PR, I can update the frontend to send nulls this weekend.

Thanks for the help!

@jrasm91 jrasm91 merged commit c14e291 into main Aug 23, 2024
23 checks passed
@jrasm91 jrasm91 deleted the fix/ratings-a11y branch August 23, 2024 16:34
calvinbui added a commit to calvinbui/ansible-monorepo that referenced this pull request Sep 1, 2024
…0 (#2857)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/immich-app/immich-machine-learning](https://github.com/immich-app/immich) | minor | `v1.112.1-cuda` -> `v1.113.0-cuda` |
| [ghcr.io/immich-app/immich-server](https://github.com/immich-app/immich) | minor | `v1.112.1` -> `v1.113.0` |

---

### Release Notes

<details>
<summary>immich-app/immich (ghcr.io/immich-app/immich-machine-learning)</summary>

### [`v1.113.0`](https://github.com/immich-app/immich/releases/tag/v1.113.0)

[Compare Source](immich-app/immich@v1.112.1...v1.113.0)

##### v1.113.0

> \[!WARNING]
>
> ## Breaking changes
>
> For **OAuth users**, please replace `app.immich:/` with `app.immich:///oauth-callback` for the Redirect URI in your OAuth provider settings

##### Highlights

Welcome to release `v1.113.0` of Immich! This is one of the biggest releases yet, introducing some of the most requested features since the early days of Immich. Let's dive right into what we have in place for this release:

-   Folder view
-   Tags
-   Timeline improvements
-   Library refresh stability
-   Mobile album sync

##### Folder view

You can now browse your photos and videos by folder like in a file explorer. You can use the storage template migration feature for the best experience with uploaded assets in this view.

This feature is especially useful for scanned photos, which are difficult to put in a timeline. It has been a long-requested feature.

You can enable this feature from the `Users Settings > Features > Folders`.

![folder-enabled](https://github.com/user-attachments/assets/aab4a16a-0888-49de-b51a-785ef557261a)

The UI is currently only available for the web; mobile will come in a subsequent release.

![folder](https://github.com/user-attachments/assets/2786da30-83b3-4168-bb98-180dad53a6a4)

![folder-2](https://github.com/user-attachments/assets/163a3ee8-3c3d-4c98-abb6-9c94eb4b362c)

##### Tags

Immich now supports hierarchical tags, with the ability to read existing tags from the `TagList` and `Keywords` exif properties. Any changes to tags made through Immich are also written back to a sidecar file. You can re-run the metadata extraction jobs for all assets to import your existing tags.

You can enable this feature from the `Users Settings > Features > Tags`.

![tag-enabled](https://github.com/user-attachments/assets/20a7a99e-13f6-46f2-8744-20dd95d8456b)

The UI is currently only available for the web; mobile will come in a subsequent release.

https://github.com/user-attachments/assets/d543f531-4b0e-4dcf-8918-e76c7f1b288b

##### Timeline improvements

This release introduces a rewrite of the web timeline component. It can now handle a large number of assets in a single day or month and has been successfully tested with a very large data set (over a million assets). Photographers frequently request this since they can easily take thousands of photos in a given day.

With these performance improvements, you'll see fewer placeholders while loading, which will make for a more fluid scrolling and scrubbing experience.

##### Library refresh stability

In relation to the previous point, the stability of library scanning has improved. Previously, you could run out of memory when starting a refresh with libraries containing millions of assets. Now, we queue the refresh jobs in batches. These enhancements won't make scanning go any faster, but they greatly reduce the likelihood of out-of-memory errors that would cause Immich to crash.

##### Mobile album sync

You can now sync or mirror an album from your phone to the Immich server on your account. For example, if you select `Recents`, `Camera` and `Videos` album for backup, the corresponding album with the same name will be created on the server. Once the assets from those albums are uploaded, they will be put into the target albums automatically.

You can enable this feature from the album selection in the backup screen.

<img src="https://github.com/user-attachments/assets/67b329f5-15ff-4128-af52-4a50df852a07" width="300" alt="sync-album"/>

For existing installations, you can sync the already uploaded assets by going to the backup screen and pressing the `Sync` button.

<img src="https://github.com/user-attachments/assets/ca0847fd-edab-4ebe-b8e1-093ce7e3cc37" width="300" alt="sync-button"/>

Have a wonderful weekend,

Cheers!

***

##### Support Immich

<p align="center">
<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExbjY2eWc5Y2F0ZW56MmR4aWE0dDhzZXlidXRmYWZyajl1bWZidXZpcyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/87CKDqErVfMqY/giphy.gif" width="450" title="SUPPORT THE PROJECT!">
</p>

If you find the project helpful, you can support Immich by purchasing a product key at <https://buy.immich.app>.

Cheers! 🍻

<!-- Release notes generated using configuration in .github/release.yml at main -->

##### What's Changed

##### 🚨 Breaking Changes

-   feat(server): granular permissions for api keys by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#11824
-   refactor(server): stacks by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#11453
-   fix(server): album statistics endpoint by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#11924
-   fix: remove `asset.resized` by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#11983
-   fix(mobile): use a valid OAuth callback URL by [@&#8203;qrkourier](https://github.com/qrkourier) in immich-app/immich#10832

##### 🚀 Features

-   feat: folder view by [@&#8203;davidakerr](https://github.com/davidakerr) in immich-app/immich#11880
-   feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position by [@&#8203;midzelis](https://github.com/midzelis) in immich-app/immich#10646
-   feat: loading screen, initSDK on bootstrap, fix FOUC for theme by [@&#8203;midzelis](https://github.com/midzelis) in immich-app/immich#10350
-   feat(mobile): preserve mobile album info on upload by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#11965
-   feat: tags by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#11980
-   feat(web): jump to timeline by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#12117

##### 🌟 Enhancements

-   feat(server): do not automatically download android motion videos by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#11774
-   feat(web): pasting coordinates by [@&#8203;michelheusschen](https://github.com/michelheusschen) in immich-app/immich#11866
-   feat(web): drag and drop or paste directories for upload by [@&#8203;simkli](https://github.com/simkli) in immich-app/immich#11879
-   feat(web): Left hand navigation for memories by [@&#8203;carlesalbasboix](https://github.com/carlesalbasboix) in immich-app/immich#11913
-   feat(web): my immich shortcut by [@&#8203;danieldietzler](https://github.com/danieldietzler) in immich-app/immich#12007
-   fix(web): show a clearer confirmation message when deleting an unnamed album by [@&#8203;Snowknight26](https://github.com/Snowknight26) in immich-app/immich#11988
-   feat(format): nrw format by [@&#8203;avsm](https://github.com/avsm) in immich-app/immich#12048
-   feat(web): restore scroll position on navigating back to search page by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#12042
-   feat(server): Storage template support album condition by [@&#8203;feyst](https://github.com/feyst) in immich-app/immich#12000
-   fix(mobile): Changes in the UI for the image editor pages by [@&#8203;Yuvi-raj-P](https://github.com/Yuvi-raj-P) in immich-app/immich#12018
-   feat(web): announce notifications to screen readers by [@&#8203;ben-basten](https://github.com/ben-basten) in immich-app/immich#12071
-   fix(server): don't crash when refreshing large libraries by [@&#8203;etnoy](https://github.com/etnoy) in immich-app/immich#7934
-   feat(server): sort images in duplicate groups by date by [@&#8203;GeoffreyFrogeye](https://github.com/GeoffreyFrogeye) in immich-app/immich#12094
-   feat(ml): support dynamic scaling by [@&#8203;rkojedzinszky](https://github.com/rkojedzinszky) in immich-app/immich#12065
-   feat(web): navigate assets with gestures (next/prev) by [@&#8203;kaziu687](https://github.com/kaziu687) in immich-app/immich#11888
-   fix(mobile): allow create empty non-shared albums, add proper button colors by [@&#8203;src52](https://github.com/src52) in immich-app/immich#12103
-   feat: user's features preferences by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#12099
-   chore(server): log path when generating external thumbnail by [@&#8203;etnoy](https://github.com/etnoy) in immich-app/immich#12107

##### 🐛 Bug fixes

-   fix(web): focus trap inside portal by [@&#8203;michelheusschen](https://github.com/michelheusschen) in immich-app/immich#11797
-   fix(mobile): show correct notification icon for android by [@&#8203;karthikraja001](https://github.com/karthikraja001) in immich-app/immich#11863
-   fix(web): show camera make in search options after searching by [@&#8203;michelheusschen](https://github.com/michelheusschen) in immich-app/immich#11884
-   fix(web): correctly populate the camera model search dropdown by [@&#8203;Snowknight26](https://github.com/Snowknight26) in immich-app/immich#11883
-   fix(server): create shared album from the mobile app does not trigger send email invite by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#11911
-   fix(server): do not match live photos across libraries by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#11952
-   fix(web): rating stars accessibility by [@&#8203;ben-basten](https://github.com/ben-basten) in immich-app/immich#11966
-   fix(mobile): Fix for incorrectly naming edited files and structure change by [@&#8203;Yuvi-raj-P](https://github.com/Yuvi-raj-P) in immich-app/immich#11741
-   fix: align camera model drop down behavior with other drop downs on web and mobile by [@&#8203;x24git](https://github.com/x24git) in immich-app/immich#11951
-   fix(web): announce current theme to screen reader users by [@&#8203;ben-basten](https://github.com/ben-basten) in immich-app/immich#12039
-   fix(web): show supporter badge for account less than 14 days by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#12058
-   fix(web): shared link expiration date accessibility by [@&#8203;ben-basten](https://github.com/ben-basten) in immich-app/immich#12060
-   chore(web): ignore shortcut toggle when entering email and password by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#12082
-   chore(web): ensure goto is awaited for login page by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#12087
-   fix(server): ensure new exclusion patterns work by [@&#8203;etnoy](https://github.com/etnoy) in immich-app/immich#12102
-   fix(server): skip smtp validation if unchanged by [@&#8203;michelheusschen](https://github.com/michelheusschen) in immich-app/immich#12111
-   fix(mobile): long waiting time for login request when server is unreachable by [@&#8203;alextran1502](https://github.com/alextran1502) in immich-app/immich#12100
-   fix: user specific fields in asset search by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#12125
-   fix(web): Device list shows Ubuntu as unknown OS by [@&#8203;spfncer](https://github.com/spfncer) in immich-app/immich#12127
-   fix(web): reset asset grid after changing album order by [@&#8203;michelheusschen](https://github.com/michelheusschen) in immich-app/immich#12139

##### 📚 Documentation

-   fix(docs): read-only affects XMP writing by [@&#8203;C-Otto](https://github.com/C-Otto) in immich-app/immich#11823
-   docs: clarify external domain setting by [@&#8203;pikapower9080](https://github.com/pikapower9080) in immich-app/immich#11958
-   docs: add Immich Kiosk and Immich Power Tools to Community Projects by [@&#8203;Tyree](https://github.com/Tyree) in immich-app/immich#12055
-   docs: mTLS/self signed FAQ entry by [@&#8203;mmomjian](https://github.com/mmomjian) in immich-app/immich#12074
-   docs: external library deletion/edits by [@&#8203;mmomjian](https://github.com/mmomjian) in immich-app/immich#12079
-   docs: sql query for duplicate files by [@&#8203;mmomjian](https://github.com/mmomjian) in immich-app/immich#12086
-   docs: Documentation updates by [@&#8203;aviv926](https://github.com/aviv926) in immich-app/immich#11516
-   docs: update roadmap by [@&#8203;jrasm91](https://github.com/jrasm91) in immich-app/immich#12126
-   fix: README_zh_CN.md link by [@&#8203;ttzytt](https://github.com/ttzytt) in immich-app/immich#12124
-   docs(guide): nginx caching proxy by [@&#8203;pcouy](https://github.com/pcouy) in immich-app/immich#12140

##### New Contributors

-   [@&#8203;aaronjrodrigues](https://github.com/aaronjrodrigues) made their first contribution in immich-app/immich#11851
-   [@&#8203;karthikraja001](https://github.com/karthikraja001) made their first contribution in immich-app/immich#11863
-   [@&#8203;simkli](https://github.com/simkli) made their first contribution in immich-app/immich#11879
-   [@&#8203;carlesalbasboix](https://github.com/carlesalbasboix) made their first contribution in immich-app/immich#11907
-   [@&#8203;pikapower9080](https://github.com/pikapower9080) made their first contribution in immich-app/immich#11958
-   [@&#8203;davidakerr](https://github.com/davidakerr) made their first contribution in immich-app/immich#11880
-   [@&#8203;x24git](https://github.com/x24git) made their first contribution in immich-app/immich#11951
-   [@&#8203;Tonux599](https://github.com/Tonux599) made their first contribution in immich-app/immich#12027
-   [@&#8203;avsm](https://github.com/avsm) made their first contribution in immich-app/immich#12048
-   [@&#8203;Tyree](https://github.com/Tyree) made their first contribution in immich-app/immich#12055
-   [@&#8203;feyst](https://github.com/feyst) made their first contribution in immich-app/immich#12000
-   [@&#8203;Tiefseetauchner](https://github.com/Tiefseetauchner) made their first contribution in immich-app/immich#11874
-   [@&#8203;qrkourier](https://github.com/qrkourier) made their first contribution in immich-app/immich#10832
-   [@&#8203;GeoffreyFrogeye](https://github.com/GeoffreyFrogeye) made their first contribution in immich-app/immich#12094
-   [@&#8203;rkojedzinszky](https://github.com/rkojedzinszky) made their first contribution in immich-app/immich#12065
-   [@&#8203;kaziu687](https://github.com/kaziu687) made their first contribution in immich-app/immich#11888
-   [@&#8203;src52](https://github.com/src52) made their first contribution in immich-app/immich#12103
-   [@&#8203;spfncer](https://github.com/spfncer) made their first contribution in immich-app/immich#12127
-   [@&#8203;ttzytt](https://github.com/ttzytt) made their first contribution in immich-app/immich#12124

**Full Changelog**: https://github.com/immich-app/immich/compare/v1.112.1...

</details>

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OC4wIiwidXBkYXRlZEluVmVyIjoiMzguNTguMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Calvin Bui <[email protected]>
Reviewed-on: https://gitea.bui.ng/calvinbui/ansible-monorepo/pulls/2857
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Star rating for unowned asset is read-only but appears writable
3 participants