diff --git a/scripts/permission-next-send-render-regression.tsx b/scripts/permission-next-send-render-regression.tsx index 92490e1..866848c 100644 --- a/scripts/permission-next-send-render-regression.tsx +++ b/scripts/permission-next-send-render-regression.tsx @@ -6,9 +6,10 @@ for (const mode of ['default-sandbox', 'full-access'] as const) { const render = (nextSend: boolean, disabled = false) => renderToStaticMarkup( { throw new Error('render must not mutate policy') }} onError={() => {}} />) const busy = render(true) - assert.ok(busy.includes('下次发送生效'), 'busy selector must identify future policy, not claim current policy changed') + assert.ok(!busy.includes('下次发送生效'), 'busy selector must not add a timing hint') + assert.equal(busy, render(false), 'busy and idle permission selectors must have identical labels and markup') assert.ok(!busy.includes('disabled=""'), 'a running/sending turn must not disable preference selection') assert.ok(!render(false).includes('下次发送生效')) assert.ok(render(true, true).includes('disabled=""'), 'plan/ask and load guards remain enforceable') } -console.log('Next-send permission labels and enabled/disabled static rendering passed') +console.log('Permission labels stay concise across busy/idle states; enabled/disabled static rendering passed') diff --git a/src/renderer/src/workbuddy/composer/permission/SourcePermissionControl.tsx b/src/renderer/src/workbuddy/composer/permission/SourcePermissionControl.tsx index e5774b4..c1b79f8 100644 --- a/src/renderer/src/workbuddy/composer/permission/SourcePermissionControl.tsx +++ b/src/renderer/src/workbuddy/composer/permission/SourcePermissionControl.tsx @@ -31,7 +31,7 @@ interface Props { * The source panel has one full-access switch, not a two-option permission list. * Its checkbox acknowledges risk; it does not change the global confirmation preference. */ -export default function SourcePermissionControl({ mode, nextSend, disabled, disabledReason, labels, confirmFullAccessOnChange = true, onChange, onError }: Props): React.JSX.Element { +export default function SourcePermissionControl({ mode, disabled, disabledReason, labels, confirmFullAccessOnChange = true, onChange, onError }: Props): React.JSX.Element { const [open, setOpen] = useState(false) const [confirming, setConfirming] = useState(false) const [acknowledged, setAcknowledged] = useState(false) @@ -45,8 +45,7 @@ export default function SourcePermissionControl({ mode, nextSend, disabled, disa if (disabled) { setOpen(false); setConfirming(false); setAcknowledged(false) } }, [disabled]) const full = mode === 'full-access' - const modeLabel = labels?.[mode] ?? t(full ? 'chatInput.permission.fullAccess' : 'chatInput.permission.label') - const label = nextSend ? `${modeLabel} · 下次发送生效` : modeLabel + const label = labels?.[mode] ?? t(full ? 'chatInput.permission.fullAccess' : 'chatInput.permission.label') useEffect(() => { const observer = new MutationObserver(() => setTheme(document.documentElement.dataset.theme === 'dark' ? 'dark' : 'light')) observer.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] }) @@ -96,7 +95,7 @@ export default function SourcePermissionControl({ mode, nextSend, disabled, disa >
-
{nextSend &&

下次发送生效,不影响当前运行、待处理授权或已排队消息。

}{full ? t('chatInput.permission.description.fullAccess') +
{full ? t('chatInput.permission.description.fullAccess') : t('chatInput.permission.description.default').replace('安全沙箱', '默认权限')}
@@ -131,7 +130,7 @@ export default function SourcePermissionControl({ mode, nextSend, disabled, disa

{t('chatInput.permission.confirm.title')}

-
{t('chatInput.permission.confirm.desc').replace('所有任务', nextSend ? '下次发送的任务(不影响当前运行或授权)' : '之后发送的任务')}
+
{t('chatInput.permission.confirm.desc').replace('所有任务', '之后发送的任务')}
{([ ['folder', 'files'], ['terminal', 'terminal'], ['website', 'internet'] ] as const).map(([icon, key]) =>