Files
DemonGatanjieuandClaude Opus 5.5 cae7fd2a4a Audio gallery becomes a view of Voices; the rail fits the number keys
With the AI workbench the rail had ten entries for nine number keys, so
the audio gallery had none. It is now the third tab of Voices (Characters,
Voice-over, Audio); 9 reopens Voices on the view used last, and a test
keeps the rail within nine entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 20:26:31 +08:00

32 lines
1.2 KiB
JavaScript

/**
* The Voices page's three views as one switch at the top of each: Characters (the cards,
* ui_audio_studio.js, shell page `voices`), Voice-over (ui_script_page.js, shell page
* `script`) and Audio (ui_audio_gallery.js, shell page `audio-gallery`). All sit under the
* rail's Voices entry and share the list column.
*/
import { t } from './interface_settings.js';
const TABS = [['voices', 'voiceTabCharacters'], ['script', 'scriptDirectorTitle'], ['audio-gallery', 'shellAudioGallery']];
/** The switch; `active`: 'voices' | 'script' | 'audio-gallery'. */
export function renderVoiceTabs(owner, active) {
const bar = document.createElement('div');
bar.className = 'anomalous-voice-tabs';
bar.setAttribute('role', 'tablist');
for (const [page, key] of TABS) {
const tab = document.createElement('button');
tab.type = 'button';
tab.className = 'anomalous-voice-tab';
tab.textContent = t(key);
tab.dataset.tour = `voice-tab-${page}`;
tab.setAttribute('role', 'tab');
tab.setAttribute('aria-selected', String(page === active));
tab.onclick = () => {
if (page !== active) owner?.goTo(page);
};
bar.append(tab);
}
return bar;
}