Skip to content

A full-featured download manager.

fix(plugins): streamline installation and permission review (#2333)

Dr_rOot5b660fdc86bb
diff --git a/e2e/panel-toolbars.spec.ts b/e2e/panel-toolbars.spec.ts
index ebb3d8cc..1cc371b6 100644
--- a/e2e/panel-toolbars.spec.ts
+++ b/e2e/panel-toolbars.spec.ts
@@ -32,7 +32,9 @@ test('Trackers and Plugins share expandable, keyboard-accessible panel toolbars'
await setTaskInspectorContentSize(app, page, 1100, 780)
await page.getByRole('link', { name: 'Trackers', exact: true }).click()
const trackers = page.getByRole('toolbar', { name: 'Trackers' })
- const actions = page.locator('[data-slot="panel-shell-actions"]')
+ const actions = page
+ .locator('[data-slot="panel-shell-actions"]')
+ .filter({ has: page.getByRole('toolbar') })
await expect(actions).toHaveCSS('-webkit-app-region', 'no-drag')
const trackerSearch = trackers.getByRole('button', {
name: 'Filter by URL…',
diff --git a/src/renderer/routes/plugins/components/inline-consent-panel.test.tsx b/src/renderer/routes/plugins/components/inline-consent-panel.test.tsx
index 99620e45..8e54d866 100644
--- a/src/renderer/routes/plugins/components/inline-consent-panel.test.tsx
+++ b/src/renderer/routes/plugins/components/inline-consent-panel.test.tsx
@@ -40,7 +40,7 @@ const baseConsent: ConsentPayload = {
}
describe('InlineConsentPanel', () => {
- it('renders plugin identity card and the install warning', () => {
+ it('shows the unverified source warning', () => {
render(
<InlineConsentPanel
consent={baseConsent}
@@ -48,9 +48,7 @@ describe('InlineConsentPanel', () => {
onGrantsChange={() => {}}
/>
)
- expect(screen.getByText('Video Helper')).toBeInTheDocument()
- expect(screen.getByText(/Reads supported video sites/)).toBeInTheDocument()
- expect(screen.getByText(/Before installing/)).toBeInTheDocument()
+ expect(screen.getByText(/This plugin is not verified/)).toBeInTheDocument()
})
it('shows verified official identity without skipping permission review', () => {
@@ -67,7 +65,7 @@ describe('InlineConsentPanel', () => {
expect(
screen.getByText('Official Motrix signature verified')
).toBeInTheDocument()
- expect(screen.getByText(/Before installing/)).toBeInTheDocument()
+ expect(screen.queryByText(/This plugin is not verified/)).toBeNull()
expect(screen.getByText('Send notifications')).toBeInTheDocument()
})
diff --git a/src/renderer/routes/plugins/components/inline-consent-panel.tsx b/src/renderer/routes/plugins/components/inline-consent-panel.tsx
index 154c57f0..c9fdac4c 100644
--- a/src/renderer/routes/plugins/components/inline-consent-panel.tsx
+++ b/src/renderer/routes/plugins/components/inline-consent-panel.tsx
@@ -1,90 +1,194 @@
+import { ChevronDownIcon, InfoIcon } from '@renderer/components/icons'
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from '@renderer/components/ui/collapsible'
import type { ConsentPayload } from '@shared/types/plugin-install'
+import { useId } from 'react'
import { useTranslation } from 'react-i18next'
-import { type GrantsMap, truncateOneLine } from '../lib/audience'
+import type { GrantsMap } from '../lib/audience'
import { BroadHostAccessWarning } from './broad-host-access-warning'
import { ConsentDiffSection } from './consent-diff-section'
import { PermissionRow } from './permission-row'
-import { PluginAudienceBadge } from './plugin-audience-badge'
-import { PluginAvatar } from './plugin-avatar'
interface Props {
consent: ConsentPayload
grants: GrantsMap
onGrantsChange: (next: GrantsMap) => void
+ disabled?: boolean
}
-export function InlineConsentPanel({ consent, grants, onGrantsChange }: Props) {
+const groupClass = 'divide-y overflow-hidden rounded-lg border bg-muted/40'
+const disclosureClass =
+ 'group inline-flex items-center gap-1 rounded-sm text-xs leading-5 text-foreground outline-none hover:underline hover:underline-offset-4 focus-visible:ring-2 focus-visible:ring-ring'
+
+export function InlineConsentPanel({
+ consent,
+ grants,
+ onGrantsChange,
+ disabled,
+}: Props) {
const { t } = useTranslation()
- const isBroadHost = consent.trustSurface.hostPermissions.some((h) => h.broad)
+ const requiredTitle = useId()
+ const optionalTitle = useId()
+ const {
+ permissions,
+ optionalPermissions,
+ hostPermissions,
+ invokesCommands,
+ publicCommandsExposed,
+ } = consent.trustSurface
+ const broad = hostPermissions.some((h) => h.broad)
+ const hosts = hostPermissions.length > 0 && (
+ <Collapsible className="mt-2">
+ <CollapsibleTrigger className={disclosureClass} disabled={disabled}>
+ {t('plugins.consent.hostPermissions')}
+ <ChevronDownIcon className="size-3.5 transition-transform group-data-panel-open:rotate-180 motion-reduce:transition-none" />
+ </CollapsibleTrigger>
+ <CollapsibleContent>
+ <div className="mt-3 space-y-1.5 border-s-2 ps-3">
+ {hostPermissions.map((h) => (
+ <code
+ key={h.pattern}
+ className="block break-all text-xs leading-5 text-muted-foreground"
+ >
+ {h.pattern}
+ </code>
+ ))}
+ </div>
+ </CollapsibleContent>
+ </Collapsible>
+ )
+ const hostPermission = permissions.find(
+ (p) => p.name === 'http' || p.name === 'network'
+ )?.name
+
return (
- <div className="mt-4 space-y-3">
- <div className="grid grid-cols-[44px_1fr_auto] items-center gap-3 rounded-lg border bg-card p-3">
- <PluginAvatar plugin={consent.manifest} size={44} />
- <div className="min-w-0">
- <h3 className="truncate text-sm font-medium">
- {consent.manifest.name}
+ <div className="space-y-5">
+ {broad && <BroadHostAccessWarning />}
+ {consent.diff && <ConsentDiffSection diff={consent.diff} />}
+ {permissions.length > 0 && (
+ <section aria-labelledby={requiredTitle}>
+ <h3 id={requiredTitle} className="mb-2 text-xs font-semibold">
+ {t('plugins.consent.permissions')}
</h3>
- <p className="truncate text-xs leading-5 text-muted-foreground">
- {truncateOneLine(consent.manifest.description, 120)}
+ <div className={groupClass}>
+ {permissions.map((p) => (
+ <PermissionRow key={p.name} permission={p.name} granted grouped>
+ {p.name === hostPermission ? hosts : null}
+ </PermissionRow>
+ ))}
+ </div>
+ </section>
+ )}
+ {!hostPermission && hosts}
+ {optionalPermissions.length > 0 && (
+ <section aria-labelledby={optionalTitle}>
+ <div className="mb-2 flex flex-wrap items-baseline justify-between gap-2">
+ <h3 id={optionalTitle} className="text-xs font-semibold">
+ {t('plugins.consent.optionalPermissions')}
+ </h3>
+ <span className="text-xs text-muted-foreground">
+ {t('plugins.install.optionalHint')}
+ </span>
+ </div>
+ <div className={groupClass}>
+ {optionalPermissions.map((p) => (
+ <PermissionRow
+ key={p.name}
+ permission={p.name}
+ granted={grants[p.name] === 'granted'}
+ disabled={disabled}
+ grouped
+ onToggle={() => {
+ if (!disabled)
+ onGrantsChange({
+ ...grants,
+ [p.name]:
+ grants[p.name] === 'granted' ? 'denied' : 'granted',
+ })
+ }}
+ />
+ ))}
+ </div>
+ <p className="mt-2 text-xs leading-5 text-muted-foreground">
+ {t('plugins.install.optionalLater')}
</p>
- </div>
- <PluginAudienceBadge tone={isBroadHost ? 'review' : 'safe'} />
- </div>
-
- {consent.trustSurface.notVerified === false && (
- <p className="text-xs text-muted-foreground">
- {t('plugins.install.officialVerified')}
- </p>
+ </section>
)}
-
- <div className="grid gap-2">
- {consent.trustSurface.permissions.map((p) => (
- <PermissionRow key={p.name} permission={p.name} granted={true} />
- ))}
- {consent.trustSurface.optionalPermissions.map((p) => (
- <PermissionRow
- key={p.name}
- permission={p.name}
- granted={grants[p.name] === 'granted'}
- onToggle={() => {
- const next = { ...grants }
- next[p.name] = next[p.name] === 'granted' ? 'denied' : 'granted'
- onGrantsChange(next)
- }}
- />
- ))}
- </div>
-
- {isBroadHost && <BroadHostAccessWarning />}
-
- {consent.diff && <ConsentDiffSection diff={consent.diff} />}
-
- <div className="rounded-lg border border-amber-300 bg-amber-50 p-3 text-xs leading-5">
- <strong className="text-amber-700">
- {t('plugins.install.warning')}
- </strong>
- </div>
-
- <Collapsible className="border-t pt-3">
- <CollapsibleTrigger className="text-xs font-medium text-muted-foreground">
+ {permissions.length === 0 &&
+ optionalPermissions.length === 0 &&
+ hostPermissions.length === 0 && (
+ <p className="text-sm text-muted-foreground">
+ {t('plugins.permissions.empty')}
+ </p>
+ )}
+ {invokesCommands.length > 0 && (
+ <section>
+ <h3 className="mb-2 text-xs font-semibold">
+ {t('plugins.consent.invokesCommands')}
+ </h3>
+ <ul className="space-y-1 text-xs text-muted-foreground">
+ {invokesCommands.map((command) => (
+ <li key={command.commandId} className="break-all">
+ <code>{command.commandId}</code>
+ {!command.calleeInstalled &&
+ ` · ${t('plugins.consent.calleeMissing')}`}
+ </li>
+ ))}
+ </ul>
+ </section>
+ )}
+ <Collapsible className="border-t pt-4">
+ <CollapsibleTrigger className={disclosureClass} disabled={disabled}>
{t('plugins.card.advancedDetails')}
+ <ChevronDownIcon className="size-3.5 transition-transform group-data-panel-open:rotate-180 motion-reduce:transition-none" />
</CollapsibleTrigger>
<CollapsibleContent>
- <div className="mt-2 grid gap-1 text-xs text-muted-foreground">
- <code>source type: {consent.source.type}</code>
- <code>plugin id: {consent.manifest.id}</code>
- {consent.trustSurface.hostPermissions.map((h) => (
- <code key={h.pattern}>host: {h.pattern}</code>
- ))}
- <code>bundle type: .moext</code>
+ <div className="mt-3 space-y-2 rounded-lg bg-muted/40 p-3 text-xs leading-5 text-muted-foreground">
+ <p className="break-all">
+ {t('plugins.consent.source', {
+ type: consent.source.type,
+ url: consent.source.url,
+ })}
+ </p>
+ <code className="block break-all">{consent.manifest.id}</code>
+ <code className="block break-all">
+ SHA-256: {consent.source.bundleSha256}
+ </code>
+ <p>
+ {t('plugins.registry.requires', {
+ range: consent.trustSurface.enginesMotrix,
+ })}
+ </p>
+ {consent.trustSurface.requestedHeapMB != null && (
+ <p>
+ {t('plugins.consent.diff.heap')}:{' '}
+ {consent.trustSurface.requestedHeapMB} {t('units.bytes.mb')}
+ </p>
+ )}
+ {publicCommandsExposed.length > 0 && (
+ <div>
+ <p>{t('plugins.consent.diff.publicCommands')}</p>
+ {publicCommandsExposed.map((command) => (
+ <code className="block break-all" key={command.id}>
+ {command.id} · {command.title}
+ </code>
+ ))}
+ </div>
+ )}
</div>
</CollapsibleContent>
</Collapsible>
+ <p className="flex items-start gap-2 text-xs leading-5 text-muted-foreground">
+ <InfoIcon className="mt-0.5 size-3.5 shrink-0" />
+ {t(
+ consent.trustSurface.notVerified
+ ? 'plugins.consent.notVerified'
+ : 'plugins.install.officialVerified'
+ )}
+ </p>
</div>
)
}
diff --git a/src/renderer/routes/plugins/components/permission-row.test.tsx b/src/renderer/routes/plugins/components/permission-row.test.tsx
index db1f178a..6f723b14 100644
--- a/src/renderer/routes/plugins/components/permission-row.test.tsx
+++ b/src/renderer/routes/plugins/components/permission-row.test.tsx
@@ -50,7 +50,7 @@ describe('PermissionRow', () => {
expect(screen.getByText('Unknown permission.')).toBeInTheDocument()
})
- it('renders an unchecked Switch labelled "Grant" when not granted', () => {
+ it('renders an unchecked Switch labelled with its permission when not granted', () => {
const onToggle = vi.fn()
render(
<PermissionRow
@@ -59,13 +59,13 @@ describe('PermissionRow', () => {
onToggle={onToggle}
/>
)
- const sw = screen.getByRole('switch', { name: 'Allow' })
+ const sw = screen.getByRole('switch', { name: 'Send notifications' })
expect(sw).toHaveAttribute('aria-checked', 'false')
fireEvent.click(sw)
expect(onToggle).toHaveBeenCalledOnce()
})
- it('renders a checked Switch labelled "Allowed" when granted', () => {
+ it('renders a checked Switch labelled with its permission when granted', () => {
render(
<PermissionRow
permission="notifications"
@@ -73,7 +73,7 @@ describe('PermissionRow', () => {
onToggle={() => {}}
/>
)
- const sw = screen.getByRole('switch', { name: 'Allowed' })
+ const sw = screen.getByRole('switch', { name: 'Send notifications' })
expect(sw).toHaveAttribute('aria-checked', 'true')
})
diff --git a/src/renderer/routes/plugins/components/permission-row.tsx b/src/renderer/routes/plugins/components/permission-row.tsx
index 1cedabf4..f37a25cd 100644
--- a/src/renderer/routes/plugins/components/permission-row.tsx
+++ b/src/renderer/routes/plugins/components/permission-row.tsx
@@ -1,6 +1,7 @@
import { Badge } from '@renderer/components/ui/badge'
import { Switch } from '@renderer/components/ui/switch'
import { cn } from '@renderer/lib/utils'
+import { type ReactNode, useId } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { Link } from 'react-router'
import { getAudienceTone, permissionAudience } from '../lib/audience'
@@ -9,19 +10,39 @@ interface Props {
permission: string
granted: boolean
onToggle?: () => void
+ disabled?: boolean
+ grouped?: boolean
+ children?: ReactNode
}
-export function PermissionRow({ permission, granted, onToggle }: Props) {
+export function PermissionRow({
+ permission,
+ granted,
+ onToggle,
+ disabled,
+ grouped,
+ children,
+}: Props) {
+ const labelId = useId()
+ const descriptionId = useId()
const { t } = useTranslation()
const audience = permissionAudience(permission, t)
const tone = getAudienceTone(audience.tone)
return (
- <div className="flex items-center justify-between gap-3 rounded-lg border p-3">
+ <div
+ className={cn(
+ 'flex items-center justify-between gap-3 p-3',
+ !grouped && 'rounded-lg border'
+ )}
+ >
<div className="min-w-0">
- <strong className="text-sm font-medium leading-5">
+ <strong id={labelId} className="text-sm font-medium leading-5">
{audience.strong}
</strong>
- <p className="text-xs leading-5 text-muted-foreground">
+ <p
+ id={descriptionId}
+ className="text-xs leading-5 text-muted-foreground"
+ >
{permission === 'ffmpeg' ? (
<Trans
i18nKey="plugins.permission.ffmpeg.requirement"
@@ -38,24 +59,25 @@ export function PermissionRow({ permission, granted, onToggle }: Props) {
audience.plain
)}
</p>
+ {children}
</div>
<div className="flex shrink-0 items-center gap-2">
- <Badge
- variant="outline"
- className={cn('border-transparent', tone.bg, tone.text)}
- >
- {audience.toneLabel}
- </Badge>
+ {!grouped && (
+ <Badge
+ variant="outline"
+ className={cn('border-transparent', tone.bg, tone.text)}
+ >
+ {audience.toneLabel}
+ </Badge>
+ )}
{onToggle && (
<Switch
size="sm"
checked={granted}
onCheckedChange={onToggle}
- aria-label={
- granted
- ? t('plugins.permission.accessTone.allowed')
- : t('plugins.permission.accessTone.grant')
- }
+ disabled={disabled}
+ aria-labelledby={labelId}
+ aria-describedby={descriptionId}
/>
)}
</div>
diff --git a/src/renderer/routes/plugins/components/plugin-input-group.test.tsx b/src/renderer/routes/plugins/components/plugin-input-group.test.tsx
index 48e6e153..06f862fc 100644
--- a/src/renderer/routes/plugins/components/plugin-input-group.test.tsx
+++ b/src/renderer/routes/plugins/components/plugin-input-group.test.tsx
@@ -4,7 +4,7 @@ import {
type PlatformServices,
PlatformServicesProvider,
} from '@renderer/platform/services'
-import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { PluginInputGroup } from './plugin-input-group'
@@ -89,9 +89,9 @@ describe('PluginInputGroup', () => {
expect(fileBtn).toBeDisabled()
})
- it('disables Check while pending', () => {
+ it('shows preparation inside the disabled Check button while pending', () => {
renderGroup(vi.fn(), true)
- expect(screen.getByLabelText('Check this plugin')).toBeDisabled()
+ expect(screen.getByRole('button', { name: 'Preparing…' })).toBeDisabled()
})
it('auto-triggers onCheck when a local moext file is picked', async () => {
@@ -157,4 +157,70 @@ describe('PluginInputGroup', () => {
})
expect(screen.queryByLabelText('Check this plugin')).toBeNull()
})
+ it('ignores an upload result after its input is unmounted', async () => {
+ let finish!: (value: {
+ sourceType: 'upload'
+ uploadId: string
+ fileHash: string
+ }) => void
+ prepareFile.mockReturnValueOnce(
+ new Promise((resolve) => {
+ finish = resolve
+ })
+ )
+ const onCheck = vi.fn()
+ const view = renderGroup(onCheck)
+ const input = view.container.querySelector(
+ 'input[type="file"]'
+ ) as HTMLInputElement
+ fireEvent.change(input, {
+ target: { files: [new File(['x'], 'foo.moext')] },
+ })
+ expect(screen.getByRole('button', { name: 'Preparing…' })).toBeDisabled()
+ expect(screen.getByRole('textbox')).toBeDisabled()
+ view.unmount()
+ await act(async () =>
+ finish({
+ sourceType: 'upload',
+ uploadId: 'old',
+ fileHash: 'a'.repeat(64),
+ })
+ )
+ expect(onCheck).not.toHaveBeenCalled()
+ })
+
+ it('accepts only one file while an upload is in flight', async () => {
+ let finish!: (value: {
+ sourceType: 'upload'
+ uploadId: string
+ fileHash: string
+ }) => void
+ prepareFile.mockReturnValueOnce(
+ new Promise((resolve) => {
+ finish = resolve
+ })
+ )
+ const onCheck = vi.fn()
+ const view = renderGroup(onCheck)
+ const input = view.container.querySelector(
+ 'input[type="file"]'
+ ) as HTMLInputElement
+ fireEvent.change(input, {
+ target: { files: [new File(['x'], 'first.moext')] },
+ })
+ fireEvent.change(input, {
+ target: { files: [new File(['x'], 'second.moext')] },
+ })
+ expect(prepareFile).toHaveBeenCalledTimes(1)
+ await act(async () =>
+ finish({
+ sourceType: 'upload',
+ uploadId: 'first',
+ fileHash: 'a'.repeat(64),
+ })
+ )
+ expect(onCheck).toHaveBeenCalledWith(
+ expect.objectContaining({ uploadId: 'first' })
+ )
+ })
})
diff --git a/src/renderer/routes/plugins/components/plugin-input-group.tsx b/src/renderer/routes/plugins/components/plugin-input-group.tsx
index 1ec2dda1..4142f552 100644
--- a/src/renderer/routes/plugins/components/plugin-input-group.tsx
+++ b/src/renderer/routes/plugins/components/plugin-input-group.tsx
@@ -6,6 +6,7 @@ import {
InputGroupAddon,
InputGroupTextarea,
} from '@renderer/components/ui/input-group'
+import { Spinner } from '@renderer/components/ui/spinner'
import {
Tooltip,
TooltipContent,
@@ -18,7 +19,13 @@ import {
type PluginInstallFileReference,
useOptionalPlatformServices,
} from '@renderer/platform/services'
-import { type ChangeEvent, useCallback, useRef, useState } from 'react'
+import {
+ type ChangeEvent,
+ useCallback,
+ useEffect,
+ useRef,
+ useState,
+} from 'react'
import { useTranslation } from 'react-i18next'
import { getAudienceTone } from '../lib/audience'
import {
@@ -46,19 +53,36 @@ export function PluginInputGroup({ onCheck, checking }: Props) {
const [input, setInput] = useState('')
const [fileError, setFileError] = useState<string | null>(null)
const fileInputRef = useRef<HTMLInputElement>(null)
+ const mountedRef = useRef(true)
+ const preparingRef = useRef(false)
+ const [preparing, setPreparing] = useState(false)
+ useEffect(() => {
+ mountedRef.current = true
+ return () => {
+ mountedRef.current = false
+ }
+ }, [])
+ const busy = checking || preparing
const detected: DetectedSource = detectInstallSource(input)
- const canCheck = !!detected && !checking && detected !== 'local'
+ const canCheck = !!detected && !busy && detected !== 'local'
const acceptFile = useCallback(
async (file: File) => {
- if (checking || !fileCapability) return
+ if (checking || preparingRef.current || !fileCapability) return
+ preparingRef.current = true
+ setPreparing(true)
setFileError(null)
setInput(file.name)
try {
- await onCheck(await fileCapability.prepare(file))
+ const source = await fileCapability.prepare(file)
+ if (mountedRef.current) await onCheck(source)
} catch (cause) {
- setFileError(cause instanceof Error ? cause.message : String(cause))
+ if (mountedRef.current)
+ setFileError(cause instanceof Error ? cause.message : String(cause))
+ } finally {
+ preparingRef.current = false
+ if (mountedRef.current) setPreparing(false)
}
},
[onCheck, checking, fileCapability]
@@ -66,7 +90,7 @@ export function PluginInputGroup({ onCheck, checking }: Props) {
const onFilesDrop = useCallback(
(files: FileList) => {
- if (!fileCapability || checking) return
+ if (!fileCapability || checking || preparingRef.current) return
const file = files[0]
if (file) void acceptFile(file)
},
@@ -78,11 +102,12 @@ export function PluginInputGroup({ onCheck, checking }: Props) {
function onLocalChange(e: ChangeEvent<HTMLInputElement>) {
const file = e.target.files?.[0]
+ e.target.value = ''
if (file) void acceptFile(file)
}
async function triggerCheck() {
- if (!detected) return
+ if (!detected || busy) return
if (detected === 'github') {
await onCheck({ sourceType: 'github', spec: input.trim() })
} else if (detected === 'url') {
@@ -110,6 +135,7 @@ export function PluginInputGroup({ onCheck, checking }: Props) {
<InputGroupTextarea
value={input}
rows={2}
+ disabled={busy}
onChange={(e) => setInput(e.target.value)}
placeholder={t('plugins.install.placeholder')}
className="min-h-[60px] px-4 pt-4 pb-2 text-sm leading-6 focus-visible:border-input focus-visible:ring-0"
@@ -129,7 +155,7 @@ export function PluginInputGroup({ onCheck, checking }: Props) {
variant="ghost"
size="icon-xs"
className="rounded-full"
- disabled={!fileCapability || checking}
+ disabled={!fileCapability || busy}
onClick={() => fileInputRef.current?.click()}
aria-label={t(
fileCapability
@@ -165,15 +191,27 @@ export function PluginInputGroup({ onCheck, checking }: Props) {
)}
</div>
- {detected !== 'local' && (
+ {(detected !== 'local' || busy) && (
<Button
- size="icon-xs"
- className="rounded-full"
+ size={busy ? 'sm' : 'icon-xs'}
+ className={busy ? undefined : 'rounded-full'}
disabled={!canCheck}
onClick={triggerCheck}
- aria-label={t('plugins.install.checkAriaLabel')}
+ aria-label={t(
+ busy
+ ? 'plugins.install.preparing'
+ : 'plugins.install.checkAriaLabel'
+ )}
+ aria-busy={busy}
>
- <SearchIcon />
+ {busy ? (
+ <>
+ <Spinner aria-hidden="true" />
+ {t('plugins.install.preparing')}
+ </>
+ ) : (
+ <SearchIcon />
+ )}
</Button>
)}
</InputGroupAddon>
diff --git a/src/renderer/routes/plugins/components/registry-detail-panel.test.tsx b/src/renderer/routes/plugins/components/registry-detail-panel.test.tsx
index 3692d9be..4de82bb8 100644
--- a/src/renderer/routes/plugins/components/registry-detail-panel.test.tsx
+++ b/src/renderer/routes/plugins/components/registry-detail-panel.test.tsx
@@ -9,8 +9,8 @@ import type { RegistryPluginDTO } from '@shared/schemas/registry'
import { render, screen } from '@testing-library/react'
import { beforeEach, describe, expect, it, vi } from 'vitest'
-vi.mock('../plugin-install-dialog', () => ({
- PluginInstallDialog: () => null,
+vi.mock('@renderer/lib/transport', () => ({
+ transport: { invoke: vi.fn(), on: vi.fn(), off: vi.fn() },
}))
import { RegistryDetailPanel } from './registry-detail-panel'
diff --git a/src/renderer/routes/plugins/components/registry-detail-panel.tsx b/src/renderer/routes/plugins/components/registry-detail-panel.tsx
index 98173e96..9eb12152 100644
--- a/src/renderer/routes/plugins/components/registry-detail-panel.tsx
+++ b/src/renderer/routes/plugins/components/registry-detail-panel.tsx
@@ -2,7 +2,7 @@ import {
PANEL_TITLE_CLASS,
PanelShell,
} from '@renderer/components/desktop-kit/panel/panel-shell'
-import { ExternalLinkIcon, InstallIcon } from '@renderer/components/icons'
+import { ExternalLinkIcon } from '@renderer/components/icons'
import { Badge } from '@renderer/components/ui/badge'
import { Button } from '@renderer/components/ui/button'
import { Card } from '@renderer/components/ui/card'
@@ -15,11 +15,10 @@ import {
import { usePlatformServices } from '@renderer/platform/services'
import { EXTERNAL_URLS } from '@shared/external-urls'
import type { RegistryPluginDTO } from '@shared/schemas/registry'
-import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { registryListing } from '../lib/registry-text'
-import { PluginInstallDialog } from '../plugin-install-dialog'
import { PluginAvatar } from './plugin-avatar'
+import { RegistryInstallAction } from './registry-install-action'
interface Props {
entry: RegistryPluginDTO
@@ -34,7 +33,6 @@ interface Props {
export function RegistryDetailPanel({ entry }: Props) {
const { t, i18n } = useTranslation()
const services = usePlatformServices()
- const [installOpen, setInstallOpen] = useState(false)
const { name, description, features } = registryListing(
entry.listing,
i18n.language
@@ -94,15 +92,11 @@ export function RegistryDetailPanel({ entry }: Props) {
})}
</Badge>
)}
- <Button
- size="sm"
+ <RegistryInstallAction
+ key={entry.id}
+ pluginId={entry.id}
disabled={!entry.compatible}
- onClick={() => setInstallOpen(true)}
- data-testid="registry-install-btn"
- >
- <InstallIcon className="size-3.5" />
- {t('plugins.registry.install')}
- </Button>
+ />
<Button
variant="outline"
size="sm"
@@ -164,12 +158,6 @@ export function RegistryDetailPanel({ entry }: Props) {
</ScrollAreaViewport>
<ScrollBar />
</ScrollArea>
-
- <PluginInstallDialog
- open={installOpen}
- onOpenChange={setInstallOpen}
- fixedSource={{ sourceType: 'registry', pluginId: entry.id }}
- />
</PanelShell>
)
}
diff --git a/src/renderer/routes/plugins/components/registry-install-action.test.tsx b/src/renderer/routes/plugins/components/registry-install-action.test.tsx
new file mode 100644
index 00000000..0a8a66f1
--- /dev/null
+++ b/src/renderer/routes/plugins/components/registry-install-action.test.tsx
@@ -0,0 +1,305 @@
+import '@test-utils/dom-animations'
+import '@renderer/lib/i18n'
+import '@testing-library/jest-dom/vitest'
+import { Commands } from '@shared/protocol/commands'
+import type { ConsentPayload } from '@shared/types/plugin-install'
+import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { StrictMode } from 'react'
+import { beforeEach, describe, expect, it, vi } from 'vitest'
+
+const { invoke } = vi.hoisted(() => ({ invoke: vi.fn() }))
+vi.mock('@renderer/lib/transport', () => ({
+ transport: { invoke, on: vi.fn(), off: vi.fn() },
+}))
+
+import { usePluginsStore } from '../store'
+import { RegistryInstallAction } from './registry-install-action'
+
+function prepared(id = 'stage', name = 'Smart Link') {
+ const consent: ConsentPayload = {
+ manifest: {
+ id: 'acme.smart-link',
+ name,
+ version: '1.0.0',
+ description: 'Finds downloads.',
+ },
+ source: {
+ type: 'registry',
+ url: 'https://example.com/plugin.moext',
+ bundleSha256: 'a'.repeat(64),
+ recordedAt: 0,
+ },
+ trustSurface: {
+ permissions: [
+ { name: 'http', description: '' },
+ { name: 'metadata', description: '' },
+ ],
+ optionalPermissions: [
+ { name: 'fs.task.read', description: '' },
+ { name: 'notify', description: '' },
+ ],
+ hostPermissions: [{ pattern: 'https://example.com/*', broad: false }],
+ invokesCommands: [],
+ publicCommandsExposed: [],
+ enginesMotrix: '^2.0.0',
+ notVerified: true,
+ },
+ diff: null,
+ ffmpegRuntime: { requiredByPlugin: 'none', available: false },
+ }
+ return { stagingId: id, consent, committed: false }
+}
+
+function deferred<T>() {
+ let resolve!: (value: T) => void
+ const promise = new Promise<T>((done) => {
+ resolve = done
+ })
+ return { promise, resolve }
+}
+
+function start() {
+ fireEvent.click(screen.getByTestId('registry-install-btn'))
+}
+function confirm() {
+ fireEvent.click(screen.getByTestId('install-commit-btn'))
+}
+
+beforeEach(() => {
+ invoke
+ .mockReset()
+ .mockImplementation(async (channel) =>
+ channel === Commands.InstallPlugin ? prepared() : undefined
+ )
+ usePluginsStore.setState({ updates: {} })
+})
+
+describe('RegistryInstallAction', () => {
+ it('prepares in the button, then reviews parsed permissions before committing', async () => {
+ const download = deferred<ReturnType<typeof prepared>>()
+ invoke.mockReturnValueOnce(download.promise)
+ render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ expect(screen.getByRole('button', { name: 'Preparing…' })).toBeDisabled()
+ expect(screen.queryByRole('dialog')).toBeNull()
+ expect(screen.queryByText(/Downloading and checking/)).toBeNull()
+ await act(async () => download.resolve(prepared()))
+ expect(await screen.findByRole('dialog')).toBeVisible()
+ const optional = screen.getAllByRole('switch')
+ expect(optional).toHaveLength(2)
+ for (const toggle of optional)
+ expect(toggle).toHaveAttribute('aria-checked', 'false')
+ expect(screen.getByText('Read and write task metadata')).toBeVisible()
+ fireEvent.click(screen.getByRole('button', { name: 'Host access' }))
+ expect(await screen.findByText('https://example.com/*')).toBeVisible()
+ fireEvent.click(screen.getByRole('switch', { name: 'Read download files' }))
+ confirm()
+ await waitFor(() =>
+ expect(invoke).toHaveBeenCalledWith(Commands.ConfirmPluginInstall, {
+ stagingId: 'stage',
+ grants: { 'fs.task.read': 'granted' },
+ })
+ )
+ expect(
+ await screen.findByRole('button', { name: 'Installed' })
+ ).toBeDisabled()
+ })
+
+ it('keeps signature failures inline and retries the same registry source', async () => {
+ invoke.mockRejectedValueOnce(
+ new Error('plugin.install.official_signature_invalid')
+ )
+ render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ expect(await screen.findByRole('alert')).toHaveTextContent(
+ 'The official plugin signature could not be verified'
+ )
+ expect(screen.queryByRole('dialog')).toBeNull()
+ fireEvent.click(screen.getByRole('button', { name: 'Retry' }))
+ await screen.findByRole('dialog')
+ expect(
+ invoke.mock.calls.filter(
+ ([channel]) => channel === Commands.InstallPlugin
+ )
+ ).toEqual([
+ [
+ Commands.InstallPlugin,
+ { sourceType: 'registry', pluginId: 'acme.smart-link' },
+ ],
+ [
+ Commands.InstallPlugin,
+ { sourceType: 'registry', pluginId: 'acme.smart-link' },
+ ],
+ ])
+ expect(screen.queryByRole('alert')).toBeNull()
+ })
+
+ it('discards a cancelled result without replacing the next consent', async () => {
+ const old = deferred<ReturnType<typeof prepared>>()
+ const current = deferred<ReturnType<typeof prepared>>()
+ invoke.mockReturnValueOnce(old.promise)
+ render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
+ await waitFor(() =>
+ expect(screen.getByTestId('registry-install-btn')).toBeEnabled()
+ )
+ invoke.mockReturnValueOnce(current.promise)
+ start()
+ await act(async () => old.resolve(prepared('old', 'Old plugin')))
+ expect(invoke).toHaveBeenCalledWith(Commands.CancelPluginInstall, {
+ stagingId: 'old',
+ })
+ expect(screen.queryByRole('dialog')).toBeNull()
+ await act(async () =>
+ current.resolve(prepared('current', 'Current plugin'))
+ )
+ expect(
+ await screen.findByRole('heading', {
+ name: 'Install Current plugin 1.0.0?',
+ })
+ ).toBeVisible()
+ confirm()
+ await waitFor(() =>
+ expect(invoke).toHaveBeenCalledWith(Commands.ConfirmPluginInstall, {
+ stagingId: 'current',
+ grants: {},
+ })
+ )
+ })
+
+ it('cleans up staging that returns after navigation away', async () => {
+ const download = deferred<ReturnType<typeof prepared>>()
+ invoke.mockReturnValueOnce(download.promise)
+ const view = render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ view.unmount()
+ await act(async () => download.resolve(prepared('abandoned')))
+ expect(invoke).toHaveBeenCalledWith(Commands.CancelPluginInstall, {
+ stagingId: 'abandoned',
+ })
+ expect(
+ invoke.mock.calls.some(
+ ([channel]) => channel === Commands.ConfirmPluginInstall
+ )
+ ).toBe(false)
+ })
+
+ it('cleans up visible consent on unmount', async () => {
+ const view = render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ await screen.findByRole('dialog')
+ view.unmount()
+ expect(invoke).toHaveBeenCalledWith(Commands.CancelPluginInstall, {
+ stagingId: 'stage',
+ })
+ })
+
+ it('locks confirmation and grants until the commit completes', async () => {
+ const commit = deferred<undefined>()
+ render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ await screen.findByRole('dialog')
+ invoke.mockReturnValueOnce(commit.promise)
+ confirm()
+ confirm()
+ expect(screen.getByRole('button', { name: 'Cancel' })).toBeDisabled()
+ expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()
+ for (const toggle of screen.getAllByRole('switch')) {
+ expect(toggle).toHaveAttribute('aria-disabled', 'true')
+ fireEvent.click(toggle)
+ expect(toggle).toHaveAttribute('aria-checked', 'false')
+ }
+ fireEvent.keyDown(screen.getByRole('dialog'), { key: 'Escape' })
+ expect(
+ invoke.mock.calls.filter(
+ ([channel]) => channel === Commands.ConfirmPluginInstall
+ )
+ ).toHaveLength(1)
+ expect(
+ invoke.mock.calls.filter(
+ ([channel]) => channel === Commands.CancelPluginInstall
+ )
+ ).toHaveLength(0)
+ await act(async () => commit.resolve(undefined))
+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())
+ })
+
+ it('keeps consent and grants when staging cancellation fails', async () => {
+ render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ await screen.findByRole('dialog')
+ fireEvent.click(screen.getByRole('switch', { name: 'Send notifications' }))
+ invoke.mockRejectedValueOnce(new Error('Could not cancel staging'))
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
+ expect(await screen.findByRole('alert')).toHaveTextContent(
+ 'Could not cancel staging'
+ )
+ expect(
+ screen.getByRole('switch', { name: 'Send notifications' })
+ ).toHaveAttribute('aria-checked', 'true')
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())
+ await waitFor(() =>
+ expect(screen.getByTestId('registry-install-btn')).toHaveFocus()
+ )
+ start()
+ expect(
+ await screen.findByRole('switch', { name: 'Send notifications' })
+ ).toHaveAttribute('aria-checked', 'false')
+ })
+
+ it('clears an update only after a successful trust-equivalent install', async () => {
+ usePluginsStore.setState({
+ updates: {
+ 'acme.smart-link': { latestVersion: '1.1.0', channel: 'community' },
+ },
+ })
+ invoke.mockResolvedValueOnce({
+ committed: true,
+ pluginId: 'acme.smart-link',
+ })
+ render(
+ <RegistryInstallAction pluginId="acme.smart-link" updateVersion="1.1.0" />
+ )
+ fireEvent.click(screen.getByTestId('plugin-update-btn'))
+ await waitFor(() =>
+ expect(
+ usePluginsStore.getState().updates['acme.smart-link']
+ ).toBeUndefined()
+ )
+ expect(screen.queryByRole('dialog')).toBeNull()
+ })
+
+ it('does not start a download on mount or duplicate it under StrictMode', async () => {
+ render(
+ <StrictMode>
+ <RegistryInstallAction pluginId="acme.smart-link" />
+ </StrictMode>
+ )
+ expect(invoke).not.toHaveBeenCalled()
+ start()
+ start()
+ await screen.findByRole('dialog')
+ expect(
+ invoke.mock.calls.filter(
+ ([channel]) => channel === Commands.InstallPlugin
+ )
+ ).toHaveLength(1)
+ })
+
+ it('does not install another plugin when the selection changes', async () => {
+ const download = deferred<ReturnType<typeof prepared>>()
+ invoke.mockReturnValueOnce(download.promise)
+ const view = render(<RegistryInstallAction pluginId="acme.smart-link" />)
+ start()
+ view.rerender(<RegistryInstallAction pluginId="acme.other" />)
+ expect(screen.getByRole('button', { name: 'Install' })).toBeEnabled()
+ await act(async () => download.resolve(prepared('old')))
+ expect(
+ invoke.mock.calls.filter(
+ ([channel]) => channel === Commands.InstallPlugin
+ )
+ ).toHaveLength(1)
+ })
+})
diff --git a/src/renderer/routes/plugins/components/registry-install-action.tsx b/src/renderer/routes/plugins/components/registry-install-action.tsx
new file mode 100644
index 00000000..a3e63fec
--- /dev/null
+++ b/src/renderer/routes/plugins/components/registry-install-action.tsx
@@ -0,0 +1,95 @@
+import {
+ CheckIcon,
+ InstallIcon,
+ PluginUpdateIcon,
+} from '@renderer/components/icons'
+import { Alert } from '@renderer/components/ui/alert'
+import { Button } from '@renderer/components/ui/button'
+import { Spinner } from '@renderer/components/ui/spinner'
+import { useRef, useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { PluginInstallDialog } from '../plugin-install-dialog'
+
+interface Props {
+ pluginId: string
+ disabled?: boolean
+ updateVersion?: string
+}
+
+export function RegistryInstallAction(props: Props) {
+ return <RegistryInstallSession key={props.pluginId} {...props} />
+}
+
+function RegistryInstallSession({ pluginId, disabled, updateVersion }: Props) {
+ const { t } = useTranslation()
+ const [open, setOpen] = useState(false)
+ const [installed, setInstalled] = useState(false)
+ const triggerRef = useRef<HTMLButtonElement>(null)
+ const updating = !!updateVersion
+ return (
+ <PluginInstallDialog
+ open={open}
+ onOpenChange={setOpen}
+ onInstalled={() => setInstalled(true)}
+ fixedSource={{ sourceType: 'registry', pluginId }}
+ inlineErrors={!updating}
+ returnFocusRef={triggerRef}
+ renderTrigger={({ preparing, error, cancel, retry }) => (
+ <>
+ <Button
+ ref={triggerRef}
+ size="sm"
+ variant={updating ? 'ghost' : 'default'}
+ disabled={disabled || open || installed}
+ aria-busy={preparing}
+ aria-live="polite"
+ onClick={() => setOpen(true)}
+ data-testid={
+ updating ? 'plugin-update-btn' : 'registry-install-btn'
+ }
+ >
+ {preparing ? (
+ <Spinner aria-hidden="true" />
+ ) : installed ? (
+ <CheckIcon />
+ ) : updating ? (
+ <PluginUpdateIcon />
+ ) : (
+ <InstallIcon />
+ )}
+ {preparing
+ ? t('plugins.install.preparing')
+ : installed
+ ? t('plugins.install.installed')
+ : updating
+ ? t('plugins.registry.updateTo', { version: updateVersion })
+ : t('plugins.registry.install')}
+ </Button>
+ {preparing && !updating && (
+ <Button size="sm" variant="ghost" onClick={cancel}>
+ {t('common.cancel')}
+ </Button>
+ )}
+ {!updating && error && (
+ <Alert
+ variant="destructive"
+ className="basis-full min-w-0 border shadow-none"
+ >
+ <div className="flex min-w-0 flex-wrap items-center gap-3">
+ <span className="min-w-0 flex-1 break-words text-xs leading-5">
+ {error}
+ </span>
+ <Button size="sm" variant="outline" onClick={retry}>
+ {t('common.retry')}
+ </Button>
+ <Button size="sm" variant="ghost" onClick={cancel}>
+ {t('common.cancel')}
+ </Button>
+ </div>
+ </Alert>
+ )}
+ </>
+ )}
+ />
+ )
+}
diff --git a/src/renderer/routes/plugins/hooks/use-plugin-install.ts b/src/renderer/routes/plugins/hooks/use-plugin-install.ts
index 05945a30..1507d01b 100644
--- a/src/renderer/routes/plugins/hooks/use-plugin-install.ts
+++ b/src/renderer/routes/plugins/hooks/use-plugin-install.ts
@@ -5,7 +5,7 @@ import type {
GrantsMap,
PluginInstallCompatibilityFailure,
} from '@shared/types/plugin-install'
-import { useState } from 'react'
+import { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
// Wire shape mirrors installPluginPayloadSchema in src/main/ipc/commands.ts.
@@ -32,85 +32,184 @@ export function usePluginInstall() {
const [consent, setConsent] = useState<ConsentPayload | null>(null)
const [pending, setPending] = useState(false)
const [error, setError] = useState<string | null>(null)
+ const requestRef = useRef(0)
- function showError(e: unknown): void {
- const message = e instanceof Error ? e.message : String(e)
- const messages = {
- 'plugins.security.blocked': 'plugins.security.blocked',
- 'plugins.security.pending': 'plugins.security.pending',
- 'plugin.install.official_signature_invalid':
- 'plugins.install.officialSignatureInvalid',
- 'plugin.install.official_builtin_hook':
- 'plugins.install.officialBuiltinOnly',
- 'plugin.install.builtin_already_installed':
- 'plugins.install.builtinAlreadyInstalled',
- } as const
- const key = Object.keys(messages).find((code) => message.endsWith(code)) as
- | keyof typeof messages
- | undefined
- setError(key ? t(messages[key]) : message)
- }
+ const operationRef = useRef<
+ 'idle' | 'preparing' | 'confirming' | 'cancelling'
+ >('idle')
+ const stagingRef = useRef<string | null>(null)
+ const mountedRef = useRef(true)
- async function startInstall(input: InstallSource): Promise<boolean> {
- setPending(true)
- setError(null)
- try {
- const r = (await transport.invoke(Commands.InstallPlugin, input)) as
- | InstallResult
- | PluginInstallCompatibilityFailure
- if ('incompatible' in r) {
- setStagingId(null)
- setConsent(null)
- setError(
- t('plugins.install.hostIncompatible', {
- required: r.incompatible.required,
- current: r.incompatible.hostVersion,
+ useEffect(() => {
+ mountedRef.current = true
+ return () => {
+ mountedRef.current = false
+ ++requestRef.current
+ if (stagingRef.current && operationRef.current !== 'confirming') {
+ void transport
+ .invoke(Commands.CancelPluginInstall, {
+ stagingId: stagingRef.current,
})
- )
- return false
- }
- if (r.committed) {
- setStagingId(null)
- setConsent(null)
- } else {
- setStagingId(r.stagingId)
- setConsent(r.consent)
+ .catch(() => {})
+ stagingRef.current = null
}
- return r.committed
- } catch (e) {
- showError(e)
- return false
- } finally {
- setPending(false)
+ if (operationRef.current !== 'confirming') operationRef.current = 'idle'
}
- }
+ }, [])
- async function confirm(grants: GrantsMap): Promise<boolean> {
- if (!stagingId || pending) return false
- setPending(true)
- setError(null)
- try {
- await transport.invoke(Commands.ConfirmPluginInstall, {
- stagingId,
- grants,
- })
+ const showError = useCallback(
+ (e: unknown): void => {
+ const message = e instanceof Error ? e.message : String(e)
+ const messages = {
+ 'plugins.security.blocked': 'plugins.security.blocked',
+ 'plugins.security.pending': 'plugins.security.pending',
+ 'plugin.install.official_signature_invalid':
+ 'plugins.install.officialSignatureInvalid',
+ 'plugin.install.official_builtin_hook':
+ 'plugins.install.officialBuiltinOnly',
+ 'plugin.install.builtin_already_installed':
+ 'plugins.install.builtinAlreadyInstalled',
+ } as const
+ const key = Object.keys(messages).find((code) =>
+ message.endsWith(code)
+ ) as keyof typeof messages | undefined
+ setError(key ? t(messages[key]) : message)
+ },
+ [t]
+ )
+
+ const startInstall = useCallback(
+ async (input: InstallSource): Promise<boolean> => {
+ if (
+ operationRef.current !== 'idle' ||
+ stagingRef.current ||
+ !mountedRef.current
+ )
+ return false
+ operationRef.current = 'preparing'
+ const request = ++requestRef.current
+ setPending(true)
+ setError(null)
setStagingId(null)
setConsent(null)
+ try {
+ const r = (await transport.invoke(Commands.InstallPlugin, input)) as
+ | InstallResult
+ | PluginInstallCompatibilityFailure
+ // A dismissed download may finish after another install has started.
+ // Dispose its staging result without replacing the new dialog's state.
+ if (request !== requestRef.current || !mountedRef.current) {
+ if (!('incompatible' in r) && !r.committed) {
+ await transport.invoke(Commands.CancelPluginInstall, {
+ stagingId: r.stagingId,
+ })
+ }
+ return false
+ }
+ if ('incompatible' in r) {
+ setStagingId(null)
+ setConsent(null)
+ setError(
+ t('plugins.install.hostIncompatible', {
+ required: r.incompatible.required,
+ current: r.incompatible.hostVersion,
+ })
+ )
+ return false
+ }
+ if (r.committed) {
+ setStagingId(null)
+ setConsent(null)
+ } else {
+ stagingRef.current = r.stagingId
+ setStagingId(r.stagingId)
+ setConsent(r.consent)
+ }
+ return r.committed
+ } catch (e) {
+ if (request === requestRef.current) showError(e)
+ return false
+ } finally {
+ if (request === requestRef.current && mountedRef.current) {
+ operationRef.current = 'idle'
+ setPending(false)
+ }
+ }
+ },
+ [showError, t]
+ )
+
+ const confirm = useCallback(
+ async (grants: GrantsMap): Promise<boolean> => {
+ const id = stagingRef.current
+ if (!id || operationRef.current !== 'idle' || !mountedRef.current)
+ return false
+ operationRef.current = 'confirming'
+ setPending(true)
+ setError(null)
+ try {
+ await transport.invoke(Commands.ConfirmPluginInstall, {
+ stagingId: id,
+ grants,
+ })
+ stagingRef.current = null
+ if (mountedRef.current) {
+ setStagingId(null)
+ setConsent(null)
+ }
+ return true
+ } catch (e) {
+ if (mountedRef.current) showError(e)
+ return false
+ } finally {
+ operationRef.current = 'idle'
+ if (mountedRef.current) setPending(false)
+ else if (stagingRef.current) {
+ void transport
+ .invoke(Commands.CancelPluginInstall, {
+ stagingId: stagingRef.current,
+ })
+ .catch(() => {})
+ stagingRef.current = null
+ }
+ }
+ },
+ [showError]
+ )
+
+ const cancel = useCallback(async (): Promise<boolean> => {
+ if (
+ operationRef.current === 'confirming' ||
+ operationRef.current === 'cancelling'
+ )
+ return false
+ const request = ++requestRef.current
+ operationRef.current = 'cancelling'
+ if (mountedRef.current) setPending(true)
+ try {
+ if (stagingRef.current) {
+ await transport.invoke(Commands.CancelPluginInstall, {
+ stagingId: stagingRef.current,
+ })
+ }
+ if (request !== requestRef.current) return false
+ stagingRef.current = null
+ if (mountedRef.current) {
+ setStagingId(null)
+ setConsent(null)
+ setError(null)
+ }
return true
} catch (e) {
- showError(e)
+ if (request === requestRef.current && mountedRef.current) showError(e)
return false
} finally {
- setPending(false)
+ if (request === requestRef.current) {
+ operationRef.current = 'idle'
+ if (mountedRef.current) setPending(false)
+ }
}
- }
-
- async function cancel(): Promise<void> {
- if (!stagingId) return
- await transport.invoke(Commands.CancelPluginInstall, { stagingId })
- setStagingId(null)
- setConsent(null)
- }
+ }, [showError])
return { stagingId, consent, pending, error, startInstall, confirm, cancel }
}
diff --git a/src/renderer/routes/plugins/lib/audience.ts b/src/renderer/routes/plugins/lib/audience.ts
index 9f7304cb..460e7d87 100644
--- a/src/renderer/routes/plugins/lib/audience.ts
+++ b/src/renderer/routes/plugins/lib/audience.ts
@@ -113,6 +113,10 @@ const PERMISSION_AUDIENCE: Record<
tone: 'optional',
toneLabelKey: 'plugins.permission.accessTone.required',
},
+ metadata: {
+ tone: 'optional',
+ toneLabelKey: 'plugins.permission.accessTone.required',
+ },
storage: {
tone: 'optional',
toneLabelKey: 'plugins.permission.accessTone.required',
diff --git a/src/renderer/routes/plugins/plugin-detail-page.test.tsx b/src/renderer/routes/plugins/plugin-detail-page.test.tsx
index 13ec4e00..07b6eac5 100644
--- a/src/renderer/routes/plugins/plugin-detail-page.test.tsx
+++ b/src/renderer/routes/plugins/plugin-detail-page.test.tsx
@@ -418,7 +418,12 @@ describe('PluginDetailPage', () => {
renderAt('/plugins/test.demo')
await user.click(screen.getByTestId('plugin-update-btn'))
- expect(await screen.findByText('Add plugin')).toBeInTheDocument()
+ await waitFor(() =>
+ expect(mockInvoke).toHaveBeenCalledWith(Commands.InstallPlugin, {
+ sourceType: 'registry',
+ pluginId: 'test.demo',
+ })
+ )
expect(screen.queryByText('Update builtin plugin')).toBeNull()
})
diff --git a/src/renderer/routes/plugins/plugin-detail-page.tsx b/src/renderer/routes/plugins/plugin-detail-page.tsx
index 700f4aa5..4cfdd9f0 100644
--- a/src/renderer/routes/plugins/plugin-detail-page.tsx
+++ b/src/renderer/routes/plugins/plugin-detail-page.tsx
@@ -49,11 +49,11 @@ import { PluginSecurityNotice } from './components/plugin-security-notice'
import { PluginSettingsForm } from './components/plugin-settings-form'
import { PluginStatusDot } from './components/plugin-status-dot'
import { RegistryDetailPanel } from './components/registry-detail-panel'
+import { RegistryInstallAction } from './components/registry-install-action'
import { UninstallSection } from './components/uninstall-section'
import { usePluginDetail } from './hooks/use-plugin-detail'
import { usePlugins } from './hooks/use-plugins'
import { useRegistryEntry, useRegistryUpdates } from './hooks/use-registry'
-import { PluginInstallDialog } from './plugin-install-dialog'
import { type UpdateChannel, usePluginsStore } from './store'
type DetailTab = 'operations' | 'overview' | 'settings' | 'access' | 'logs'
@@ -250,52 +250,60 @@ export function PluginDetailPage() {
</TooltipContent>
</Tooltip>
</TooltipProvider>
- {(isElectron || update?.channel !== 'builtin') && (
- <Tooltip>
- <TooltipTrigger
- render={
- update ? (
- <Button
- variant="ghost"
- size="icon-sm"
- onClick={() => {
- setUpdateChannel(update.channel)
- setUpdateOpen(true)
- }}
- aria-label={t('plugins.registry.updateTo', {
+ {update?.channel === 'community' ? (
+ <RegistryInstallAction
+ key={id}
+ pluginId={id}
+ updateVersion={update.latestVersion}
+ />
+ ) : (
+ (isElectron || update?.channel !== 'builtin') && (
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ update ? (
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ onClick={() => {
+ setUpdateChannel(update.channel)
+ setUpdateOpen(true)
+ }}
+ aria-label={t('plugins.registry.updateTo', {
+ version: update.latestVersion,
+ })}
+ data-testid="plugin-update-btn"
+ >
+ <PluginUpdateIcon className="size-4 text-foreground" />
+ </Button>
+ ) : (
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ onClick={() => void refresh()}
+ disabled={refreshing}
+ aria-label={t('plugins.registry.refresh')}
+ data-testid="plugin-detail-refresh-btn"
+ >
+ <RefreshIcon
+ className={cn(
+ 'size-4 text-foreground',
+ refreshing && 'animate-spin'
+ )}
+ />
+ </Button>
+ )
+ }
+ />
+ <TooltipContent side="bottom">
+ {update
+ ? t('plugins.registry.updateTo', {
version: update.latestVersion,
- })}
- data-testid="plugin-update-btn"
- >
- <PluginUpdateIcon className="size-4 text-foreground" />
- </Button>
- ) : (
- <Button
- variant="ghost"
- size="icon-sm"
- onClick={() => void refresh()}
- disabled={refreshing}
- aria-label={t('plugins.registry.refresh')}
- data-testid="plugin-detail-refresh-btn"
- >
- <RefreshIcon
- className={cn(
- 'size-4 text-foreground',
- refreshing && 'animate-spin'
- )}
- />
- </Button>
- )
- }
- />
- <TooltipContent side="bottom">
- {update
- ? t('plugins.registry.updateTo', {
- version: update.latestVersion,
- })
- : t('plugins.registry.refresh')}
- </TooltipContent>
- </Tooltip>
+ })
+ : t('plugins.registry.refresh')}
+ </TooltipContent>
+ </Tooltip>
+ )
)}
{platform.kind === 'electron' &&
listEntry.source?.type === 'builtin-update' && (
@@ -480,20 +488,13 @@ export function PluginDetailPage() {
</Tabs>
</PanelShell>
- {updateChannel !== null &&
- (updateChannel === 'builtin' ? (
- <BuiltinUpdateDialog
- pluginId={id}
- open={updateOpen}
- onOpenChange={setUpdateOpen}
- />
- ) : (
- <PluginInstallDialog
- open={updateOpen}
- onOpenChange={setUpdateOpen}
- fixedSource={{ sourceType: 'registry', pluginId: id }}
- />
- ))}
+ {updateChannel === 'builtin' && (
+ <BuiltinUpdateDialog
+ pluginId={id}
+ open={updateOpen}
+ onOpenChange={setUpdateOpen}
+ />
+ )}
</>
)
}
diff --git a/src/renderer/routes/plugins/plugin-install-dialog.registry.test.tsx b/src/renderer/routes/plugins/plugin-install-dialog.registry.test.tsx
index e28bc029..5e34793f 100644
--- a/src/renderer/routes/plugins/plugin-install-dialog.registry.test.tsx
+++ b/src/renderer/routes/plugins/plugin-install-dialog.registry.test.tsx
@@ -2,14 +2,19 @@ import '@test-utils/dom-animations'
import '@testing-library/jest-dom/vitest'
import '@renderer/lib/i18n'
import { Commands } from '@shared/protocol/commands'
-import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { beforeEach, describe, expect, it, vi } from 'vitest'
const { mockInvoke } = vi.hoisted(() => ({
mockInvoke: vi.fn().mockResolvedValue({
stagingId: 's_1',
consent: {
- manifest: { name: 'Speed Boost', description: 'x' },
+ manifest: {
+ id: 'acme.speed-boost',
+ name: 'Speed Boost',
+ version: '1.0.0',
+ description: 'x',
+ },
ffmpegRuntime: { requiredByPlugin: 'none', available: false },
},
}),
@@ -28,11 +33,174 @@ import { PluginInstallDialog } from './plugin-install-dialog'
import { usePluginsStore } from './store'
beforeEach(() => {
- mockInvoke.mockClear()
+ mockInvoke.mockReset().mockResolvedValue(preparedInstall('s_1'))
usePluginsStore.setState({ updates: {} })
})
+function preparedInstall(stagingId: string) {
+ return {
+ stagingId,
+ committed: false,
+ consent: {
+ manifest: {
+ id: 'acme.speed-boost',
+ name: 'Speed Boost',
+ version: '1.0.0',
+ description: 'x',
+ },
+ ffmpegRuntime: { requiredByPlugin: 'none', available: false },
+ },
+ }
+}
+
+function deferred<T>() {
+ let resolve!: (value: T) => void
+ const promise = new Promise<T>((done) => {
+ resolve = done
+ })
+ return { promise, resolve }
+}
+
describe('PluginInstallDialog with fixedSource', () => {
+ it('shows download and verification progress until the consent is ready', async () => {
+ const download = deferred<ReturnType<typeof preparedInstall>>()
+ mockInvoke.mockReturnValueOnce(download.promise)
+ render(
+ <PluginInstallDialog
+ open
+ onOpenChange={vi.fn()}
+ fixedSource={{ sourceType: 'registry', pluginId: 'acme.speed-boost' }}
+ />
+ )
+ expect(
+ screen.getByRole('heading', { name: 'Install plugin' })
+ ).toBeVisible()
+ expect(screen.getByRole('status')).toHaveTextContent('Preparing…')
+ expect(screen.queryByText(/Paste a plugin address/)).toBeNull()
+ expect(screen.queryByTestId('plugin-input-group')).toBeNull()
+ expect(screen.queryByTestId('consent-panel')).toBeNull()
+ expect(screen.queryByTestId('install-commit-btn')).toBeNull()
+
+ await act(async () => download.resolve(preparedInstall('s_ready')))
+ expect(await screen.findByTestId('consent-panel')).toBeVisible()
+ expect(screen.queryByRole('status')).toBeNull()
+ expect(screen.getByTestId('install-commit-btn')).toBeEnabled()
+ expect(mockInvoke).toHaveBeenCalledTimes(1)
+ })
+
+ it('offers retry after a download fails without returning to manual source entry', async () => {
+ mockInvoke.mockRejectedValueOnce(new Error('Download failed'))
+ render(
+ <PluginInstallDialog
+ open
+ onOpenChange={vi.fn()}
+ fixedSource={{ sourceType: 'registry', pluginId: 'acme.speed-boost' }}
+ />
+ )
+ expect(await screen.findByText('Download failed')).toBeVisible()
+ expect(screen.queryByRole('status')).toBeNull()
+ expect(screen.queryByTestId('install-commit-btn')).toBeNull()
+ fireEvent.click(screen.getByRole('button', { name: 'Retry' }))
+ expect(await screen.findByTestId('consent-panel')).toBeVisible()
+ expect(screen.queryByText('Download failed')).toBeNull()
+ expect(screen.queryByTestId('plugin-input-group')).toBeNull()
+ expect(mockInvoke).toHaveBeenCalledTimes(2)
+ })
+
+ it('discards a dismissed download when it finishes after reopening', async () => {
+ const previous = deferred<ReturnType<typeof preparedInstall>>()
+ const current = deferred<ReturnType<typeof preparedInstall>>()
+ mockInvoke.mockReturnValueOnce(previous.promise)
+ const onOpenChange = vi.fn()
+ const source = {
+ sourceType: 'registry' as const,
+ pluginId: 'acme.speed-boost',
+ }
+ const { rerender } = render(
+ <PluginInstallDialog
+ open
+ onOpenChange={onOpenChange}
+ fixedSource={source}
+ />
+ )
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
+ await waitFor(() => expect(onOpenChange).toHaveBeenCalledWith(false))
+ rerender(
+ <PluginInstallDialog
+ open={false}
+ onOpenChange={onOpenChange}
+ fixedSource={source}
+ />
+ )
+ mockInvoke.mockReturnValueOnce(current.promise)
+ rerender(
+ <PluginInstallDialog
+ open
+ onOpenChange={onOpenChange}
+ fixedSource={source}
+ />
+ )
+
+ await act(async () => previous.resolve(preparedInstall('s_dismissed')))
+ await waitFor(() =>
+ expect(mockInvoke).toHaveBeenCalledWith(Commands.CancelPluginInstall, {
+ stagingId: 's_dismissed',
+ })
+ )
+ expect(screen.queryByTestId('consent-panel')).toBeNull()
+ expect(screen.getByRole('status')).toBeVisible()
+
+ await act(async () => current.resolve(preparedInstall('s_current')))
+ expect(await screen.findByTestId('consent-panel')).toBeVisible()
+ fireEvent.click(screen.getByTestId('install-commit-btn'))
+ await waitFor(() =>
+ expect(mockInvoke).toHaveBeenCalledWith(Commands.ConfirmPluginInstall, {
+ stagingId: 's_current',
+ grants: {},
+ })
+ )
+ })
+
+ it('cancels staged consent when dismissed with the close button', async () => {
+ const onOpenChange = vi.fn()
+ render(
+ <PluginInstallDialog
+ open
+ onOpenChange={onOpenChange}
+ fixedSource={{ sourceType: 'registry', pluginId: 'acme.speed-boost' }}
+ />
+ )
+ await screen.findByTestId('consent-panel')
+ fireEvent.click(screen.getByRole('button', { name: 'Close' }))
+ await waitFor(() =>
+ expect(mockInvoke).toHaveBeenCalledWith(Commands.CancelPluginInstall, {
+ stagingId: 's_1',
+ })
+ )
+ await waitFor(() => expect(onOpenChange).toHaveBeenCalledWith(false))
+ })
+
+ it('keeps the dialog open while the confirmed installation is committing', async () => {
+ const commit = deferred<undefined>()
+ const onOpenChange = vi.fn()
+ render(
+ <PluginInstallDialog
+ open
+ onOpenChange={onOpenChange}
+ fixedSource={{ sourceType: 'registry', pluginId: 'acme.speed-boost' }}
+ />
+ )
+ await screen.findByTestId('consent-panel')
+ mockInvoke.mockReturnValueOnce(commit.promise)
+ fireEvent.click(screen.getByTestId('install-commit-btn'))
+ expect(screen.getByRole('button', { name: 'Cancel' })).toBeDisabled()
+ expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()
+ fireEvent.keyDown(screen.getByRole('dialog'), { key: 'Escape' })
+ expect(onOpenChange).not.toHaveBeenCalled()
+ await act(async () => commit.resolve(undefined))
+ await waitFor(() => expect(onOpenChange).toHaveBeenCalledWith(false))
+ })
+
it('explains media-merge compatibility without showing consent or allowing commit', async () => {
mockInvoke.mockResolvedValueOnce({
incompatible: {
@@ -54,7 +222,7 @@ describe('PluginInstallDialog with fixedSource', () => {
)
).toBeInTheDocument()
expect(screen.queryByTestId('consent-panel')).toBeNull()
- expect(screen.getByTestId('install-commit-btn')).toBeDisabled()
+ expect(screen.queryByTestId('install-commit-btn')).toBeNull()
expect(onOpenChange).not.toHaveBeenCalled()
expect(mockInvoke).toHaveBeenCalledTimes(1)
})
@@ -157,7 +325,7 @@ describe('PluginInstallDialog with fixedSource', () => {
expect(
await screen.findByText(/This version requires built-in privileges/)
).toBeInTheDocument()
- expect(screen.getByTestId('install-commit-btn')).toBeDisabled()
+ expect(screen.queryByTestId('install-commit-btn')).toBeNull()
})
it('closes after a trust-equivalent upgrade commits during staging', async () => {
diff --git a/src/renderer/routes/plugins/plugin-install-dialog.test.tsx b/src/renderer/routes/plugins/plugin-install-dialog.test.tsx
index f29f83f7..dccb120d 100644
--- a/src/renderer/routes/plugins/plugin-install-dialog.test.tsx
+++ b/src/renderer/routes/plugins/plugin-install-dialog.test.tsx
@@ -75,19 +75,20 @@ describe('PluginInstallDialog', () => {
expect(screen.queryByText('X')).toBeNull()
})
- it('Install button is disabled while consent is null', () => {
+ it('does not offer commit before consent is ready', () => {
render(<PluginInstallDialog open onOpenChange={vi.fn()} />)
- const install = screen.getByRole('button', { name: 'Install plugin' })
- expect(install).toBeDisabled()
+ expect(screen.queryByTestId('install-commit-btn')).toBeNull()
})
it('renders InlineConsentPanel when consent is loaded', () => {
state.consent = consent
state.stagingId = 's1'
render(<PluginInstallDialog open onOpenChange={vi.fn()} />)
- expect(screen.getByText('X')).toBeInTheDocument()
- expect(screen.getByText(/Before installing/)).toBeInTheDocument()
- const install = screen.getByRole('button', { name: 'Install plugin' })
+ expect(
+ screen.getByRole('heading', { name: 'Install X 1.0?' })
+ ).toBeInTheDocument()
+ expect(screen.getByText(/This plugin is not verified/)).toBeInTheDocument()
+ const install = screen.getByRole('button', { name: 'Allow and install' })
expect(install).toBeEnabled()
})
@@ -95,7 +96,7 @@ describe('PluginInstallDialog', () => {
state.consent = consent
state.stagingId = 's1'
render(<PluginInstallDialog open onOpenChange={vi.fn()} />)
- fireEvent.click(screen.getByRole('button', { name: 'Install plugin' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Allow and install' }))
expect(state.confirm).toHaveBeenCalled()
})
diff --git a/src/renderer/routes/plugins/plugin-install-dialog.tsx b/src/renderer/routes/plugins/plugin-install-dialog.tsx
index d81312df..6a3e0f0e 100644
--- a/src/renderer/routes/plugins/plugin-install-dialog.tsx
+++ b/src/renderer/routes/plugins/plugin-install-dialog.tsx
@@ -14,11 +14,19 @@ import {
ScrollAreaViewport,
ScrollBar,
} from '@renderer/components/ui/scroll-area'
+import { Spinner } from '@renderer/components/ui/spinner'
import { cn } from '@renderer/lib/utils'
import type { ConsentPayloadFfmpegRuntime } from '@shared/types/plugin-install'
-import { useEffect, useRef, useState } from 'react'
+import {
+ type ReactNode,
+ type RefObject,
+ useEffect,
+ useRef,
+ useState,
+} from 'react'
import { useTranslation } from 'react-i18next'
import { InlineConsentPanel } from './components/inline-consent-panel'
+import { PluginAvatar } from './components/plugin-avatar'
import {
type CheckArgs,
PluginInputGroup,
@@ -69,36 +77,76 @@ interface Props {
* soon as the dialog opens. Provided by RegistryDetailPanel (install)
* and PluginDetailPage (update) — both funnel into the same consent UI.
*/
- fixedSource?: InstallSource
+ fixedSource?: Extract<InstallSource, { sourceType: 'registry' }>
+ /** A fixed-source action keeps staging feedback beside its trigger. */
+ renderTrigger?: (state: {
+ preparing: boolean
+ error: string | null
+ cancel: () => void
+ retry: () => void
+ }) => ReactNode
+ inlineErrors?: boolean
+ returnFocusRef?: RefObject<HTMLButtonElement | null>
+ onInstalled?: () => void
}
-export function PluginInstallDialog({
+export function PluginInstallDialog(props: Props) {
+ return (
+ <PluginInstallSession
+ key={props.fixedSource?.pluginId ?? 'manual'}
+ {...props}
+ />
+ )
+}
+
+function PluginInstallSession({
open,
onOpenChange,
fixedSource,
+ renderTrigger,
+ inlineErrors = false,
+ returnFocusRef,
+ onInstalled,
}: Props) {
const { t } = useTranslation()
const install = usePluginInstall()
const clearUpdate = usePluginsStore((s) => s.clearUpdate)
const [grants, setGrants] = useState<GrantsMap>({})
const startedRef = useRef(false)
+ const wasOpenRef = useRef(false)
+ const cancelButtonRef = useRef<HTMLButtonElement>(null)
+
+ const callbacksRef = useRef({ open, onOpenChange, onInstalled })
+ callbacksRef.current = { open, onOpenChange, onInstalled }
+ const pluginId = fixedSource?.pluginId
+ const { startInstall, cancel } = install
+ useEffect(
+ () => () => {
+ startedRef.current = false
+ },
+ []
+ )
- // biome-ignore lint/correctness/useExhaustiveDependencies: startedRef gates re-entry; install fns are unstable by construction
useEffect(() => {
if (!open) {
startedRef.current = false
+ if (wasOpenRef.current) void cancel()
+ wasOpenRef.current = false
return
}
- if (!fixedSource || startedRef.current) return
+ wasOpenRef.current = true
+ if (!pluginId || startedRef.current) return
startedRef.current = true
setGrants({})
- void install.startInstall(fixedSource).then((committed) => {
- if (!committed) return
- if (fixedSource.sourceType === 'registry')
- clearUpdate(fixedSource.pluginId)
- onOpenChange(false)
- })
- }, [open, fixedSource])
+ void startInstall({ sourceType: 'registry', pluginId }).then(
+ (committed) => {
+ if (!committed) return
+ clearUpdate(pluginId)
+ callbacksRef.current.onInstalled?.()
+ callbacksRef.current.onOpenChange(false)
+ }
+ )
+ }, [open, pluginId, startInstall, cancel, clearUpdate])
function close() {
setGrants({})
@@ -106,10 +154,22 @@ export function PluginInstallDialog({
}
async function onCancel() {
- await install.cancel()
+ if (install.pending && install.consent) return
+ if ((await install.cancel()) === false) return
close()
}
+ async function retry() {
+ if (!fixedSource || install.pending) return
+ setGrants({})
+ if (await install.startInstall(fixedSource)) {
+ if (fixedSource.sourceType === 'registry')
+ clearUpdate(fixedSource.pluginId)
+ onInstalled?.()
+ close()
+ }
+ }
+
async function onInstall() {
if (!install.consent) return
if (!(await install.confirm(grants))) return
@@ -123,15 +183,17 @@ export function PluginInstallDialog({
if (fixedSource?.sourceType === 'registry') {
clearUpdate(fixedSource.pluginId)
}
+ onInstalled?.()
close()
}
async function onCheck(args: CheckArgs) {
+ if (!callbacksRef.current.open) return
// Picking a new file mid-review must drop the previous staging dir and
// its grants — otherwise plugin A's grants would carry into plugin B's
// consent UI.
if (install.stagingId) {
- await install.cancel()
+ if ((await install.cancel()) === false) return
}
setGrants({})
if (await install.startInstall(args)) close()
@@ -141,73 +203,146 @@ export function PluginInstallDialog({
install.consent?.ffmpegRuntime.requiredByPlugin === 'required' &&
(install.consent.ffmpegRuntime.available === false ||
install.consent.ffmpegRuntime.satisfiesRange === false)
+ useEffect(() => {
+ if (open && install.consent) cancelButtonRef.current?.focus()
+ }, [open, install.consent])
+
+ const preparing = open && !!fixedSource && !install.consent && !install.error
+ const committing = install.pending && !!install.consent
+
+ const dialogOpen =
+ open &&
+ (!renderTrigger || !!install.consent || (!inlineErrors && !!install.error))
return (
- <Dialog open={open} onOpenChange={(v) => !v && close()}>
- <DialogContent className="flex max-h-[min(760px,calc(100vh-2rem))] max-w-[760px] grid-rows-none flex-col gap-0 overflow-hidden p-0">
- <DialogHeader className="shrink-0 px-4 pt-4 pb-2">
- <DialogTitle className="text-base">
- {t('plugins.install.title')}
- </DialogTitle>
- <DialogDescription className="text-sm leading-6">
- {t('plugins.install.lead')}
- </DialogDescription>
- </DialogHeader>
-
- <ScrollArea className="flex min-h-0 min-w-0 flex-1 flex-col">
- <ScrollAreaViewport
- tabIndex={-1}
- className="min-h-0 flex-1 overscroll-contain"
- >
- <ScrollAreaContent
- className="space-y-4 px-4 pb-4"
- style={{ minWidth: '100%' }}
- >
- {install.error && (
- <Alert
- variant="destructive"
- className="mb-4 shadow-none border"
- >
- <span className="text-xs">{install.error}</span>
- </Alert>
+ <>
+ {renderTrigger?.({
+ preparing,
+ error: open && !install.consent ? install.error : null,
+ cancel: () => void onCancel(),
+ retry: () => void retry(),
+ })}
+ <Dialog open={dialogOpen} onOpenChange={(v) => !v && void onCancel()}>
+ <DialogContent
+ showCloseButton={!committing}
+ initialFocus={install.consent ? cancelButtonRef : undefined}
+ finalFocus={returnFocusRef}
+ className="flex max-h-[min(800px,calc(100dvh-2rem))] w-[540px] max-w-[calc(100vw-2rem)] sm:max-w-[540px] flex-col gap-0 overflow-hidden p-0"
+ >
+ <DialogHeader className="shrink-0 px-6 pt-6 pb-5 pe-12">
+ {install.consent ? (
+ <div className="flex items-center gap-3">
+ <PluginAvatar plugin={install.consent.manifest} size={48} />
+ <DialogTitle className="min-w-0 break-words text-base font-semibold leading-6">
+ {t(
+ install.consent.diff
+ ? 'plugins.consent.upgradeTitle'
+ : 'plugins.consent.installTitle',
+ {
+ name: install.consent.manifest.name,
+ version: install.consent.manifest.version,
+ }
+ )}
+ </DialogTitle>
+ </div>
+ ) : (
+ <DialogTitle className="text-base font-semibold">
+ {t(
+ fixedSource
+ ? 'plugins.install.install'
+ : 'plugins.install.title'
+ )}
+ </DialogTitle>
+ )}
+ <DialogDescription className="mt-1 text-sm leading-6">
+ {t(
+ fixedSource || install.consent
+ ? 'plugins.install.reviewLead'
+ : 'plugins.install.lead'
)}
+ </DialogDescription>
+ </DialogHeader>
- {!fixedSource && (
- <PluginInputGroup
- onCheck={onCheck}
- checking={install.pending}
- />
- )}
+ <ScrollArea className="flex min-h-0 min-w-0 flex-1 flex-col">
+ <ScrollAreaViewport
+ tabIndex={-1}
+ className="min-h-0 flex-1 overscroll-contain"
+ >
+ <ScrollAreaContent
+ className="space-y-4 px-6 pb-5"
+ style={{ minWidth: '100%' }}
+ >
+ {install.error && (
+ <Alert
+ variant="destructive"
+ className="mb-4 shadow-none border"
+ >
+ <span className="text-xs">{install.error}</span>
+ </Alert>
+ )}
+
+ {preparing && !renderTrigger && (
+ <div
+ role="status"
+ className="flex items-center gap-3 py-6 text-sm text-muted-foreground"
+ >
+ <Spinner aria-hidden="true" />
+ <span>{t('plugins.install.preparing')}</span>
+ </div>
+ )}
- {install.consent && (
- <>
- <FfmpegRuntimeBlock rt={install.consent.ffmpegRuntime} />
- <InlineConsentPanel
- consent={install.consent}
- grants={grants}
- onGrantsChange={setGrants}
+ {open && !fixedSource && !install.consent && (
+ <PluginInputGroup
+ onCheck={onCheck}
+ checking={install.pending}
/>
- </>
- )}
- </ScrollAreaContent>
- </ScrollAreaViewport>
- <ScrollBar />
- </ScrollArea>
-
- <DialogFooter className="shrink-0 border-t bg-background px-4 py-3">
- <Button variant="outline" size="sm" onClick={onCancel}>
- {t('common.cancel')}
- </Button>
- <Button
- size="sm"
- onClick={onInstall}
- data-testid="install-commit-btn"
- disabled={!install.consent || install.pending || ffmpegBlocking}
- >
- {t('plugins.install.install')}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
+ )}
+
+ {install.consent && (
+ <>
+ <FfmpegRuntimeBlock rt={install.consent.ffmpegRuntime} />
+ <InlineConsentPanel
+ consent={install.consent}
+ grants={grants}
+ onGrantsChange={setGrants}
+ disabled={install.pending}
+ />
+ </>
+ )}
+ </ScrollAreaContent>
+ </ScrollAreaViewport>
+ <ScrollBar />
+ </ScrollArea>
+
+ <DialogFooter className="shrink-0 flex-row justify-end border-t bg-muted/20 px-6 py-4">
+ <Button
+ ref={cancelButtonRef}
+ variant="outline"
+ size="sm"
+ onClick={onCancel}
+ disabled={committing}
+ >
+ {t('common.cancel')}
+ </Button>
+ {fixedSource && install.error && !install.consent && (
+ <Button size="sm" onClick={retry} disabled={install.pending}>
+ {t('common.retry')}
+ </Button>
+ )}
+ {install.consent && (
+ <Button
+ size="sm"
+ onClick={onInstall}
+ data-testid="install-commit-btn"
+ disabled={!install.consent || install.pending || ffmpegBlocking}
+ >
+ {committing && <Spinner aria-hidden="true" />}
+ {t('plugins.consent.confirm')}
+ </Button>
+ )}
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ </>
)
}
diff --git a/src/shared/locales/ar.json b/src/shared/locales/ar.json
index 29ff6b42..a3f77907 100644
--- a/src/shared/locales/ar.json
+++ b/src/shared/locales/ar.json
@@ -1582,6 +1582,8 @@
"github.spec": "مستودع GitHub (owner/repo[@tag])",
"install": "تثبيت الإضافة",
"lead": "الصق عنوان إضافة، أو اختر ملف .moext، أو أفلت ملفًا في حقل الإدخال.",
+ "reviewLead": "راجع أذونات الإضافة قبل تثبيتها.",
+ "preparing": "جارٍ التحضير…",
"local": "ملف محلي",
"local.pick": "اختيار ملف .moext",
"localPrepareFailed": "تعذّر تحضير ملف الإضافة هذا: {{detail}}",
@@ -1596,7 +1598,10 @@
"officialSignatureInvalid": "تعذر التحقق من توقيع الإضافة الرسمي. حاول تحديث متجر الإضافات.",
"officialBuiltinOnly": "يتطلب هذا الإصدار صلاحيات الإضافات المضمنة. ثبّت إصدارًا أحدث يدعم التثبيت الاختياري.",
"builtinAlreadyInstalled": "هذه الإضافة مضمنة بالفعل. استخدم إجراء التحديث الخاص بها.",
- "hostIncompatible": "تتطلب هذه الإضافة Motrix {{required}}؛ الإصدار الحالي: {{current}}. قم بالترقية أو التبديل إلى إصدار متوافق من Motrix ثم أعد المحاولة."
+ "hostIncompatible": "تتطلب هذه الإضافة Motrix {{required}}؛ الإصدار الحالي: {{current}}. قم بالترقية أو التبديل إلى إصدار متوافق من Motrix ثم أعد المحاولة.",
+ "installed": "تم التثبيت",
+ "optionalHint": "معطّلة افتراضيًا؛ فعّلها عند الحاجة",
+ "optionalLater": "يمكنك تغيير الأذونات الاختيارية في إعدادات الإضافة بعد التثبيت."
},
"lead": "أضف ميزات صغيرة إلى Motrix. احتفظ بالإضافات التي تثق بها، وعطّل الباقي.",
"logs": {
@@ -1689,6 +1694,10 @@
},
"unknown": {
"plain": "إذن غير معروف."
+ },
+ "metadata": {
+ "strong": "قراءة بيانات المهام الوصفية وكتابتها",
+ "plain": "يحفظ المعلومات التي تنشئها هذه الإضافة لمهام التنزيل."
}
},
"permissions": {
diff --git a/src/shared/locales/bg.json b/src/shared/locales/bg.json
index f5cc5064..f9ea0d63 100644
--- a/src/shared/locales/bg.json
+++ b/src/shared/locales/bg.json
@@ -1514,6 +1514,8 @@
"github.spec": "GitHub хранилище (owner/repo[@tag])",
"install": "Инсталиране на приставката",
"lead": "Поставете адрес на приставка, изберете .moext файл или пуснете файл в полето.",
+ "reviewLead": "Прегледайте разрешенията на приставката преди инсталиране.",
+ "preparing": "Подготовка…",
"local": "Локален файл",
"local.pick": "Избор на .moext файл",
"localPrepareFailed": "Този файл на приставка не можа да бъде подготвен: {{detail}}",
@@ -1528,7 +1530,10 @@
"officialSignatureInvalid": "Официалният подпис на приставката не може да бъде проверен. Опреснете каталога.",
"officialBuiltinOnly": "Тази версия изисква права на вградена приставка. Инсталирайте по-нова версия, която поддържа незадължителна инсталация.",
"builtinAlreadyInstalled": "Тази приставка вече е вградена. Използвайте действието за обновяване.",
- "hostIncompatible": "Тази приставка изисква Motrix {{required}}; текуща версия: {{current}}. Надстройте или преминете към съвместима версия на Motrix и опитайте отново."
+ "hostIncompatible": "Тази приставка изисква Motrix {{required}}; текуща версия: {{current}}. Надстройте или преминете към съвместима версия на Motrix и опитайте отново.",
+ "installed": "Инсталирано",
+ "optionalHint": "Изключени по подразбиране; включете при нужда",
+ "optionalLater": "След инсталиране можете да промените незадължителните разрешения в настройките на разширението."
},
"lead": "Добавяйте малки функции към Motrix. Оставете включени приставките, на които имате доверие, и изключете останалите.",
"logs": {
@@ -1617,6 +1622,10 @@
},
"unknown": {
"plain": "Неизвестно разрешение."
+ },
+ "metadata": {
+ "strong": "Четене и запис на метаданни за задачи",
+ "plain": "Запазва информацията, генерирана от това разширение за задачите за изтегляне."
}
},
"permissions": {
diff --git a/src/shared/locales/ca.json b/src/shared/locales/ca.json
index c52ea1b0..f284aa55 100644
--- a/src/shared/locales/ca.json
+++ b/src/shared/locales/ca.json
@@ -1531,6 +1531,8 @@
"github.spec": "Repositori de GitHub (owner/repo[@tag])",
"install": "Instal·lar el connector",
"lead": "Enganxeu l'adreça d'un connector, trieu un fitxer .moext o deixeu anar un fitxer al camp d'entrada.",
+ "reviewLead": "Revisa els permisos del complement abans d’instal·lar-lo.",
+ "preparing": "S’està preparant…",
"local": "Fitxer local",
"local.pick": "Triar un fitxer .moext",
"localPrepareFailed": "No s'ha pogut preparar aquest fitxer de connector: {{detail}}",
@@ -1545,7 +1547,10 @@
"officialSignatureInvalid": "No s’ha pogut verificar la signatura oficial del connector. Actualitzeu el catàleg.",
"officialBuiltinOnly": "Aquesta versió requereix privilegis de connector integrat. Instal·leu una versió més recent que admeti la instal·lació opcional.",
"builtinAlreadyInstalled": "Aquest connector ja està integrat. Feu servir la seva acció d’actualització.",
- "hostIncompatible": "Aquest complement requereix Motrix {{required}}; versió actual: {{current}}. Actualitza o canvia a una versió compatible de Motrix i torna-ho a provar."
+ "hostIncompatible": "Aquest complement requereix Motrix {{required}}; versió actual: {{current}}. Actualitza o canvia a una versió compatible de Motrix i torna-ho a provar.",
+ "installed": "Instal·lat",
+ "optionalHint": "Desactivats per defecte; activeu-los si cal",
+ "optionalLater": "Podeu canviar els permisos opcionals a la configuració del connector després d’instal·lar-lo."
},
"lead": "Afegiu petites funcions al Motrix. Manteniu els connectors de confiança i desactiveu la resta.",
"logs": {
@@ -1635,6 +1640,10 @@
},
"unknown": {
"plain": "Permís desconegut."
+ },
+ "metadata": {
+ "strong": "Llegir i escriure metadades de tasques",
+ "plain": "Desa la informació generada per aquest connector per a les tasques de baixada."
}
},
"permissions": {
diff --git a/src/shared/locales/de.json b/src/shared/locales/de.json
index 75bbccae..07b668fc 100644
--- a/src/shared/locales/de.json
+++ b/src/shared/locales/de.json
@@ -2323,6 +2323,8 @@
"local": "Lokale Datei",
"local.pick": ".moext-Datei auswählen",
"lead": "Fügen Sie eine Plugin-Adresse ein, wählen Sie eine .moext-Datei oder ziehen Sie eine Datei in das Eingabefeld.",
+ "reviewLead": "Prüfe vor der Installation die Berechtigungen des Plugins.",
+ "preparing": "Wird vorbereitet…",
"placeholder": "GitHub-Adresse oder URL einfügen oder eine lokale .moext-Datei auswählen",
"detected": {
"auto": "Automatisch",
@@ -2346,7 +2348,10 @@
"officialSignatureInvalid": "Die offizielle Signatur des Plugins konnte nicht bestätigt werden. Aktualisiere den Marktplatz.",
"officialBuiltinOnly": "Diese Version benötigt Berechtigungen eines integrierten Plugins. Installiere eine neuere Version, die eine optionale Installation unterstützt.",
"builtinAlreadyInstalled": "Dieses Plugin ist bereits integriert. Verwende seine Aktualisierungsfunktion.",
- "hostIncompatible": "Dieses Plugin benötigt Motrix {{required}}. Aktuelle Version: {{current}}. Aktualisiere Motrix oder wechsle zu einer kompatiblen Version und versuche es erneut."
+ "hostIncompatible": "Dieses Plugin benötigt Motrix {{required}}. Aktuelle Version: {{current}}. Aktualisiere Motrix oder wechsle zu einer kompatiblen Version und versuche es erneut.",
+ "installed": "Installiert",
+ "optionalHint": "Standardmäßig aus; bei Bedarf aktivieren",
+ "optionalLater": "Optionale Berechtigungen lassen sich nach der Installation in den Plugin-Einstellungen ändern."
},
"consent": {
"installTitle": "{{name}} {{version}} installieren?",
@@ -2692,6 +2697,10 @@
"allowed": "Erlaubt",
"noAccess": "Aus",
"grant": "Erlauben"
+ },
+ "metadata": {
+ "strong": "Aufgabenmetadaten lesen und schreiben",
+ "plain": "Speichert vom Plugin erzeugte Informationen zu Download-Aufgaben."
}
},
"security": {
diff --git a/src/shared/locales/el.json b/src/shared/locales/el.json
index 7f464bc7..ef0efbe3 100644
--- a/src/shared/locales/el.json
+++ b/src/shared/locales/el.json
@@ -1514,6 +1514,8 @@
"github.spec": "Αποθετήριο GitHub (owner/repo[@tag])",
"install": "Εγκατάσταση πρόσθετου",
"lead": "Επικολλήστε τη διεύθυνση ενός πρόσθετου, επιλέξτε ένα αρχείο .moext ή αποθέστε ένα αρχείο στο πεδίο εισαγωγής.",
+ "reviewLead": "Ελέγξτε τα δικαιώματα του πρόσθετου πριν από την εγκατάσταση.",
+ "preparing": "Προετοιμασία…",
"local": "Τοπικό αρχείο",
"local.pick": "Επιλέξτε αρχείο .moext",
"localPrepareFailed": "Δεν ήταν δυνατή η προετοιμασία αυτού του αρχείου πρόσθετου: {{detail}}",
@@ -1528,7 +1530,10 @@
"officialSignatureInvalid": "Δεν ήταν δυνατή η επαλήθευση της επίσημης υπογραφής του πρόσθετου. Ανανεώστε τον κατάλογο.",
"officialBuiltinOnly": "Αυτή η έκδοση απαιτεί δικαιώματα ενσωματωμένου πρόσθετου. Εγκαταστήστε νεότερη έκδοση που υποστηρίζει προαιρετική εγκατάσταση.",
"builtinAlreadyInstalled": "Αυτό το πρόσθετο είναι ήδη ενσωματωμένο. Χρησιμοποιήστε την ενέργεια ενημέρωσής του.",
- "hostIncompatible": "Αυτό το πρόσθετο απαιτεί Motrix {{required}}· τρέχουσα έκδοση: {{current}}. Αναβαθμίστε ή μεταβείτε σε συμβατή έκδοση του Motrix και δοκιμάστε ξανά."
+ "hostIncompatible": "Αυτό το πρόσθετο απαιτεί Motrix {{required}}· τρέχουσα έκδοση: {{current}}. Αναβαθμίστε ή μεταβείτε σε συμβατή έκδοση του Motrix και δοκιμάστε ξανά.",
+ "installed": "Εγκαταστάθηκε",
+ "optionalHint": "Ανενεργά αρχικά· ενεργοποιήστε αν χρειάζεται",
+ "optionalLater": "Μπορείτε να αλλάξετε τις προαιρετικές άδειες στις ρυθμίσεις του πρόσθετου μετά την εγκατάσταση."
},
"lead": "Προσθέστε μικρές λειτουργίες στο Motrix. Κρατήστε όσες εμπιστεύεστε και απενεργοποιήστε τις υπόλοιπες.",
"logs": {
@@ -1617,6 +1622,10 @@
},
"unknown": {
"plain": "Άγνωστο δικαίωμα."
+ },
+ "metadata": {
+ "strong": "Ανάγνωση και εγγραφή μεταδεδομένων εργασιών",
+ "plain": "Αποθηκεύει πληροφορίες που δημιουργεί το πρόσθετο για εργασίες λήψης."
}
},
"permissions": {
diff --git a/src/shared/locales/en-US.json b/src/shared/locales/en-US.json
index defb9472..2bf74425 100644
--- a/src/shared/locales/en-US.json
+++ b/src/shared/locales/en-US.json
@@ -2323,6 +2323,8 @@
"local": "Local file",
"local.pick": "Pick a .moext file",
"lead": "Paste a plugin address, pick a .moext file, or drop a file in the input.",
+ "reviewLead": "Review the plugin’s permissions before installing.",
+ "preparing": "Preparing…",
"placeholder": "Paste a GitHub address, a URL, or pick a local .moext file",
"detected": {
"auto": "Auto",
@@ -2346,7 +2348,10 @@
"officialSignatureInvalid": "The official plugin signature could not be verified. Try refreshing the marketplace.",
"officialBuiltinOnly": "This version requires built-in privileges. Install a newer version that supports optional installation.",
"builtinAlreadyInstalled": "This plugin is already built in. Use its update action instead.",
- "hostIncompatible": "This plugin requires Motrix {{required}}; current version: {{current}}. Upgrade or switch to a compatible Motrix version and try again."
+ "hostIncompatible": "This plugin requires Motrix {{required}}; current version: {{current}}. Upgrade or switch to a compatible Motrix version and try again.",
+ "installed": "Installed",
+ "optionalHint": "Off by default; enable as needed",
+ "optionalLater": "You can change optional permissions in plugin settings after installation."
},
"consent": {
"installTitle": "Install {{name}} {{version}}?",
@@ -2692,6 +2697,10 @@
"allowed": "Allowed",
"noAccess": "Off",
"grant": "Allow"
+ },
+ "metadata": {
+ "strong": "Read and write task metadata",
+ "plain": "Stores information generated by this plugin for download tasks."
}
},
"security": {
diff --git a/src/shared/locales/es.json b/src/shared/locales/es.json
index c02340ec..7bc01125 100644
--- a/src/shared/locales/es.json
+++ b/src/shared/locales/es.json
@@ -2338,6 +2338,8 @@
"local": "Archivo local",
"local.pick": "Seleccionar archivo .moext",
"lead": "Pega la dirección de un plugin, elige un archivo .moext o arrastra un archivo al campo.",
+ "reviewLead": "Revisa los permisos del complemento antes de instalarlo.",
+ "preparing": "Preparando…",
"placeholder": "Pega una dirección de GitHub, una URL o elige un archivo .moext local",
"detected": {
"auto": "Automático",
@@ -2361,7 +2363,10 @@
"officialSignatureInvalid": "No se pudo verificar la firma oficial del complemento. Actualiza el catálogo.",
"officialBuiltinOnly": "Esta versión requiere privilegios de un complemento integrado. Instala una versión más reciente que admita la instalación opcional.",
"builtinAlreadyInstalled": "Este complemento ya está integrado. Usa su opción de actualización.",
- "hostIncompatible": "Este complemento requiere Motrix {{required}}; versión actual: {{current}}. Actualiza o cambia a una versión compatible de Motrix e inténtalo de nuevo."
+ "hostIncompatible": "Este complemento requiere Motrix {{required}}; versión actual: {{current}}. Actualiza o cambia a una versión compatible de Motrix e inténtalo de nuevo.",
+ "installed": "Instalado",
+ "optionalHint": "Desactivados por defecto; actívalos si los necesitas",
+ "optionalLater": "Puedes cambiar los permisos opcionales en los ajustes del complemento después de instalarlo."
},
"consent": {
"installTitle": "¿Instalar {{name}} {{version}}?",
@@ -2712,6 +2717,10 @@
"allowed": "Permitido",
"noAccess": "Desactivado",
"grant": "Permitir"
+ },
+ "metadata": {
+ "strong": "Leer y escribir metadatos de tareas",
+ "plain": "Guarda información generada por este complemento para las tareas de descarga."
}
},
"errors_many": "{{count}} errores",
diff --git a/src/shared/locales/fa.json b/src/shared/locales/fa.json
index a4436381..90748ea4 100644
--- a/src/shared/locales/fa.json
+++ b/src/shared/locales/fa.json
@@ -1514,6 +1514,8 @@
"github.spec": "مخزن GitHub (owner/repo[@tag])",
"install": "نصب افزونه",
"lead": "نشانی افزونه را جای‌گذاری کنید، فایل .moext انتخاب کنید یا فایل را در ورودی رها کنید.",
+ "reviewLead": "پیش از نصب، مجوزهای افزونه را بررسی کنید.",
+ "preparing": "در حال آماده‌سازی…",
"local": "فایل محلی",
"local.pick": "انتخاب فایل .moext",
"localPrepareFailed": "آماده‌سازی این فایل افزونه ممکن نشد: {{detail}}",
@@ -1528,7 +1530,10 @@
"officialSignatureInvalid": "امضای رسمی افزونه تأیید نشد. فهرست افزونه‌ها را تازه‌سازی کنید.",
"officialBuiltinOnly": "این نسخه به مجوزهای افزونهٔ داخلی نیاز دارد. نسخهٔ جدیدتری نصب کنید که نصب اختیاری را پشتیبانی کند.",
"builtinAlreadyInstalled": "این افزونه از قبل داخلی است. از گزینهٔ به‌روزرسانی آن استفاده کنید.",
- "hostIncompatible": "این افزونه به Motrix {{required}} نیاز دارد؛ نسخهٔ فعلی: {{current}}. Motrix را ارتقا دهید یا به نسخه‌ای سازگار تغییر دهید و دوباره تلاش کنید."
+ "hostIncompatible": "این افزونه به Motrix {{required}} نیاز دارد؛ نسخهٔ فعلی: {{current}}. Motrix را ارتقا دهید یا به نسخه‌ای سازگار تغییر دهید و دوباره تلاش کنید.",
+ "installed": "نصب شد",
+ "optionalHint": "پیش‌فرض خاموش؛ در صورت نیاز فعال کنید",
+ "optionalLater": "پس از نصب می‌توانید مجوزهای اختیاری را در تنظیمات افزونه تغییر دهید."
},
"lead": "قابلیت‌های کوچکی به Motrix اضافه کنید. افزونه‌های مورد اعتماد را نگه دارید و بقیه را خاموش کنید.",
"logs": {
@@ -1617,6 +1622,10 @@
},
"unknown": {
"plain": "مجوز ناشناخته."
+ },
+ "metadata": {
+ "strong": "خواندن و نوشتن فرادادهٔ وظایف",
+ "plain": "اطلاعات ایجادشده توسط این افزونه را برای وظایف بارگیری ذخیره می‌کند."
}
},
"permissions": {
diff --git a/src/shared/locales/fr.json b/src/shared/locales/fr.json
index 0d7a4290..5649735c 100644
--- a/src/shared/locales/fr.json
+++ b/src/shared/locales/fr.json
@@ -1531,6 +1531,8 @@
"github.spec": "Dépôt GitHub (owner/repo[@tag])",
"install": "Installer l’extension",
"lead": "Collez l’adresse d’une extension, choisissez un fichier .moext ou déposez un fichier dans le champ.",
+ "reviewLead": "Vérifiez les autorisations du plugin avant de l’installer.",
+ "preparing": "Préparation…",
"local": "Fichier local",
"local.pick": "Choisir un fichier .moext",
"localPrepareFailed": "Impossible de préparer ce fichier d’extension : {{detail}}",
@@ -1545,7 +1547,10 @@
"officialSignatureInvalid": "La signature officielle du plugin n’a pas pu être vérifiée. Actualisez le catalogue.",
"officialBuiltinOnly": "Cette version nécessite les privilèges d’un plugin intégré. Installez une version plus récente prenant en charge l’installation facultative.",
"builtinAlreadyInstalled": "Ce plugin est déjà intégré. Utilisez son action de mise à jour.",
- "hostIncompatible": "Ce plugin nécessite Motrix {{required}} ; version actuelle : {{current}}. Mettez à niveau ou passez à une version compatible de Motrix, puis réessayez."
+ "hostIncompatible": "Ce plugin nécessite Motrix {{required}} ; version actuelle : {{current}}. Mettez à niveau ou passez à une version compatible de Motrix, puis réessayez.",
+ "installed": "Installé",
+ "optionalHint": "Désactivées par défaut ; à activer au besoin",
+ "optionalLater": "Vous pouvez modifier les autorisations facultatives dans les paramètres du plugin après l’installation."
},
"lead": "Ajoutez des fonctionnalités à Motrix. Gardez les extensions de confiance et désactivez les autres.",
"logs": {
@@ -1635,6 +1640,10 @@
},
"unknown": {
"plain": "Autorisation inconnue."
+ },
+ "metadata": {
+ "strong": "Lire et écrire les métadonnées des tâches",
+ "plain": "Enregistre les informations générées par ce plugin pour les tâches de téléchargement."
}
},
"permissions": {
diff --git a/src/shared/locales/hu.json b/src/shared/locales/hu.json
index f993e8aa..624a5f24 100644
--- a/src/shared/locales/hu.json
+++ b/src/shared/locales/hu.json
@@ -2323,6 +2323,8 @@
"local": "Helyi fájl",
"local.pick": ".moext fájl kiválasztása",
"lead": "Illessz be egy bővítménycímet, válassz egy .moext fájlt, vagy húzz egy fájlt a beviteli mezőre.",
+ "reviewLead": "Telepítés előtt ellenőrizze a bővítmény engedélyeit.",
+ "preparing": "Előkészítés…",
"placeholder": "Illessz be egy GitHub-címet vagy URL-t, vagy válassz egy helyi .moext fájlt",
"detected": {
"auto": "Automatikus",
@@ -2346,7 +2348,10 @@
"officialSignatureInvalid": "A bővítmény hivatalos aláírása nem ellenőrizhető. Frissítse a katalógust.",
"officialBuiltinOnly": "Ez a verzió beépített bővítmény jogosultságait igényli. Telepítsen újabb, választható telepítést támogató verziót.",
"builtinAlreadyInstalled": "Ez a bővítmény már be van építve. Használja a frissítési műveletét.",
- "hostIncompatible": "A bővítményhez Motrix {{required}} szükséges; jelenlegi verzió: {{current}}. Frissítsen vagy váltson kompatibilis Motrix-verzióra, és próbálja újra."
+ "hostIncompatible": "A bővítményhez Motrix {{required}} szükséges; jelenlegi verzió: {{current}}. Frissítsen vagy váltson kompatibilis Motrix-verzióra, és próbálja újra.",
+ "installed": "Telepítve",
+ "optionalHint": "Alapból kikapcsolva; szükség szerint engedélyezhető",
+ "optionalLater": "A választható engedélyek a telepítés után a bővítmény beállításaiban módosíthatók."
},
"consent": {
"installTitle": "Telepíted a(z) {{name}} {{version}} verzióját?",
@@ -2692,6 +2697,10 @@
"allowed": "Engedélyezve",
"noAccess": "Kikapcsolva",
"grant": "Engedélyezés"
+ },
+ "metadata": {
+ "strong": "Feladatok metaadatainak olvasása és írása",
+ "plain": "Menti a bővítmény által a letöltési feladatokhoz létrehozott adatokat."
}
},
"security": {
diff --git a/src/shared/locales/id.json b/src/shared/locales/id.json
index 3f00626f..d6e80639 100644
--- a/src/shared/locales/id.json
+++ b/src/shared/locales/id.json
@@ -2307,6 +2307,8 @@
"local": "Berkas lokal",
"local.pick": "Pilih berkas .moext",
"lead": "Tempelkan alamat plugin, pilih berkas .moext, atau letakkan berkas pada kolom isian.",
+ "reviewLead": "Tinjau izin plugin sebelum memasang.",
+ "preparing": "Menyiapkan…",
"placeholder": "Tempelkan alamat GitHub, URL, atau pilih berkas .moext lokal",
"detected": {
"auto": "Otomatis",
@@ -2330,7 +2332,10 @@
"officialSignatureInvalid": "Tanda tangan resmi plugin tidak dapat diverifikasi. Coba segarkan katalog plugin.",
"officialBuiltinOnly": "Versi ini memerlukan hak akses plugin bawaan. Instal versi lebih baru yang mendukung instalasi opsional.",
"builtinAlreadyInstalled": "Plugin ini sudah menjadi bawaan. Gunakan tindakan pembaruannya.",
- "hostIncompatible": "Plugin ini memerlukan Motrix {{required}}; versi saat ini: {{current}}. Tingkatkan atau beralih ke versi Motrix yang kompatibel, lalu coba lagi."
+ "hostIncompatible": "Plugin ini memerlukan Motrix {{required}}; versi saat ini: {{current}}. Tingkatkan atau beralih ke versi Motrix yang kompatibel, lalu coba lagi.",
+ "installed": "Terpasang",
+ "optionalHint": "Nonaktif secara default; aktifkan jika perlu",
+ "optionalLater": "Anda dapat mengubah izin opsional di pengaturan plugin setelah pemasangan."
},
"consent": {
"installTitle": "Pasang {{name}} {{version}}?",
@@ -2671,6 +2676,10 @@
"allowed": "Diizinkan",
"noAccess": "Nonaktif",
"grant": "Izinkan"
+ },
+ "metadata": {
+ "strong": "Membaca dan menulis metadata tugas",
+ "plain": "Menyimpan informasi yang dibuat plugin ini untuk tugas unduhan."
}
},
"security": {
diff --git a/src/shared/locales/it.json b/src/shared/locales/it.json
index fecbb417..fec075a7 100644
--- a/src/shared/locales/it.json
+++ b/src/shared/locales/it.json
@@ -2339,6 +2339,8 @@
"local": "File locale",
"local.pick": "Scegli un file .moext",
"lead": "Incolla l’indirizzo di un plugin, scegli un file .moext o trascina un file nel campo.",
+ "reviewLead": "Controlla i permessi del plugin prima di installarlo.",
+ "preparing": "Preparazione…",
"placeholder": "Incolla un indirizzo GitHub o un URL oppure scegli un file .moext locale",
"detected": {
"auto": "Automatico",
@@ -2362,7 +2364,10 @@
"officialSignatureInvalid": "Impossibile verificare la firma ufficiale del plugin. Aggiorna il catalogo.",
"officialBuiltinOnly": "Questa versione richiede privilegi di un plugin integrato. Installa una versione più recente che supporti l’installazione facoltativa.",
"builtinAlreadyInstalled": "Questo plugin è già integrato. Usa la sua funzione di aggiornamento.",
- "hostIncompatible": "Questo plugin richiede Motrix {{required}}; versione attuale: {{current}}. Aggiorna o passa a una versione compatibile di Motrix e riprova."
+ "hostIncompatible": "Questo plugin richiede Motrix {{required}}; versione attuale: {{current}}. Aggiorna o passa a una versione compatibile di Motrix e riprova.",
+ "installed": "Installato",
+ "optionalHint": "Disattivati per impostazione predefinita; attivali se servono",
+ "optionalLater": "Puoi modificare i permessi facoltativi nelle impostazioni del plugin dopo l’installazione."
},
"consent": {
"installTitle": "Installare {{name}} {{version}}?",
@@ -2713,6 +2718,10 @@
"allowed": "Consentito",
"noAccess": "Disattivato",
"grant": "Consenti"
+ },
+ "metadata": {
+ "strong": "Leggere e scrivere i metadati delle attività",
+ "plain": "Salva le informazioni generate da questo plugin per le attività di download."
}
},
"security": {
diff --git a/src/shared/locales/ja.json b/src/shared/locales/ja.json
index 39f97e4a..92ad677f 100644
--- a/src/shared/locales/ja.json
+++ b/src/shared/locales/ja.json
@@ -2307,6 +2307,8 @@
"local": "ローカルファイル",
"local.pick": ".moext ファイルを選択",
"lead": "プラグインのアドレスを貼り付けるか、.moext ファイルを選択するか、入力欄にファイルをドロップしてください。",
+ "reviewLead": "インストール前にプラグインの権限を確認してください。",
+ "preparing": "準備中…",
"placeholder": "GitHub のアドレスや URL を貼り付けるか、ローカルの .moext ファイルを選択",
"detected": {
"auto": "自動",
@@ -2330,7 +2332,10 @@
"officialSignatureInvalid": "プラグインの公式署名を検証できませんでした。マーケットを更新してください。",
"officialBuiltinOnly": "このバージョンには内蔵プラグイン専用の権限が必要です。任意インストールに対応した新しいバージョンをインストールしてください。",
"builtinAlreadyInstalled": "このプラグインはすでに内蔵されています。プラグインの更新機能を使用してください。",
- "hostIncompatible": "このプラグインには Motrix {{required}} が必要です。現在のバージョンは {{current}} です。対応する Motrix バージョンに更新または切り替えて、再試行してください。"
+ "hostIncompatible": "このプラグインには Motrix {{required}} が必要です。現在のバージョンは {{current}} です。対応する Motrix バージョンに更新または切り替えて、再試行してください。",
+ "installed": "インストール済み",
+ "optionalHint": "初期状態はオフ。必要に応じて有効化",
+ "optionalLater": "インストール後、プラグイン設定で任意の権限を変更できます。"
},
"consent": {
"installTitle": "{{name}} {{version}} をインストールしますか?",
@@ -2671,6 +2676,10 @@
"allowed": "許可済み",
"noAccess": "オフ",
"grant": "許可"
+ },
+ "metadata": {
+ "strong": "タスクのメタデータの読み書き",
+ "plain": "このプラグインが生成した情報をダウンロードタスクに保存します。"
}
},
"security": {
diff --git a/src/shared/locales/ko.json b/src/shared/locales/ko.json
index f96bab88..7e1316cb 100644
--- a/src/shared/locales/ko.json
+++ b/src/shared/locales/ko.json
@@ -2307,6 +2307,8 @@
"local": "로컬 파일",
"local.pick": ".moext 파일 선택",
"lead": "플러그인 주소를 붙여넣거나 .moext 파일을 선택하거나 입력란에 파일을 끌어다 놓으세요.",
+ "reviewLead": "설치하기 전에 플러그인의 권한을 확인하세요.",
+ "preparing": "준비 중…",
"placeholder": "GitHub 주소 또는 URL을 붙여넣거나 로컬 .moext 파일을 선택하세요",
"detected": {
"auto": "자동",
@@ -2330,7 +2332,10 @@
"officialSignatureInvalid": "플러그인의 공식 서명을 확인할 수 없습니다. 마켓을 새로 고침해 주세요.",
"officialBuiltinOnly": "이 버전은 내장 플러그인 전용 권한이 필요합니다. 선택 설치를 지원하는 최신 버전을 설치해 주세요.",
"builtinAlreadyInstalled": "이 플러그인은 이미 내장되어 있습니다. 플러그인 업데이트 기능을 사용해 주세요.",
- "hostIncompatible": "이 플러그인에는 Motrix {{required}}이(가) 필요합니다. 현재 버전: {{current}}. 호환되는 Motrix 버전으로 업그레이드하거나 변경한 후 다시 시도하세요."
+ "hostIncompatible": "이 플러그인에는 Motrix {{required}}이(가) 필요합니다. 현재 버전: {{current}}. 호환되는 Motrix 버전으로 업그레이드하거나 변경한 후 다시 시도하세요.",
+ "installed": "설치됨",
+ "optionalHint": "기본적으로 꺼짐; 필요할 때 활성화",
+ "optionalLater": "설치 후 플러그인 설정에서 선택 권한을 변경할 수 있습니다."
},
"consent": {
"installTitle": "{{name}} {{version}}을(를) 설치하시겠습니까?",
@@ -2671,6 +2676,10 @@
"allowed": "허용됨",
"noAccess": "꺼짐",
"grant": "허용"
+ },
+ "metadata": {
+ "strong": "작업 메타데이터 읽기 및 쓰기",
+ "plain": "이 플러그인이 생성한 정보를 다운로드 작업에 저장합니다."
}
},
"security": {
diff --git a/src/shared/locales/nb.json b/src/shared/locales/nb.json
index 4d86c985..144ddb3f 100644
--- a/src/shared/locales/nb.json
+++ b/src/shared/locales/nb.json
@@ -1514,6 +1514,8 @@
"github.spec": "GitHub-kodelager (owner/repo[@tag])",
"install": "Installer programtillegg",
"lead": "Lim inn en adresse til et programtillegg, velg en .moext-fil eller slipp en fil i inndatafeltet.",
+ "reviewLead": "Se gjennom tillatelsene til programtillegget før installasjon.",
+ "preparing": "Klargjør…",
"local": "Lokal fil",
"local.pick": "Velg en .moext-fil",
"localPrepareFailed": "Kunne ikke klargjøre denne programtilleggsfilen: {{detail}}",
@@ -1528,7 +1530,10 @@
"officialSignatureInvalid": "Kunne ikke bekrefte den offisielle signaturen til programtillegget. Oppdater katalogen.",
"officialBuiltinOnly": "Denne versjonen krever rettigheter for innebygde programtillegg. Installer en nyere versjon som støtter valgfri installasjon.",
"builtinAlreadyInstalled": "Dette programtillegget er allerede innebygd. Bruk oppdateringsfunksjonen.",
- "hostIncompatible": "Dette programtillegget krever Motrix {{required}}; gjeldende versjon: {{current}}. Oppgrader eller bytt til en kompatibel Motrix-versjon og prøv igjen."
+ "hostIncompatible": "Dette programtillegget krever Motrix {{required}}; gjeldende versjon: {{current}}. Oppgrader eller bytt til en kompatibel Motrix-versjon og prøv igjen.",
+ "installed": "Installert",
+ "optionalHint": "Av som standard; slå på ved behov",
+ "optionalLater": "Du kan endre valgfrie tillatelser i utvidelsens innstillinger etter installasjon."
},
"lead": "Legg til små funksjoner i Motrix. Behold dem du stoler på, og slå av resten.",
"logs": {
@@ -1617,6 +1622,10 @@
},
"unknown": {
"plain": "Ukjent tillatelse."
+ },
+ "metadata": {
+ "strong": "Lese og skrive oppgavemetadata",
+ "plain": "Lagrer informasjon som denne utvidelsen lager for nedlastingsoppgaver."
}
},
"permissions": {
diff --git a/src/shared/locales/nl.json b/src/shared/locales/nl.json
index 90be1413..4624125e 100644
--- a/src/shared/locales/nl.json
+++ b/src/shared/locales/nl.json
@@ -1514,6 +1514,8 @@
"github.spec": "GitHub-repository (owner/repo[@tag])",
"install": "Plug-in installeren",
"lead": "Plak een plug-inadres, kies een .moext-bestand of sleep een bestand naar het invoerveld.",
+ "reviewLead": "Controleer de machtigingen van de plug-in vóór de installatie.",
+ "preparing": "Voorbereiden…",
"local": "Lokaal bestand",
"local.pick": "Kies een .moext-bestand",
"localPrepareFailed": "Dit plug-inbestand kon niet worden voorbereid: {{detail}}",
@@ -1528,7 +1530,10 @@
"officialSignatureInvalid": "De officiële handtekening van de plug-in kon niet worden geverifieerd. Vernieuw de catalogus.",
"officialBuiltinOnly": "Deze versie vereist rechten van een ingebouwde plug-in. Installeer een nieuwere versie die optionele installatie ondersteunt.",
"builtinAlreadyInstalled": "Deze plug-in is al ingebouwd. Gebruik de bijbehorende updatefunctie.",
- "hostIncompatible": "Deze plug-in vereist Motrix {{required}}; huidige versie: {{current}}. Werk Motrix bij of schakel over naar een compatibele versie en probeer het opnieuw."
+ "hostIncompatible": "Deze plug-in vereist Motrix {{required}}; huidige versie: {{current}}. Werk Motrix bij of schakel over naar een compatibele versie en probeer het opnieuw.",
+ "installed": "Geïnstalleerd",
+ "optionalHint": "Standaard uit; schakel in indien nodig",
+ "optionalLater": "Je kunt optionele machtigingen na installatie wijzigen in de plugininstellingen."
},
"lead": "Voeg kleine functies toe aan Motrix. Laat de plug-ins die je vertrouwt ingeschakeld en schakel de rest uit.",
"logs": {
@@ -1617,6 +1622,10 @@
},
"unknown": {
"plain": "Onbekende machtiging."
+ },
+ "metadata": {
+ "strong": "Taakmetadata lezen en schrijven",
+ "plain": "Slaat informatie op die deze plugin voor downloadtaken genereert."
}
},
"permissions": {
diff --git a/src/shared/locales/pl.json b/src/shared/locales/pl.json
index 6a29281b..7087590b 100644
--- a/src/shared/locales/pl.json
+++ b/src/shared/locales/pl.json
@@ -2355,6 +2355,8 @@
"local": "Plik lokalny",
"local.pick": "Wybierz plik .moext",
"lead": "Wklej adres wtyczki, wybierz plik .moext lub upuść plik w polu.",
+ "reviewLead": "Sprawdź uprawnienia wtyczki przed instalacją.",
+ "preparing": "Przygotowywanie…",
"placeholder": "Wklej adres GitHub, adres URL lub wybierz lokalny plik .moext",
"detected": {
"auto": "Automatycznie",
@@ -2378,7 +2380,10 @@
"officialSignatureInvalid": "Nie udało się zweryfikować oficjalnego podpisu wtyczki. Odśwież katalog.",
"officialBuiltinOnly": "Ta wersja wymaga uprawnień wbudowanej wtyczki. Zainstaluj nowszą wersję obsługującą opcjonalną instalację.",
"builtinAlreadyInstalled": "Ta wtyczka jest już wbudowana. Użyj jej funkcji aktualizacji.",
- "hostIncompatible": "Ta wtyczka wymaga Motrix {{required}}; bieżąca wersja: {{current}}. Zaktualizuj Motrix lub przejdź na zgodną wersję i spróbuj ponownie."
+ "hostIncompatible": "Ta wtyczka wymaga Motrix {{required}}; bieżąca wersja: {{current}}. Zaktualizuj Motrix lub przejdź na zgodną wersję i spróbuj ponownie.",
+ "installed": "Zainstalowano",
+ "optionalHint": "Domyślnie wyłączone; włącz w razie potrzeby",
+ "optionalLater": "Po instalacji możesz zmienić opcjonalne uprawnienia w ustawieniach wtyczki."
},
"consent": {
"installTitle": "Zainstalować {{name}} {{version}}?",
@@ -2734,6 +2739,10 @@
"allowed": "Dozwolone",
"noAccess": "Wyłączone",
"grant": "Zezwól"
+ },
+ "metadata": {
+ "strong": "Odczyt i zapis metadanych zadań",
+ "plain": "Zapisuje informacje generowane przez tę wtyczkę dla zadań pobierania."
}
},
"security": {
diff --git a/src/shared/locales/pt-BR.json b/src/shared/locales/pt-BR.json
index 2a644f64..27eafdef 100644
--- a/src/shared/locales/pt-BR.json
+++ b/src/shared/locales/pt-BR.json
@@ -2339,6 +2339,8 @@
"local": "Arquivo local",
"local.pick": "Escolher arquivo .moext",
"lead": "Cole o endereço de um plugin, escolha um arquivo .moext ou arraste um arquivo para o campo.",
+ "reviewLead": "Revise as permissões do plugin antes de instalar.",
+ "preparing": "Preparando…",
"placeholder": "Cole um endereço GitHub, um URL ou escolha um arquivo .moext local",
"detected": {
"auto": "Automático",
@@ -2362,7 +2364,10 @@
"officialSignatureInvalid": "Não foi possível verificar a assinatura oficial do plugin. Atualize o catálogo.",
"officialBuiltinOnly": "Esta versão exige privilégios de plugin integrado. Instale uma versão mais recente que permita a instalação opcional.",
"builtinAlreadyInstalled": "Este plugin já está integrado. Use a função de atualização dele.",
- "hostIncompatible": "Este plugin requer Motrix {{required}}; versão atual: {{current}}. Atualize ou mude para uma versão compatível do Motrix e tente novamente."
+ "hostIncompatible": "Este plugin requer Motrix {{required}}; versão atual: {{current}}. Atualize ou mude para uma versão compatível do Motrix e tente novamente.",
+ "installed": "Instalado",
+ "optionalHint": "Desativadas por padrão; ative se precisar",
+ "optionalLater": "Você pode alterar as permissões opcionais nas configurações do plugin após a instalação."
},
"consent": {
"installTitle": "Instalar {{name}} {{version}}?",
@@ -2713,6 +2718,10 @@
"allowed": "Permitido",
"noAccess": "Desativado",
"grant": "Permitir"
+ },
+ "metadata": {
+ "strong": "Ler e gravar metadados de tarefas",
+ "plain": "Salva informações geradas por este plugin para as tarefas de download."
}
},
"security": {
diff --git a/src/shared/locales/ro.json b/src/shared/locales/ro.json
index 1f2cac42..80e65b98 100644
--- a/src/shared/locales/ro.json
+++ b/src/shared/locales/ro.json
@@ -1531,6 +1531,8 @@
"github.spec": "Depozit GitHub (owner/repo[@tag])",
"install": "Instalează modulul",
"lead": "Lipește adresa unui modul, alege un fișier .moext sau trage un fișier în câmpul de introducere.",
+ "reviewLead": "Verifică permisiunile extensiei înainte de instalare.",
+ "preparing": "Se pregătește…",
"local": "Fișier local",
"local.pick": "Alege un fișier .moext",
"localPrepareFailed": "Acest fișier de modul nu a putut fi pregătit: {{detail}}",
@@ -1545,7 +1547,10 @@
"officialSignatureInvalid": "Semnătura oficială a extensiei nu a putut fi verificată. Reîmprospătați catalogul.",
"officialBuiltinOnly": "Această versiune necesită privilegii de extensie integrată. Instalați o versiune mai nouă care acceptă instalarea opțională.",
"builtinAlreadyInstalled": "Această extensie este deja integrată. Utilizați funcția sa de actualizare.",
- "hostIncompatible": "Acest plugin necesită Motrix {{required}}; versiunea curentă: {{current}}. Actualizează sau treci la o versiune compatibilă de Motrix și încearcă din nou."
+ "hostIncompatible": "Acest plugin necesită Motrix {{required}}; versiunea curentă: {{current}}. Actualizează sau treci la o versiune compatibilă de Motrix și încearcă din nou.",
+ "installed": "Instalat",
+ "optionalHint": "Dezactivate implicit; activați la nevoie",
+ "optionalLater": "Puteți schimba permisiunile opționale în setările extensiei după instalare."
},
"lead": "Adaugă funcții mici în Motrix. Păstrează active modulele în care ai încredere și dezactivează-le pe celelalte.",
"logs": {
@@ -1635,6 +1640,10 @@
},
"unknown": {
"plain": "Permisiune necunoscută."
+ },
+ "metadata": {
+ "strong": "Citirea și scrierea metadatelor sarcinilor",
+ "plain": "Salvează informațiile generate de această extensie pentru sarcinile de descărcare."
}
},
"permissions": {
diff --git a/src/shared/locales/ru.json b/src/shared/locales/ru.json
index 49834525..b0fbd548 100644
--- a/src/shared/locales/ru.json
+++ b/src/shared/locales/ru.json
@@ -2355,6 +2355,8 @@
"local": "Локальный файл",
"local.pick": "Выберите файл .moext",
"lead": "Вставьте адрес плагина, выберите файл .moext или перетащите файл в поле ввода.",
+ "reviewLead": "Проверьте разрешения плагина перед установкой.",
+ "preparing": "Подготовка…",
"placeholder": "Вставьте адрес GitHub, URL или выберите локальный файл .moext",
"detected": {
"auto": "Автоматически",
@@ -2378,7 +2380,10 @@
"officialSignatureInvalid": "Не удалось проверить официальную подпись плагина. Обновите каталог.",
"officialBuiltinOnly": "Эта версия требует прав встроенного плагина. Установите более новую версию с поддержкой необязательной установки.",
"builtinAlreadyInstalled": "Этот плагин уже встроен. Используйте его функцию обновления.",
- "hostIncompatible": "Для этого плагина требуется Motrix {{required}}; текущая версия: {{current}}. Обновите Motrix или перейдите на совместимую версию и повторите попытку."
+ "hostIncompatible": "Для этого плагина требуется Motrix {{required}}; текущая версия: {{current}}. Обновите Motrix или перейдите на совместимую версию и повторите попытку.",
+ "installed": "Установлено",
+ "optionalHint": "По умолчанию выключены; включайте при необходимости",
+ "optionalLater": "После установки дополнительные разрешения можно изменить в настройках плагина."
},
"consent": {
"installTitle": "Установить {{name}} {{version}}?",
@@ -2734,6 +2739,10 @@
"allowed": "Разрешено",
"noAccess": "Выключено",
"grant": "Разрешить"
+ },
+ "metadata": {
+ "strong": "Чтение и запись метаданных задач",
+ "plain": "Сохраняет сведения, созданные этим плагином для задач загрузки."
}
},
"security": {
diff --git a/src/shared/locales/th.json b/src/shared/locales/th.json
index 9fb9f29a..c6b5e80c 100644
--- a/src/shared/locales/th.json
+++ b/src/shared/locales/th.json
@@ -1497,6 +1497,8 @@
"github.spec": "คลัง GitHub (owner/repo[@tag])",
"install": "ติดตั้งปลั๊กอิน",
"lead": "วางที่อยู่ปลั๊กอิน เลือกไฟล์ .moext หรือลากไฟล์ลงในช่องป้อนข้อมูล",
+ "reviewLead": "ตรวจสอบสิทธิ์ของปลั๊กอินก่อนติดตั้ง",
+ "preparing": "กำลังเตรียม…",
"local": "ไฟล์ในเครื่อง",
"local.pick": "เลือกไฟล์ .moext",
"localPrepareFailed": "เตรียมไฟล์ปลั๊กอินนี้ไม่ได้: {{detail}}",
@@ -1511,7 +1513,10 @@
"officialSignatureInvalid": "ไม่สามารถตรวจสอบลายเซ็นอย่างเป็นทางการของปลั๊กอินได้ ลองรีเฟรชตลาดปลั๊กอิน",
"officialBuiltinOnly": "เวอร์ชันนี้ต้องใช้สิทธิ์ของปลั๊กอินในตัว โปรดติดตั้งเวอร์ชันใหม่ที่รองรับการติดตั้งแบบเลือกได้",
"builtinAlreadyInstalled": "ปลั๊กอินนี้มีอยู่ในตัวแล้ว โปรดใช้ฟังก์ชันอัปเดตของปลั๊กอิน",
- "hostIncompatible": "ปลั๊กอินนี้ต้องใช้ Motrix {{required}}; เวอร์ชันปัจจุบัน: {{current}} โปรดอัปเกรดหรือเปลี่ยนเป็น Motrix เวอร์ชันที่เข้ากันได้แล้วลองอีกครั้ง"
+ "hostIncompatible": "ปลั๊กอินนี้ต้องใช้ Motrix {{required}}; เวอร์ชันปัจจุบัน: {{current}} โปรดอัปเกรดหรือเปลี่ยนเป็น Motrix เวอร์ชันที่เข้ากันได้แล้วลองอีกครั้ง",
+ "installed": "ติดตั้งแล้ว",
+ "optionalHint": "ปิดไว้ตามค่าเริ่มต้น เปิดเมื่อจำเป็น",
+ "optionalLater": "คุณเปลี่ยนสิทธิ์เพิ่มเติมได้ในการตั้งค่าปลั๊กอินหลังติดตั้ง"
},
"lead": "เพิ่มความสามารถเล็กๆ ให้ Motrix เปิดใช้เฉพาะปลั๊กอินที่เชื่อถือและปิดที่เหลือ",
"logs": {
@@ -1599,6 +1604,10 @@
},
"unknown": {
"plain": "สิทธิ์ที่ไม่รู้จัก"
+ },
+ "metadata": {
+ "strong": "อ่านและเขียนข้อมูลเมตาของงาน",
+ "plain": "บันทึกข้อมูลที่ปลั๊กอินนี้สร้างสำหรับงานดาวน์โหลด"
}
},
"permissions": {
diff --git a/src/shared/locales/tr.json b/src/shared/locales/tr.json
index bdea8324..49f62db5 100644
--- a/src/shared/locales/tr.json
+++ b/src/shared/locales/tr.json
@@ -2323,6 +2323,8 @@
"local": "Yerel dosya",
"local.pick": "Bir .moext dosyası seçin",
"lead": "Eklenti adresi yapıştırın, bir .moext dosyası seçin veya giriş alanına bir dosya bırakın.",
+ "reviewLead": "Yüklemeden önce eklentinin izinlerini inceleyin.",
+ "preparing": "Hazırlanıyor…",
"placeholder": "GitHub adresi veya URL yapıştırın ya da yerel bir .moext dosyası seçin",
"detected": {
"auto": "Otomatik",
@@ -2346,7 +2348,10 @@
"officialSignatureInvalid": "Eklentinin resmî imzası doğrulanamadı. Eklenti mağazasını yenilemeyi deneyin.",
"officialBuiltinOnly": "Bu sürüm yerleşik eklenti yetkileri gerektirir. İsteğe bağlı kurulumu destekleyen daha yeni bir sürüm yükleyin.",
"builtinAlreadyInstalled": "Bu eklenti zaten yerleşiktir. Güncelleme işlevini kullanın.",
- "hostIncompatible": "Bu eklenti Motrix {{required}} gerektirir; mevcut sürüm: {{current}}. Motrix uygulamasını yükseltin veya uyumlu bir sürüme geçip yeniden deneyin."
+ "hostIncompatible": "Bu eklenti Motrix {{required}} gerektirir; mevcut sürüm: {{current}}. Motrix uygulamasını yükseltin veya uyumlu bir sürüme geçip yeniden deneyin.",
+ "installed": "Yüklendi",
+ "optionalHint": "Varsayılan olarak kapalı; gerektiğinde açın",
+ "optionalLater": "Kurulumdan sonra isteğe bağlı izinleri eklenti ayarlarından değiştirebilirsiniz."
},
"consent": {
"installTitle": "{{name}} {{version}} yüklensin mi?",
@@ -2692,6 +2697,10 @@
"allowed": "İzin verildi",
"noAccess": "Kapalı",
"grant": "İzin ver"
+ },
+ "metadata": {
+ "strong": "Görev meta verilerini okuma ve yazma",
+ "plain": "Bu eklentinin indirme görevleri için ürettiği bilgileri kaydeder."
}
},
"security": {
diff --git a/src/shared/locales/uk.json b/src/shared/locales/uk.json
index 75a6ea56..39a54a7e 100644
--- a/src/shared/locales/uk.json
+++ b/src/shared/locales/uk.json
@@ -1548,6 +1548,8 @@
"github.spec": "Репозиторій GitHub (owner/repo[@tag])",
"install": "Встановити плагін",
"lead": "Вставте адресу плагіна, виберіть файл .moext або перетягніть файл у поле введення.",
+ "reviewLead": "Перевірте дозволи плагіна перед встановленням.",
+ "preparing": "Підготовка…",
"local": "Локальний файл",
"local.pick": "Вибрати файл .moext",
"localPrepareFailed": "Не вдалося підготувати файл плагіна: {{detail}}",
@@ -1562,7 +1564,10 @@
"officialSignatureInvalid": "Не вдалося перевірити офіційний підпис плагіна. Оновіть каталог.",
"officialBuiltinOnly": "Ця версія потребує прав вбудованого плагіна. Установіть новішу версію з підтримкою необов’язкового встановлення.",
"builtinAlreadyInstalled": "Цей плагін уже вбудований. Скористайтеся його функцією оновлення.",
- "hostIncompatible": "Цей плагін потребує Motrix {{required}}; поточна версія: {{current}}. Оновіть Motrix або перейдіть на сумісну версію та повторіть спробу."
+ "hostIncompatible": "Цей плагін потребує Motrix {{required}}; поточна версія: {{current}}. Оновіть Motrix або перейдіть на сумісну версію та повторіть спробу.",
+ "installed": "Встановлено",
+ "optionalHint": "Типово вимкнено; увімкніть за потреби",
+ "optionalLater": "Після встановлення додаткові дозволи можна змінити в налаштуваннях плагіна."
},
"lead": "Додавайте невеликі можливості до Motrix. Залишайте довірені плагіни, решту вимикайте.",
"logs": {
@@ -1653,6 +1658,10 @@
},
"unknown": {
"plain": "Невідомий дозвіл."
+ },
+ "metadata": {
+ "strong": "Читання й запис метаданих завдань",
+ "plain": "Зберігає відомості, створені цим плагіном для завдань завантаження."
}
},
"permissions": {
diff --git a/src/shared/locales/vi.json b/src/shared/locales/vi.json
index 52d5a5fe..86762147 100644
--- a/src/shared/locales/vi.json
+++ b/src/shared/locales/vi.json
@@ -2307,6 +2307,8 @@
"local": "Tệp cục bộ",
"local.pick": "Chọn tệp .moext",
"lead": "Dán địa chỉ tiện ích, chọn tệp .moext hoặc thả tệp vào ô nhập.",
+ "reviewLead": "Kiểm tra quyền của tiện ích trước khi cài đặt.",
+ "preparing": "Đang chuẩn bị…",
"placeholder": "Dán địa chỉ GitHub, URL hoặc chọn tệp .moext cục bộ",
"detected": {
"auto": "Tự động",
@@ -2330,7 +2332,10 @@
"officialSignatureInvalid": "Không thể xác minh chữ ký chính thức của tiện ích. Hãy làm mới danh mục.",
"officialBuiltinOnly": "Phiên bản này yêu cầu quyền của tiện ích tích hợp. Hãy cài phiên bản mới hơn hỗ trợ cài đặt tùy chọn.",
"builtinAlreadyInstalled": "Tiện ích này đã được tích hợp. Hãy dùng chức năng cập nhật của tiện ích.",
- "hostIncompatible": "Plugin này yêu cầu Motrix {{required}}; phiên bản hiện tại: {{current}}. Hãy nâng cấp hoặc chuyển sang phiên bản Motrix tương thích rồi thử lại."
+ "hostIncompatible": "Plugin này yêu cầu Motrix {{required}}; phiên bản hiện tại: {{current}}. Hãy nâng cấp hoặc chuyển sang phiên bản Motrix tương thích rồi thử lại.",
+ "installed": "Đã cài đặt",
+ "optionalHint": "Mặc định tắt; bật khi cần",
+ "optionalLater": "Bạn có thể thay đổi các quyền tùy chọn trong cài đặt tiện ích sau khi cài đặt."
},
"consent": {
"installTitle": "Cài {{name}} {{version}}?",
@@ -2671,6 +2676,10 @@
"allowed": "Đã cho phép",
"noAccess": "Tắt",
"grant": "Cho phép"
+ },
+ "metadata": {
+ "strong": "Đọc và ghi siêu dữ liệu tác vụ",
+ "plain": "Lưu thông tin do tiện ích này tạo cho các tác vụ tải xuống."
}
},
"security": {
diff --git a/src/shared/locales/zh-CN.json b/src/shared/locales/zh-CN.json
index 25c46c0c..fb399117 100644
--- a/src/shared/locales/zh-CN.json
+++ b/src/shared/locales/zh-CN.json
@@ -2307,6 +2307,8 @@
"local": "本地文件",
"local.pick": "选择 .moext 文件",
"lead": "粘贴插件地址、选择 .moext 文件,或将文件拖到输入区。",
+ "reviewLead": "安装前,请检查插件申请的权限。",
+ "preparing": "准备中…",
"placeholder": "粘贴 GitHub 地址、链接,或选择本地 .moext 文件",
"detected": {
"auto": "自动",
@@ -2330,7 +2332,10 @@
"officialSignatureInvalid": "无法验证此插件的官方签名,请刷新插件市场后重试。",
"officialBuiltinOnly": "此版本需要内置插件专属权限,请安装支持可选安装的新版本。",
"builtinAlreadyInstalled": "此插件已内置,请使用插件的更新功能。",
- "hostIncompatible": "此插件需要 Motrix {{required}},当前版本为 {{current}}。请升级或切换到满足要求的 Motrix 版本后重试。"
+ "hostIncompatible": "此插件需要 Motrix {{required}},当前版本为 {{current}}。请升级或切换到满足要求的 Motrix 版本后重试。",
+ "installed": "已安装",
+ "optionalHint": "默认关闭,按需开启",
+ "optionalLater": "安装后,可在插件设置中更改可选权限。"
},
"consent": {
"installTitle": "安装 {{name}} {{version}}?",
@@ -2671,6 +2676,10 @@
"allowed": "已允许",
"noAccess": "关闭",
"grant": "允许"
+ },
+ "metadata": {
+ "strong": "读写任务元数据",
+ "plain": "为下载任务保存此插件生成的信息。"
}
},
"security": {
diff --git a/src/shared/locales/zh-TW.json b/src/shared/locales/zh-TW.json
index 69876eaa..98093dee 100644
--- a/src/shared/locales/zh-TW.json
+++ b/src/shared/locales/zh-TW.json
@@ -2407,6 +2407,8 @@
"local": "本機檔案",
"local.pick": "選擇 .moext 檔案",
"lead": "貼上外掛程式位址、選擇 .moext 檔案,或將檔案拖放至輸入欄位。",
+ "reviewLead": "安裝前,請檢查外掛程式要求的權限。",
+ "preparing": "準備中…",
"placeholder": "貼上 GitHub 位址、URL,或選擇本機 .moext 檔案",
"detected": {
"auto": "自動",
@@ -2430,7 +2432,10 @@
"officialSignatureInvalid": "無法驗證此外掛的官方簽章,請重新整理外掛市集後再試。",
"officialBuiltinOnly": "此版本需要內建外掛專屬權限,請安裝支援選用安裝的新版本。",
"builtinAlreadyInstalled": "此外掛已內建,請使用外掛的更新功能。",
- "hostIncompatible": "此擴充功能需要 Motrix {{required}},目前版本為 {{current}}。請升級或切換至符合要求的 Motrix 版本後重試。"
+ "hostIncompatible": "此擴充功能需要 Motrix {{required}},目前版本為 {{current}}。請升級或切換至符合要求的 Motrix 版本後重試。",
+ "installed": "已安裝",
+ "optionalHint": "預設關閉,依需要開啟",
+ "optionalLater": "安裝後,可在外掛設定中變更選用權限。"
},
"consent": {
"installTitle": "要安裝 {{name}} {{version}} 嗎?",
@@ -2771,6 +2776,10 @@
"allowed": "已允許",
"noAccess": "關閉",
"grant": "允許"
+ },
+ "metadata": {
+ "strong": "讀寫工作中繼資料",
+ "plain": "為下載工作儲存此外掛產生的資訊。"
}
},
"security": {