Display speaker's talks in the speaker detail screen#417
Display speaker's talks in the speaker detail screen#417
Conversation
Agent-Logs-Url: https://github.com/paug/AndroidMakersApp/sessions/d0e10687-71d2-4d05-9059-b43c6a78a48c Co-authored-by: benju69 <2486590+benju69@users.noreply.github.com>
Agent-Logs-Url: https://github.com/paug/AndroidMakersApp/sessions/d0e10687-71d2-4d05-9059-b43c6a78a48c Co-authored-by: benju69 <2486590+benju69@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a “Talks” section to the speaker detail screen by deriving a speaker-specific session list from the sessions repository, and wires navigation from a talk card to the session detail screen.
Changes:
- Extend
SpeakerDetailsViewModel/SpeakerDetailsUiStateto include the speaker’s associated sessions. - Render a “Talks” section in
SpeakerDetailsScreenwith clickable session cards. - Wire DI + navigation callback plumbing and add a
talksstring resource.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| shared/ui/src/commonMain/kotlin/com/androidmakers/ui/speakers/SpeakerDetailViewModel.kt | Combines speaker + sessions flows and exposes sessions in UI state. |
| shared/ui/src/commonMain/kotlin/com/androidmakers/ui/speakers/SpeakerDetailsScreen.kt | Displays speaker talks as clickable cards and adds onSessionClick callback. |
| shared/ui/src/commonMain/kotlin/com/androidmakers/ui/common/navigation/AVALayout.kt | Connects speaker talk clicks to navigateToSessionDetail. |
| shared/ui/src/commonMain/kotlin/com/androidmakers/di/ViewModelModule.kt | Updates Koin wiring to inject SessionsRepository into the speaker details VM. |
| shared/ui/src/commonMain/composeResources/values/strings.xml | Adds the “Talks” section header string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| speakerResult.map { speaker -> | ||
| SpeakerDetailsUiState( | ||
| speaker = speaker, | ||
| sessions = sessionsResult.getOrDefault(emptyList()) | ||
| .filter { session -> speakerId in session.speakers } | ||
| ) | ||
| }.toLce() |
There was a problem hiding this comment.
sessionsResult.getOrDefault(emptyList()) swallows session-loading failures and makes them indistinguishable from a real “speaker has no talks” case (the talks section will simply be hidden). Consider propagating the failure into the Lce (or representing sessions as their own Lce in SpeakerDetailsUiState) so the UI can differentiate between “no talks” vs “failed to load talks” and potentially offer retry.
| speakerResult.map { speaker -> | |
| SpeakerDetailsUiState( | |
| speaker = speaker, | |
| sessions = sessionsResult.getOrDefault(emptyList()) | |
| .filter { session -> speakerId in session.speakers } | |
| ) | |
| }.toLce() | |
| speakerResult.fold( | |
| onSuccess = { speaker -> | |
| sessionsResult.map { sessions -> | |
| SpeakerDetailsUiState( | |
| speaker = speaker, | |
| sessions = sessions.filter { session -> speakerId in session.speakers } | |
| ) | |
| } | |
| }, | |
| onFailure = { throwable -> Result.failure(throwable) } | |
| ).toLce() |
|
@copilot do we have a preview of the SpeakerDetailsScreen ? If no add it. And if you can add a screenshot to the pr |
Agent-Logs-Url: https://github.com/paug/AndroidMakersApp/sessions/8ad1b52f-988f-42e0-8afb-91a6dfad042d Co-authored-by: benju69 <2486590+benju69@users.noreply.github.com>
There was no preview for
The screen renders the speaker's name, bio, social links, and then a "Talks" section with a card per session. Tapping a card navigates to the session detail screen. |
Summary
Displays the talks associated with a speaker in the speaker detail screen. When a user taps a talk card, they are navigated to the session detail screen.
Changes
SpeakerDetailViewModel: Now injectsSessionsRepositoryand combines the speaker flow with a filtered sessions flow (sessions where the speaker's ID is insession.speakers).SpeakerDetailsUiState: Addedsessions: List<Session>field.SpeakerDetailsScreen: AddedonSessionClickcallback and aSpeakerTalksSectioncomposable that renders clickableElevatedCards for each of the speaker's sessions. Added@Previewcomposables (SpeakerDetailsScreenPreviewwith talks,SpeakerDetailsScreenNoTalksPreviewwithout talks).ViewModelModule: Updated DI to passSessionsRepositorytoSpeakerDetailsViewModel.AVALayout: WiresonSessionClicktonavigator.navigateToSessionDetail(sessionId).strings.xml: Addstalksstring resource for the section header.