Extract display name logic to NameFormatService, refactor colored name parsing, and improve channel list scrolling.

This commit is contained in:
2026-08-01 22:42:37 +02:00
parent 5987ee4133
commit 5be3072b26
9 changed files with 175 additions and 139 deletions
@@ -1,13 +1,17 @@
<div class="full-width"
[style.background-color]="getServerColor(selectedChannel()?.name ?? '')">
<span class="channel" [style.color]="getServerTextColor(selectedChannel()?.name ?? '')">
{{ selectedChannel()?.name }}
</span>
<div class="notification-icon">
@if (notificationEnabled()) {
<svg-notification-enabled (click)="disableNotifications()"/>
} @else {
<svg-notification-disabled (click)="enableNotifications()"/>
@if (selectedChannel(); as chatChannel) {
<div class="full-width"
[style.background-color]="getServerColor(chatChannel.name ?? '')">
<span class="channel" [style.color]="getServerTextColor(chatChannel.name ?? '')">
@for (segment of getDisplayName(chatChannel); track $index) {
<span [style.color]="segment.color">{{ segment.text }}</span>
}
</span>
<div class="notification-icon">
@if (notificationEnabled()) {
<svg-notification-enabled (click)="disableNotifications()"/>
} @else {
<svg-notification-disabled (click)="enableNotifications()"/>
}
</div>
</div>
</div>
}