Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

fix(ui): model licence dialog follows native conventions, scrolls as one area

debpalash515e2139dd31
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d31eadf29..109c6abc6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ metadata and the backend fallback mirror it.
### Fixed
+- Model licence dialog is wider and scrolls as one area with the buttons pinned, and follows macOS, Windows and Linux dialog conventions
- Older synthesized takes play again with accurate play/pause controls after a newer generation (#3102)
- Generation-complete notifications appear above the workspace instead of covering synthesis controls (#3102)
- Generated speech no longer starts and ends with silence, and `[pause]` markers give exactly the pause you asked for (Raw preset and explicit durations untouched) (#3080)
diff --git a/electron/src/renderer/src/components/bridge.ts b/electron/src/renderer/src/components/bridge.ts
index f4317510c..d1a0edbb1 100644
--- a/electron/src/renderer/src/components/bridge.ts
+++ b/electron/src/renderer/src/components/bridge.ts
@@ -14,3 +14,14 @@ export function appVersion(): string {
export function isMac(): boolean {
return getBridge()?.app.platform === 'darwin';
}
+
+export type PlatformFamily = 'mac' | 'windows' | 'linux';
+
+/** Which OS design language native-feeling UI should follow; browser tabs fall back to the user agent. */
+export function platformFamily(): PlatformFamily {
+ const platform =
+ getBridge()?.app.platform ?? (typeof navigator === 'undefined' ? '' : navigator.platform || navigator.userAgent);
+ if (platform === 'darwin' || /mac|iphone|ipad/i.test(platform)) return 'mac';
+ if (platform === 'win32' || /win/i.test(platform)) return 'windows';
+ return 'linux';
+}
diff --git a/electron/src/renderer/src/features/settings/model-licence-acceptance.test.tsx b/electron/src/renderer/src/features/settings/model-licence-acceptance.test.tsx
index 1deae0986..15f5094e1 100644
--- a/electron/src/renderer/src/features/settings/model-licence-acceptance.test.tsx
+++ b/electron/src/renderer/src/features/settings/model-licence-acceptance.test.tsx
@@ -125,6 +125,17 @@ describe('model licence acceptance', () => {
expect(acceptAll.disabled).toBe(false);
});
+ it.each([
+ ['MacIntel', 'mac'],
+ ['Win32', 'windows'],
+ ['Linux x86_64', 'linux'],
+ ])('follows the %s design language for the action row', async (nav, family) => {
+ vi.spyOn(navigator, 'platform', 'get').mockReturnValue(nav);
+ await render(<LicenceAcceptanceFooter models={[pending('a/one')]} onClose={() => {}} />);
+ expect(document.querySelector('[data-licence-acceptance]')?.getAttribute('data-platform')).toBe(family);
+ vi.restoreAllMocks();
+ });
+
it('records each model separately with the fingerprint it showed', async () => {
const onAccepted = vi.fn();
mock.api.mockResolvedValue({ accepted: true });
diff --git a/electron/src/renderer/src/features/settings/model-licence-acceptance.tsx b/electron/src/renderer/src/features/settings/model-licence-acceptance.tsx
index f8f284742..95abce9e9 100644
--- a/electron/src/renderer/src/features/settings/model-licence-acceptance.tsx
+++ b/electron/src/renderer/src/features/settings/model-licence-acceptance.tsx
@@ -9,6 +9,7 @@ import {
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
+import { platformFamily, type PlatformFamily } from '@/components/bridge';
import { ApiError, apiJson } from '@/lib/api/client';
import { cn } from '@/lib/utils';
import {
@@ -26,6 +27,22 @@ import {
modelLicenceDetailsKey,
} from './model-licence-view';
+/**
+ * Button row per platform convention: macOS puts the default action rightmost
+ * with Cancel beside it, Windows (Fluent) uses equal-width buttons with the
+ * primary action first, Linux (GNOME/KDE) right-aligns Cancel then the action.
+ * Pinned to the bottom of the dialog's one scroll area so it never scrolls away.
+ */
+function footerActionsClass(platform: PlatformFamily) {
+ const base =
+ 'sticky bottom-0 -mx-8 flex flex-col-reverse gap-2 border-t border-border px-8 py-4 sm:flex-row sm:items-center ' +
+ // Fluent dialogs put the actions on their own tinted command area.
+ (platform === 'windows' ? 'bg-muted' : 'bg-popover');
+ if (platform === 'windows') return cn(base, 'sm:flex-row-reverse [&>button]:sm:flex-1');
+ if (platform === 'mac') return cn(base, 'sm:justify-end [&>button]:sm:min-w-24');
+ return cn(base, 'sm:flex-wrap sm:justify-end');
+}
+
/** A model the footer can accept: what the user is shown is what gets recorded. */
export interface AcceptableModel {
repo_id: string;
@@ -77,6 +94,7 @@ export function LicenceAcceptanceFooter({
const { t } = useTranslation();
const client = useQueryClient();
const baseId = useId();
+ const platform = platformFamily();
const pending = models.filter((m) => m.required && !m.accepted);
const accepted = models.filter((m) => m.required && m.accepted);
const [checked, setChecked] = useState<Record<string, boolean>>({});
@@ -129,14 +147,13 @@ export function LicenceAcceptanceFooter({
return (
<div
data-licence-acceptance
- className="max-h-[45dvh] shrink-0 space-y-4 overflow-y-auto border-t border-border bg-[linear-gradient(180deg,color-mix(in_srgb,var(--muted)_42%,transparent),var(--popover)_4.5rem)] p-4"
+ data-platform={platform}
+ className="space-y-4 border-t border-border px-8 pt-5"
>
{pending.length > 0 && (
<>
- <div className="border-s-2 border-warning/70 ps-3">
- <p className="max-w-prose text-sm leading-relaxed text-foreground/90">{t('modelLicense.acceptNotice')}</p>
- </div>
- <ul className="grid gap-2" aria-live="polite">
+ <p className="text-sm leading-relaxed text-foreground/85">{t('modelLicense.acceptNotice')}</p>
+ <ul className="divide-y divide-border/70 overflow-hidden rounded-lg border border-border" aria-live="polite">
{pending.map((model, index) => {
const id = `${baseId}-${index}`;
const checkedModel = !!checked[model.repo_id];
@@ -145,30 +162,31 @@ export function LicenceAcceptanceFooter({
<label
htmlFor={id}
className={cn(
- 'group flex cursor-pointer items-start gap-3 rounded-lg border bg-background/75 p-3 text-sm shadow-sm transition-[border-color,background-color] motion-reduce:transition-none',
- checkedModel
- ? 'border-primary/60 bg-primary/[0.07]'
- : 'border-border hover:border-foreground/25',
+ 'flex cursor-pointer items-start gap-3 px-3 py-2.5 text-sm transition-colors motion-reduce:transition-none',
+ checkedModel ? 'bg-primary/[0.06]' : 'hover:bg-muted/50',
)}
>
- <span className="min-w-0 flex-1 space-y-1">
- <span aria-hidden="true" className="flex items-start gap-2 font-medium text-foreground">
- <ModelLicenseIcon category={modelLicenseCategory(model.category)} className="mt-0.5 size-4 shrink-0" />
+ <input
+ id={id}
+ type="checkbox"
+ checked={checkedModel}
+ disabled={busy}
+ onChange={(event) => {
+ const value = event.currentTarget.checked;
+ setChecked((prev) => ({ ...prev, [model.repo_id]: value }));
+ }}
+ className={cn(
+ 'mt-0.5 size-4 shrink-0 accent-primary focus-visible:ring-2 focus-visible:ring-ring',
+ platform === 'windows' && 'rounded-[4px]',
+ )}
+ />
+ <span className="min-w-0 flex-1 space-y-0.5">
+ <span aria-hidden="true" className="flex items-center gap-1.5 font-medium text-foreground">
+ <ModelLicenseIcon category={modelLicenseCategory(model.category)} className="size-3.5 shrink-0" />
<span data-model-label={model.label} className="break-all after:content-[attr(data-model-label)]" />
</span>
- <span className="flex items-start gap-3 leading-relaxed text-muted-foreground">
- <input
- id={id}
- type="checkbox"
- checked={!!checked[model.repo_id]}
- disabled={busy}
- onChange={(event) => {
- const value = event.currentTarget.checked;
- setChecked((prev) => ({ ...prev, [model.repo_id]: value }));
- }}
- className="mt-0.5 size-4 shrink-0 accent-primary focus-visible:ring-2 focus-visible:ring-ring"
- />
- <span>{t('modelLicense.acceptCheckbox', { model: model.label })}</span>
+ <span className="block leading-snug text-foreground/80">
+ {t('modelLicense.acceptCheckbox', { model: model.label })}
</span>
</span>
</label>
@@ -183,7 +201,7 @@ export function LicenceAcceptanceFooter({
{t(error === 'changed' ? 'modelLicense.acceptChanged' : 'modelLicense.acceptFailed')}
</p>
)}
- <div className="flex flex-col-reverse gap-2 border-t border-border/70 pt-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-end">
+ <div className={footerActionsClass(platform)}>
{accepted.map((model) => (
<Button
key={model.repo_id}
@@ -199,11 +217,11 @@ export function LicenceAcceptanceFooter({
</span>
</Button>
))}
- <Button variant="ghost" disabled={busy || closeDisabled} onClick={onClose}>
+ <Button variant={platform === 'linux' ? 'ghost' : 'outline'} disabled={busy || closeDisabled} onClick={onClose}>
{t('common.close')}
</Button>
{pending.length > 0 && (
- <Button className="min-w-40" disabled={!allChecked || busy} onClick={() => void accept()}>
+ <Button className={platform === 'linux' ? 'min-w-40' : undefined} disabled={!allChecked || busy} onClick={() => void accept()}>
{pending.length > 1 ? t('modelLicense.acceptAll', { count: pending.length }) : t('modelLicense.accept')}
</Button>
)}
@@ -215,6 +233,7 @@ export function LicenceAcceptanceFooter({
/** App-level dialog for a `model_licence_required` error from any feature. */
export function ModelLicenceGate() {
const { t } = useTranslation();
+ const platform = platformFamily();
const [models, setModels] = useState<ModelLicenceRequirement[] | null>(null);
const [done, setDone] = useState(false);
@@ -262,24 +281,26 @@ export function ModelLicenceGate() {
<DialogContent
showCloseButton={false}
className={cn(
- 'flex max-h-[calc(100dvh-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl',
+ // Tall and wide: the licence text is the content, so give it the room.
+ 'flex h-[min(48rem,calc(100dvh-2rem))] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl',
+ platform === 'mac' ? 'rounded-xl' : 'rounded-lg',
LICENCE_DIALOG_SURFACE,
)}
+ data-platform={platform}
>
- <DialogHeader className="border-b border-border bg-muted/30 px-5 py-4">
- <div className="flex items-start gap-3">
- <span className="grid size-10 shrink-0 place-items-center rounded-xl border border-warning/35 bg-warning/10 shadow-sm">
- <ModelLicenseIcon category="conditions" className="size-5" />
- </span>
+ <DialogHeader className={cn('px-8 pt-6 pb-4', platform === 'mac' && 'items-center text-center')}>
+ <div className={cn('flex gap-3', platform === 'mac' ? 'flex-col items-center' : 'items-start')}>
+ <ModelLicenseIcon category="conditions" className={platform === 'mac' ? 'size-8' : 'mt-1 size-6 shrink-0'} />
<div className="min-w-0 space-y-1">
- <DialogTitle className="text-lg tracking-[-0.01em]">
+ <DialogTitle className={platform === 'windows' ? 'text-xl font-semibold' : 'text-base font-semibold'}>
{t(done ? 'modelLicense.acceptedTitle' : 'modelLicense.requiredTitle')}
</DialogTitle>
- <DialogDescription className="max-w-prose leading-relaxed">{t('modelLicense.gateIntro')}</DialogDescription>
+ <DialogDescription className="leading-snug">{t('modelLicense.gateIntro')}</DialogDescription>
</div>
</div>
</DialogHeader>
- <div className="min-h-0 flex-1 space-y-4 overflow-y-auto bg-background p-5">
+ <div className="min-h-0 flex-1 overflow-y-auto">
+ <div className="space-y-3 px-8 pb-4">
{done && (
<p role="status" className="rounded-lg border border-success/40 bg-success/10 p-3 text-sm">
{t('modelLicense.retryHint')}
@@ -321,6 +342,7 @@ export function ModelLicenceGate() {
{models && (
<LicenceAcceptanceFooter models={acceptable} onAccepted={() => setDone(true)} onClose={close} />
)}
+ </div>
</DialogContent>
</Dialog>
);
diff --git a/electron/src/renderer/src/features/settings/model-license.tsx b/electron/src/renderer/src/features/settings/model-license.tsx
index 457d5f088..b87f04068 100644
--- a/electron/src/renderer/src/features/settings/model-license.tsx
+++ b/electron/src/renderer/src/features/settings/model-license.tsx
@@ -313,19 +313,21 @@ export function ModelLicense({
</DialogTitle>
<DialogDescription className="break-all">{repoId}</DialogDescription>
</DialogHeader>
- <div className="min-h-0 flex-1 overflow-y-auto p-4">
- <ModelLicenceView details={details.data} infoFallback={info} extra={verifiedInstall} />
- {details.isError && (
- <p role="alert" className="mt-3 text-sm text-destructive">
- {t('modelLicense.detailsFailed')}
- </p>
- )}
+ <div className="min-h-0 flex-1 overflow-y-auto">
+ <div className="p-4">
+ <ModelLicenceView details={details.data} infoFallback={info} extra={verifiedInstall} />
+ {details.isError && (
+ <p role="alert" className="mt-3 text-sm text-destructive">
+ {t('modelLicense.detailsFailed')}
+ </p>
+ )}
+ </div>
+ <LicenceAcceptanceFooter
+ models={currentAcceptance ? [toAcceptable(label, currentAcceptance)] : []}
+ onClose={close}
+ closeDisabled={busy === 'commit'}
+ />
</div>
- <LicenceAcceptanceFooter
- models={currentAcceptance ? [toAcceptable(label, currentAcceptance)] : []}
- onClose={close}
- closeDisabled={busy === 'commit'}
- />
</DialogContent>
</Dialog>
</>