- {summary.turnOnable > 0 ? (
-
- ) : null}
+ {/* Nothing left to switch on means nothing to offer: each row already speaks for itself. */}
+ {enableableServers.length === 0 ? null : (
+
+
)}
)
}))}
diff --git a/src/renderer/src/components/settings/session-search-computer-rollup.test.ts b/src/renderer/src/components/settings/session-search-computer-rollup.test.ts
index 66f94a1a33b..454be5e31bd 100644
--- a/src/renderer/src/components/settings/session-search-computer-rollup.test.ts
+++ b/src/renderer/src/components/settings/session-search-computer-rollup.test.ts
@@ -1,17 +1,10 @@
-import { expect, it, vi } from 'vitest'
+import { expect, it } from 'vitest'
import {
isTurnOnableSessionSearchState,
orderSessionSearchServers,
- sessionSearchSummarySentence,
- summarizeSessionSearchComputers,
type SessionSearchComputerEntry
} from './session-search-computer-rollup'
-vi.mock('@/i18n/i18n', () => ({
- translate: (_key: string, fallback: string, args?: Record) =>
- fallback.replace(/{{(\w+)}}/g, (_, key: string) => String(args?.[key]))
-}))
-
const fleet: SessionSearchComputerEntry[] = [
{ id: 'local', name: 'Local Mac', state: 'on' },
{ id: 'a', name: 'build-01', state: 'on' },
@@ -22,37 +15,12 @@ const fleet: SessionSearchComputerEntry[] = [
{ id: 'f', name: 'probing', state: 'checking' }
]
-it('counts what the user can see and what they could act on', () => {
- expect(summarizeSessionSearchComputers(fleet)).toEqual({
- on: 2,
- total: 7,
- offline: 2,
- needUpdate: 1,
- turnOnable: 1
- })
-})
-
it('will not offer to turn on a computer it cannot reach or that is too old', () => {
expect(isTurnOnableSessionSearchState('off')).toBe(true)
for (const state of ['on', 'offline', 'needs-update', 'checking'] as const) {
expect(isTurnOnableSessionSearchState(state)).toBe(false)
}
-})
-
-it('leaves a zero segment out of the sentence rather than printing it', () => {
- expect(sessionSearchSummarySentence(summarizeSessionSearchComputers(fleet), false)).toBe(
- 'On 2 of 7 computers · 2 offline · 1 need an update'
- )
- const onlyLocal = summarizeSessionSearchComputers([fleet[0]])
- expect(sessionSearchSummarySentence(onlyLocal, false)).toBe('On 1 of 1 computers')
-})
-
-it('promises to keep new computers turned on only when that is the standing consent', () => {
- const summary = summarizeSessionSearchComputers([fleet[0]])
- expect(sessionSearchSummarySentence(summary, true)).toBe(
- 'On 1 of 1 computers New computers turn on when they can.'
- )
- expect(sessionSearchSummarySentence(summary, false)).not.toContain('New computers')
+ expect(fleet.filter((entry) => isTurnOnableSessionSearchState(entry.state))).toHaveLength(1)
})
it('orders reachable and working first, then by name inside each group', () => {
diff --git a/src/renderer/src/components/settings/session-search-computer-rollup.ts b/src/renderer/src/components/settings/session-search-computer-rollup.ts
index 9a9c693e3f9..2d830f8584b 100644
--- a/src/renderer/src/components/settings/session-search-computer-rollup.ts
+++ b/src/renderer/src/components/settings/session-search-computer-rollup.ts
@@ -1,5 +1,3 @@
-import { translate } from '@/i18n/i18n'
-
/**
* What one computer in the pane is doing, as far as this client can tell.
*
@@ -14,64 +12,10 @@ export type SessionSearchComputerEntry = {
state: SessionSearchComputerState
}
-export type SessionSearchFleetSummary = {
- on: number
- total: number
- offline: number
- needUpdate: number
- /** Reachable, new enough, and still off: exactly what Turn on all would act on. */
- turnOnable: number
-}
-
export function isTurnOnableSessionSearchState(state: SessionSearchComputerState): boolean {
return state === 'off'
}
-export function summarizeSessionSearchComputers(
- entries: readonly SessionSearchComputerEntry[]
-): SessionSearchFleetSummary {
- const count = (state: SessionSearchComputerState): number =>
- entries.filter((entry) => entry.state === state).length
- return {
- on: count('on'),
- total: entries.length,
- offline: count('offline'),
- needUpdate: count('needs-update'),
- turnOnable: entries.filter((entry) => isTurnOnableSessionSearchState(entry.state)).length
- }
-}
-
-/** Sentence above the list. A segment worth zero is left out rather than printed as "0". */
-export function sessionSearchSummarySentence(
- summary: SessionSearchFleetSummary,
- autoEnableNewComputers: boolean
-): string {
- const segments = [
- translate('sessionHistory.settings.summaryOn', 'On {{on}} of {{total}} computers', {
- on: summary.on,
- total: summary.total
- })
- ]
- if (summary.offline > 0) {
- segments.push(
- translate('sessionHistory.settings.summaryOffline', '{{offline}} offline', {
- offline: summary.offline
- })
- )
- }
- if (summary.needUpdate > 0) {
- segments.push(
- translate('sessionHistory.settings.summaryNeedUpdate', '{{needUpdate}} need an update', {
- needUpdate: summary.needUpdate
- })
- )
- }
- const sentence = segments.join(' · ')
- return autoEnableNewComputers
- ? `${sentence} ${translate('sessionHistory.settings.summaryAutoEnable', 'New computers turn on when they can.')}`
- : sentence
-}
-
// Reachable and working first, then what the user could act on, then what they cannot.
const STATE_RANK: Record = {
on: 0,
diff --git a/src/renderer/src/components/settings/use-session-search-auto-enable.ts b/src/renderer/src/components/settings/use-session-search-auto-enable.ts
deleted file mode 100644
index 4efdde61db5..00000000000
Binary files a/src/renderer/src/components/settings/use-session-search-auto-enable.ts and /dev/null differ
diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json
index b115ca1a2d5..5968c086497 100644
--- a/src/renderer/src/i18n/locales/en.json
+++ b/src/renderer/src/i18n/locales/en.json
@@ -17979,16 +17979,12 @@
"clearedAndTurnedOff": "Search turned off and search data cleared.",
"thisComputer": "This computer",
"remoteServers": "Orca remote servers",
- "summaryOn": "On {{on}} of {{total}} computers",
- "summaryOffline": "{{offline}} offline",
- "summaryNeedUpdate": "{{needUpdate}} need an update",
- "summaryAutoEnable": "New computers turn on when they can.",
- "turnOnAll": "Turn on all",
"showMore": "Show {{count}} more",
"showFewer": "Show fewer",
"openInSidebar": "Open in the sidebar",
"openInSidebarCopy": "Type what you remember, or ask an agent: “find the session where we fixed the login timeout.”",
- "open": "Open"
+ "open": "Open",
+ "enableOnAll": "Enable on all computers"
}
},
"aiVault": {
diff --git a/src/shared/global-settings-types.ts b/src/shared/global-settings-types.ts
index 5d921c9d395..6369033c892 100644
--- a/src/shared/global-settings-types.ts
+++ b/src/shared/global-settings-types.ts
@@ -491,13 +491,6 @@ export type GlobalSettings = {
voice?: VoiceSettings
/** Transcript full-text search consent + retention. Absent means off; nothing indexes until the user opts in. */
aiVaultSearch?: AiVaultSearchSettings
- /**
- * Standing consent from "Turn on all": a paired server that becomes reachable
- * and new enough gets session search turned on without another dialog. Kept
- * out of `aiVaultSearch` because it changes no indexer configuration, so it
- * must never close and reconstruct one. Cleared when a server is turned off by hand.
- */
- aiVaultSearchAutoEnableNewComputers?: boolean
}
export type OrcaWorkspaceLayout = {