Implemented cross-platform track color support

This commit is contained in:
patben8 committed 2026-10-17 19:50:56 +02:00
1 parent 0605dbabe6
commit 06361a851f
38 files changed
+547 -34

No files matched your search

+10 -5
View File
@@ -169,10 +169,14 @@ export const TRACK_COLUMNS: ColumnDef<Track, any>[] = [
id: 'type',
header: 'Type',
size: 64,
cell: (c) =>
c.getValue() === 'stem' ? (
// The icon takes the track's colour tag, when it has one; otherwise both
// glyphs are neutral, so colour in this column only ever means the tag.
cell: (c) => {
const color = c.row.original.color_hex
const tint = color ? undefined : 'text-faint'
return c.getValue() === 'stem' ? (
// Stem file → stacked lines ("burger"), the usual stem glyph.
<span title="Stem file" className="text-accent">
<span title="Stem file" className={tint} style={color ? { color } : undefined}>
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" aria-label="Stem">
<rect x="3" y="6" width="18" height="2.4" rx="1.2" />
<rect x="3" y="10.8" width="18" height="2.4" rx="1.2" />
@@ -181,12 +185,13 @@ export const TRACK_COLUMNS: ColumnDef<Track, any>[] = [
</span>
) : (
// Normal audio track → music note.
<span title="Audio track" className="text-faint">
<span title="Audio track" className={tint} style={color ? { color } : undefined}>
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" aria-label="Audio">
<path d="M12 3v10.55A4 4 0 1 0 14 17V7h4V3h-6z" />
</svg>
</span>
),
)
},
}),
col.accessor('album', { id: 'album', header: 'Album', size: 180, cell: editable('album') }),
col.accessor('genre', { id: 'genre', header: 'Genre', size: 140, cell: editable('genre') }),