mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 09:08:54 -04:00
fix(addons): drop the repeated title from the Voice Library and Text to speech pages
The add-on shell already titles the page "Voice", so these two tabs showed a second heading below it ("Speech voices", "Speak text"). Keep the supporting line, as the Studio and recognition pages do, and remove the unused title strings. The e2e spec now checks that each tab has exactly one h1, the shell title.
Assisted-by: Claude Code:claude-sonnet-5-5 node playwright
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
4 files changed
+13
-4
No files matched your search
@@ -56,7 +56,8 @@ export function createSpeech(ctx) {
|
||||
|
||||
return (
|
||||
<main className="page vc-speech" data-testid="voice-speech">
|
||||
<ui.PageHeader title={t('speech.title')} supporting={t('speech.lede')} />
|
||||
{/* The add-on shell already titles the page. */}
|
||||
<ui.PageHeader supporting={t('speech.lede')} />
|
||||
{tabs}
|
||||
<label className="vc-field">
|
||||
<span>{t('speech.model')}</span>
|
||||
|
||||
@@ -365,8 +365,9 @@ JSON`
|
||||
|
||||
return (
|
||||
<main className="page voice-library-page" data-testid="voice-library">
|
||||
{/* The add-on shell already titles the page, so this header carries the
|
||||
supporting line and the actions only. */}
|
||||
<ui.PageHeader
|
||||
title={<>{t('voiceLibrary.title')} <span className="dk-hubtab-count">{profiles.length}</span></>}
|
||||
supporting={t('voiceLibrary.subtitle')}
|
||||
actions={(
|
||||
<div className="idn-speech__acts">
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
export default {
|
||||
"voice.adminOnly.title": "Administrators only",
|
||||
"voice.adminOnly.text": "Saved voices can be managed by an administrator of this server. Ask one if you need a voice added or removed.",
|
||||
"speech.title": "Speak text",
|
||||
"speech.lede": "Turn text into speech with a voice model of this server.",
|
||||
"speech.model": "Model",
|
||||
"speech.voice": "Voice",
|
||||
@@ -158,7 +157,6 @@ export default {
|
||||
"tts.voiceLibrary.create": "Create one",
|
||||
"tts.voiceLibrary.manage": "Manage Personality Library",
|
||||
"tts.voiceLibrary.namedVoiceHint": "This model does not accept reference-audio profiles. You can still enter a named speaker supported by its backend.",
|
||||
"voiceLibrary.title": "Speech voices",
|
||||
"voiceLibrary.subtitle": "A recording and its exact transcript. Text-to-speech models that accept reference audio can speak with it.",
|
||||
"voiceLibrary.loadFailed": "Speech voices could not be loaded",
|
||||
"voiceLibrary.loading": "Loading saved personalities…",
|
||||
|
||||
@@ -307,6 +307,13 @@ async function expectVoiceTabs(page, active) {
|
||||
await expect(tabs.locator('[aria-selected="true"]')).toHaveAttribute('data-tab', active)
|
||||
}
|
||||
|
||||
// The add-on shell shows the one title, "Voice"; the Library and Text to speech
|
||||
// pages do not repeat it with a heading of their own.
|
||||
async function expectOneVoiceTitle(page) {
|
||||
await expect(page.getByRole('heading', { level: 1 })).toHaveCount(1)
|
||||
await expect(page.getByRole('heading', { name: 'Voice', exact: true, level: 1 })).toBeVisible()
|
||||
}
|
||||
|
||||
test.describe('Add-on navigation: the Voice recognition page', () => {
|
||||
test('the Voice add-on draws the recognition tab with the core test ids', async ({ page }) => {
|
||||
await setup(page, { apps: [voiceApp()] })
|
||||
@@ -367,6 +374,7 @@ test.describe('Add-on navigation: the Voice recognition page', () => {
|
||||
await expect(page).toHaveURL(/\/app\/addons\/voice\/voice\/library$/)
|
||||
await expect(page.getByTestId('voice-library')).toBeVisible()
|
||||
await expectVoiceTabs(page, 'library')
|
||||
await expectOneVoiceTitle(page)
|
||||
|
||||
await page.getByTestId('voice-library-new').first().click()
|
||||
await expect(page).toHaveURL(/\/app\/addons\/voice\/voice\/library\/new$/)
|
||||
@@ -377,6 +385,7 @@ test.describe('Add-on navigation: the Voice recognition page', () => {
|
||||
await expect(page).toHaveURL(/\/app\/addons\/voice\/voice\/speech$/)
|
||||
await expect(page.getByTestId('voice-speech')).toBeVisible()
|
||||
await expectVoiceTabs(page, 'speech')
|
||||
await expectOneVoiceTitle(page)
|
||||
|
||||
await tabs.getByRole('tab', { name: /^From a recording$/ }).click()
|
||||
await expect(page).toHaveURL(/\/app\/addons\/voice\/voice\/recording$/)
|
||||
|
||||
Reference in new issue
Block a user