Repository navigation
fix(app): the live row counts named people, not diarization ids - #23379
Conversation
Raw speaker ids are per-session diarization labels; a long live session hands out hundreds, so Home read "343 people". Count the owner plus speakers resolved to the user's people, the same participants the live page header names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e986a2174
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// the people list changes; the row itself rebuilds every second for its clock. | ||
| int _peopleCount(CaptureProvider capture) { | ||
| final people = context.read<PeopleProvider?>()?.people ?? SharedPreferencesUtil().cachedPeople; | ||
| final key = Object.hash(capture.segmentsPhotosVersion, identityHashCode(people)); |
There was a problem hiding this comment.
Invalidate the count when the people list mutates
When a recognized person is deleted during a live session, PeopleProvider.deletePersonProvider and deletePeople mutate the existing people list in place. Its identity and the transcript version therefore remain unchanged, so this cache keeps returning the old count on every clock rebuild and the row can continue showing the deleted person until another transcript update occurs. Key the cache on a people-list revision/content change or make these mutations replace the list.
Useful? React with 👍 / 👎.
| final key = Object.hash(capture.segmentsPhotosVersion, identityHashCode(people)); | ||
| if (_peopleKey != key) { | ||
| _peopleKey = key; | ||
| _people = EpisodePresentation.participants(capture.segments, people, context.l10n).length; |
There was a problem hiding this comment.
Count recognized person IDs rather than display names
When two distinct recognized people share a display name—possible after renaming because the people rename endpoint does not enforce name uniqueness—EpisodePresentation.participants collapses them into its Set<String>. Taking that list's length therefore reports the owner plus one person instead of the owner plus both recognized people. Derive the numeric count from distinct personId values plus the owner rather than from the deduplicated header labels.
Useful? React with 👍 / 👎.
What
Home's live row said "Live · 10s · 343 people". It counted distinct raw speaker ids in the live transcript, and those ids are per-session diarization labels: a long session hands out hundreds. It now counts the people the transcript actually names (the owner plus speakers resolved to the user's people), the same list the live page header shows. The count appears only when at least two people are named.
Regression from #23366 (A4a live row), reported by David on TestFlight 1.0.573.
Tests
test/widgets/episodes_ui_test.dart: 40 unnamed voices never show a people count. 22 tests in the episode and Home suites pass.Failure-Class: FC-generated-presentation-contract-bypass
UI-Evidence: none -- removes a wrong count from an existing row; no layout change
Risk
Client-only, a one-line count change. Rollback is a revert.
🤖 Generated with Claude Code