Repository navigation
fix: Fix event detail closing on the first event detail opening - #248
Merged
Merged
Conversation
Only emit Unavailable when the event is null. A missing calendar now keeps the Loading state instead of closing the screen. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused state-handling changes address premature closure with no identified blocking issues.
0 open findings
What changed in this PR
Fixes premature event-detail closure by distinguishing loading from a missing event.
Changes:
- Keeps the screen loading until calendar data is available, using
observeCalendar. - Reserves
Unavailablefor missing events and updates its documentation.
| File | Description |
|---|---|
| app/src/main/java/com/infomaniak/calendar/ui/screen/eventDetail/GetEventDetailUiUseCase.kt | Introduces explicit loading, missing-event, and success states. |
| app/src/main/java/com/infomaniak/calendar/ui/screen/eventDetail/EventDetailUiState.kt | Clarifies the Unavailable documentation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sirambd
requested changes
Oct 16, 2026
This can also be a normal situation which is why we don't set it as an error
|
LunarX
enabled auto-merge
October 16, 2026 08:37
sirambd
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Only emit Unavailable when the event is null. A missing calendar now keeps the Loading state instead of closing the screen.
Also fix the default value of the eventAndCalendar flow that was null and acted as a missing event.
I took this opportunity to use the new
observeCalendar(event.calendarId)exposed by KMP 0.15.0.This code will be slightly refactored soon when the state caching will live with the view model's lifecycle instead of GetEventDetailUiUseCase