mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
feat(settings): confirm before stopping running terminals (#21569)
* feat(settings): confirm before stopping running terminals * fix(settings): localize close confirmation search keywords * ci: rerun PR checks after localization fix * fix(settings): add search keyword translations
This commit is contained in:
@@ -109,6 +109,12 @@ describe('GeneralPane search entries', () => {
|
||||
expect(matchesSettingsSearch('red underline', entries)).toBe(true)
|
||||
})
|
||||
|
||||
it('makes the running-terminal confirmation setting searchable', () => {
|
||||
const entries = getGeneralPaneSearchEntries()
|
||||
|
||||
expect(matchesSettingsSearch('running', entries)).toBe(true)
|
||||
})
|
||||
|
||||
it('omits the default project runtime setting when Windows runtimes are unsupported', () => {
|
||||
const entries = getGeneralPaneSearchEntries({ includeProjectRuntime: false })
|
||||
|
||||
|
||||
@@ -158,6 +158,35 @@ export function GeneralPane({
|
||||
}
|
||||
/>
|
||||
</SearchableSetting>
|
||||
<SearchableSetting
|
||||
title={translate(
|
||||
'auto.components.settings.GeneralPane.confirm_running_terminal_close',
|
||||
'Confirm before closing running terminals'
|
||||
)}
|
||||
description={translate(
|
||||
'auto.components.settings.GeneralPane.confirm_running_terminal_close_description',
|
||||
'Ask before stopping a running agent or command when closing a terminal.'
|
||||
)}
|
||||
keywords={['terminal', 'agent', 'command', 'confirm', 'close', 'OMP']}
|
||||
>
|
||||
<SettingsSwitchRow
|
||||
label={translate(
|
||||
'auto.components.settings.GeneralPane.confirm_running_terminal_close',
|
||||
'Confirm before closing running terminals'
|
||||
)}
|
||||
description={translate(
|
||||
'auto.components.settings.GeneralPane.confirm_running_terminal_close_description',
|
||||
'Ask before stopping a running agent or command when closing a terminal.'
|
||||
)}
|
||||
checked={!settings.skipCloseTerminalWithRunningProcessConfirm}
|
||||
onChange={() =>
|
||||
updateSettings({
|
||||
skipCloseTerminalWithRunningProcessConfirm:
|
||||
!settings.skipCloseTerminalWithRunningProcessConfirm
|
||||
})
|
||||
}
|
||||
/>
|
||||
</SearchableSetting>
|
||||
</section>
|
||||
) : null,
|
||||
matchesSettingsSearch(searchQuery, getGeneralWorkspaceSearchEntries()) ? (
|
||||
|
||||
@@ -151,6 +151,28 @@ export const getGeneralNavigationSearchEntries = createLocalizedCatalog(() => [
|
||||
...translateSearchKeyword('auto.components.settings.general.search.9f8558233a', 'confirm'),
|
||||
...translateSearchKeyword('auto.components.settings.general.search.afa37a34e1', 'close')
|
||||
]
|
||||
},
|
||||
{
|
||||
title: translate(
|
||||
'auto.components.settings.GeneralPane.confirm_running_terminal_close',
|
||||
'Confirm before closing running terminals'
|
||||
),
|
||||
description: translate(
|
||||
'auto.components.settings.GeneralPane.confirm_running_terminal_close_description',
|
||||
'Ask before stopping a running agent or command when closing a terminal.'
|
||||
),
|
||||
keywords: [
|
||||
...translateSearchKeyword(
|
||||
'auto.components.settings.general.search.running_terminal',
|
||||
'running'
|
||||
),
|
||||
...translateSearchKeyword('auto.components.settings.general.search.terminal', 'terminal'),
|
||||
...translateSearchKeyword('auto.components.settings.general.search.agent', 'agent'),
|
||||
...translateSearchKeyword('auto.components.settings.general.search.command', 'command'),
|
||||
...translateSearchKeyword('auto.components.settings.general.search.confirm', 'confirm'),
|
||||
...translateSearchKeyword('auto.components.settings.general.search.close', 'close'),
|
||||
...translateSearchKeyword('auto.components.settings.general.search.omp', 'OMP')
|
||||
]
|
||||
}
|
||||
])
|
||||
|
||||
|
||||
@@ -128,6 +128,14 @@ function CloseTerminalDialogBody({
|
||||
)}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
{isAgent ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{translate(
|
||||
'auto.components.terminal.pane.CloseTerminalDialog.automatic_resume_warning',
|
||||
'This terminal will not resume automatically. Cancel and put the workspace to sleep to resume it later.'
|
||||
)}
|
||||
</p>
|
||||
) : null}
|
||||
{trimmedTabLabel ? (
|
||||
<p className="truncate text-xs font-medium text-foreground" title={trimmedTabLabel}>
|
||||
{trimmedTabLabel}
|
||||
|
||||
@@ -109,6 +109,9 @@ describe('RunningTerminalCloseDialog', () => {
|
||||
await renderDialog({ onConfirm: vi.fn(), copyKind: 'agent' }, updateSettings)
|
||||
|
||||
expect(document.body.textContent).toContain('Stop this agent?')
|
||||
expect(document.body.textContent).toContain(
|
||||
'This terminal will not resume automatically. Cancel and put the workspace to sleep to resume it later.'
|
||||
)
|
||||
expect(getButton('Stop Agent')).toBeTruthy()
|
||||
})
|
||||
|
||||
|
||||
@@ -3145,6 +3145,7 @@
|
||||
},
|
||||
"pane": {
|
||||
"CloseTerminalDialog": {
|
||||
"automatic_resume_warning": "This terminal will not resume automatically. Cancel and put the workspace to sleep to resume it later.",
|
||||
"ebd2fa844d": "Close",
|
||||
"1d1a7a9c1f": "Cancel",
|
||||
"6b9a6975f8": "The terminal still has a running process. If you close the terminal, the process will be killed.",
|
||||
@@ -7217,6 +7218,8 @@
|
||||
"configureProxy": "Configure proxy"
|
||||
},
|
||||
"GeneralPane": {
|
||||
"confirm_running_terminal_close": "Confirm before closing running terminals",
|
||||
"confirm_running_terminal_close_description": "Ask before stopping a running agent or command when closing a terminal.",
|
||||
"d58fccfd84": "Navigation",
|
||||
"5cb5475664": "Confirm before closing pinned tabs",
|
||||
"36b2a5dc6d": "Show a confirmation dialog before a pinned tab is closed.",
|
||||
@@ -9757,7 +9760,14 @@
|
||||
"sidebar": "sidebar",
|
||||
"867dddea41": "pinned",
|
||||
"5250cf0e48": "pin",
|
||||
"afa37a34e1": "close"
|
||||
"afa37a34e1": "close",
|
||||
"running_terminal": "running",
|
||||
"terminal": "terminal",
|
||||
"agent": "agent",
|
||||
"command": "command",
|
||||
"confirm": "confirm",
|
||||
"close": "close",
|
||||
"omp": "OMP"
|
||||
}
|
||||
},
|
||||
"git": {
|
||||
|
||||
Reference in New Issue
Block a user