fix: include current shared link expiry date as default select option #23665
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When editing a shared link with an expiry date of e.g. 'in 7 days', the 'Expire after' dropdown is disabled and shows 'never', instead of 'in 7 days'. The ux for changing that date, or not, is not so intuitive with the switch to enable changing the date. I added the current expiry date, if it's not 'never', to the option list and set it as selected. That way, it's clear to the user nothing would be changed per se, but it's also easy to change it when you want to do so.
If you agree with these changes I'll try to port them to mobile as well.
Not 100% happy about the solution for overwriting the
expiryOptionstate; I got a svelte warning about that, but not sure how to best handle.Fixes #22147
How Has This Been Tested?
Screenshots (if appropriate)
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
None