Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/src/pages/SongBookViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,9 @@ export default function SongBookViewer() {
<Minus size={16} />
</button>
<span className="min-w-[3.5rem] text-center text-sm text-gray-300 font-mono" title="Transpose (semitones)" role="status" aria-live="polite" aria-atomic="true">
Transpose {transpose > 0 ? `+${transpose}` : transpose} semitones
<span className="sr-only">Transpose </span>
<span>{transpose > 0 ? `+${transpose}` : transpose}</span>
<span className="sr-only"> semitones</span>
</span>
<button type="button" onClick={() => setTranspose(transpose + 1)} className={ctrlBtnClass} aria-label={`Transpose up (currently ${transpose > 0 ? '+' : ''}${transpose} semitones)`} title="Transpose up (])">
<Plus size={16} />
Expand Down
3 changes: 3 additions & 0 deletions client/src/pages/SongBookViewer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ E|--3-----|`;
const statuses = screen.getAllByRole('status');
expect(statuses.some((status) => status.textContent === 'Transpose 0 semitones')).toBe(true);
expect(screen.getByRole('button', { name: /Transpose up \(currently 0 semitones\)/ })).toBeTruthy();
// Visible offset stays numeric-only so the control keeps its compact width (#5999).
const transposeStatus = statuses.find((status) => status.textContent === 'Transpose 0 semitones');
expect(transposeStatus.querySelector('span:not(.sr-only)').textContent).toBe('0');

fireEvent.click(screen.getByRole('button', { name: /Transpose up \(currently 0/ }));
expect(screen.getAllByRole('status').some((status) => status.textContent === 'Transpose +1 semitones')).toBe(true);
Expand Down