Improve gradient-colored name parsing in ChannelListComponent and add scroll support in the channel list UI.

This commit is contained in:
akastijn 2026-08-01 22:20:39 +02:00
parent 73ea715b01
commit 6a52d27c09
4 changed files with 31 additions and 17 deletions

1
.gitignore vendored
View File

@ -93,3 +93,4 @@ liquibase*.properties
node
.env
virtual_view/*

View File

@ -1,5 +1,6 @@
<div class="channel-list">
<p>Channels</p>
<div class="scroll">
@for (group of groupedChannels(); track group.type) {
<p class="channel-group-title" (click)="toggleGroup(group.type)">
{{ group.type }} {{ collapsedGroups().has(group.type) ? '▼' : '▲' }}
@ -24,3 +25,4 @@
}
}
</div>
</div>

View File

@ -45,3 +45,7 @@
user-select: none;
}
}
.scroll {
overflow: scroll;
}

View File

@ -69,7 +69,7 @@ export class ChannelListComponent {
}
protected parseColoredName(name: string): ColoredNameSegment[] {
const markerRegex = /\{#([0-9a-fA-F]{6})([<>]?)}/g;
const markerRegex = /\{#([0-9a-fA-F]{6})(<>|[<>]?)}/g;
const segments: ColoredNameSegment[] = [];
let currentColor: string | undefined;
let gradientStartColor: string | undefined;
@ -94,6 +94,13 @@ export class ChannelListComponent {
currentColor = markerColor;
gradientStartColor = undefined;
gradientStartSegmentIndex = undefined;
} else if (markerType === '<>') {
if (gradientStartColor !== undefined && gradientStartSegmentIndex !== undefined) {
this.applyGradient(segments, gradientStartSegmentIndex, gradientStartColor, markerColor);
}
currentColor = markerColor;
gradientStartColor = markerColor;
gradientStartSegmentIndex = segments.length;
} else {
currentColor = markerColor;
gradientStartColor = undefined;