mirror of
https://github.com/yattee/yattee.git
synced 2026-11-04 10:57:18 +00:00
Let account labels call the source by its title, not its host
An account with no user-set label was named username@host everywhere it appears — the switcher menu, the settings rows, the playlist selector — which overflows a menu row the moment the host has a subdomain. The default name and the switcher's disambiguation suffixes now use the instance's title when one is set, falling back to the host as before.
This commit is contained in:
@@ -142,6 +142,13 @@ struct Instance: Identifiable, Codable, Hashable, Sendable {
|
||||
name ?? url.host ?? url.absoluteString
|
||||
}
|
||||
|
||||
/// The shortest thing that names this source to the user: its title when
|
||||
/// one is set, else its host. What account labels append after the `@`.
|
||||
var shortLabel: String? {
|
||||
if let name, !name.isEmpty { return name }
|
||||
return url.host
|
||||
}
|
||||
|
||||
/// Returns the URL string with embedded credentials stripped for safe display in the UI.
|
||||
var displayURL: String {
|
||||
guard var components = URLComponents(url: url, resolvingAgainstBaseURL: false),
|
||||
|
||||
Reference in New Issue
Block a user