mirror of
https://github.com/stablyai/orca.git
synced 2026-09-26 00:02:34 +00:00
* Persist agents sidebar search field visibility as pairing-local preferen - Add `agentsShowSearch` to workspace UI state with default on - Include in pairing-local fields so preference syncs across clients - Convert search from menu action to checkbox menu item for explicit toggle - Update activity thread options menu to reflect checkbox state - Add localization strings across all supported languages - Update RPC schemas and preference persistence layer - Includes readiness validation reports confirming feature is clean * rm review * fix documentation
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { omitPairingLocalUiFields, PAIRING_LOCAL_UI_FIELDS } from './pairing-local-ui-fields'
|
|
|
|
describe('pairing-local UI fields', () => {
|
|
// Why a census: the seams that honor this set are spread across the host RPC and the web
|
|
// preload, so a field added here without wiring every seam would otherwise ship silently.
|
|
it('census: the set is exactly the fields no pairing may exchange', () => {
|
|
expect([...PAIRING_LOCAL_UI_FIELDS]).toEqual([
|
|
'automationHostFilter',
|
|
'hideWorkspacesFromOtherDevices',
|
|
'manualRepoOrder',
|
|
'workspaceHostOrder',
|
|
'agentsVisibleHostIds',
|
|
'agentsFilterRepoIds',
|
|
'agentsShowChildAgents',
|
|
'agentsCompactMode',
|
|
'agentsShowSearch',
|
|
'agentsReadFilter',
|
|
'agentsGroupBy',
|
|
'activityClearedAtByPaneKey',
|
|
'manuallyUnreadTurnsByPaneKey'
|
|
])
|
|
})
|
|
|
|
it('omits every member and keeps everything else', () => {
|
|
const state = {
|
|
hideWorkspacesFromOtherDevices: true,
|
|
manualRepoOrder: [{ hostId: 'local' as const, repoId: 'repo-a' }],
|
|
workspaceHostOrder: ['local' as const],
|
|
sidebarWidth: 280,
|
|
activeView: 'tasks' as const
|
|
}
|
|
|
|
expect(omitPairingLocalUiFields(state)).toEqual({ sidebarWidth: 280, activeView: 'tasks' })
|
|
})
|
|
|
|
it('leaves a payload that carries no member untouched', () => {
|
|
const state = { sidebarWidth: 280 }
|
|
|
|
expect(omitPairingLocalUiFields(state)).toEqual(state)
|
|
})
|
|
|
|
// A member explicitly set to undefined must still be removed, not forwarded as a present key
|
|
// that a receiver would read as "cleared".
|
|
it('drops a member present with an undefined value', () => {
|
|
expect(
|
|
Object.keys(omitPairingLocalUiFields({ manualRepoOrder: undefined, sidebarWidth: 280 }))
|
|
).toEqual(['sidebarWidth'])
|
|
})
|
|
})
|