uttrflow / uttrflow/uttrflow-swift
[P3] Reuse one initials rule for the account chip and Account page
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
The same signed-in account gets different initials in the window account chip and the Account page when its display name has three words. The two presenters independently derive initials and disagree about word boundaries and fallback values as well.
Reproduced using the production presenters on main `533e6cbef5046f8bd681246d99ebf9ef9553fa40`, with synthetic accounts and no profile picture:
| Display name | Window chip | Account page |
| --- | --- | --- |
| `Nadia Leigh Stone` | `NS` | `NL` |
| `Nadia\tStone` (tab separator) | `N` | `NS` |
| `123 456` | `14` | `?` |
| `Nadia Stone` (control) | `NS` | `NS` |
[HomePresenter.account/monogram](https://github.com/uttrflow/uttrflow-swift/blob/533e6cbef5046f8bd681246d99ebf9ef9553fa40/Sources/UttrflowUX/HomePresentation.swift#L400-L414) already obtains `AccountPagePresenter.identity(for:)`, but discards its initials and recomputes them using the first and last space-separated words. [AccountPagePresenter.initials](https://github.com/uttrflow/uttrflow-swift/blob/533e6cbef5046f8bd681246d99ebf9ef9553fa40/Sources/UttrflowUX/AccountPagePresentation.swift#L250-L256) takes the first two whitespace-separated words that begin with a letter. Existing tests independently pin both rules, so they pass while the cross-page contract disagrees.
The actual consumers draw these values directly: `AccountChip.mark` in `OrbitStage.swift` and the picture-free branch of `AvatarView`. This is a visual consistency and maintainability defect, not an authentication or account-selection failure.
Suggested fix: choose one initials policy and reuse the derived identity across these surfaces, including local-account fallback handling. Keep the chip's abbreviated display name separate if desired. Add a cross-presenter regression for a three-part name, whitespace separators, missing names and a normal two-part name; update conflicting tests to the agreed rule.
Validation: 159 original Home, Insights, Dictation and Account presentation tests passed in an isolated Swift harness using production sources. A separate cross-presenter probe failed for the three mismatch cases above and passed the two-word control. No live account, native window interaction or screenshot was used. Checked existing issues and open PRs for initials/monogram duplication; no matching report found.
Contributor guide
Research direction
Start with HomePresentation.swift lines 400-414 and AccountPagePresentation.swift lines 250-256, then inspect AccountChip.mark in OrbitStage.swift and AvatarView. Compare the existing presenter tests and choose one initials policy, including fallback handling. Add the requested cross-presenter regression for three-part, whitespace-separated, missing-name, and two-part accounts, update conflicting tests, and run the presentation test suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100