fix show song header

This commit is contained in:
2026-03-11 17:34:30 +01:00
parent 3082ae1b55
commit ce67fb4a34
3 changed files with 24 additions and 9 deletions

View File

@@ -255,6 +255,20 @@ export class ShowComponent implements OnInit, OnDestroy {
const song = showSongs[i + 1];
return song?.title ?? '';
}
public getSongKeyColumnWidth(show: Show): string {
const labels = this.orderedShowSongs(show).map(song => {
if (song.keyOriginal && song.keyOriginal !== song.key) {
return `${song.keyOriginal} -> ${song.key}`;
}
return song.key ?? '';
});
const longestLabelLength = labels.reduce((max, label) => Math.max(max, label.length), 0);
const widthInCh = Math.max(3, longestLabelLength);
return `${widthInCh}ch`;
}
}
export interface Swiper {