Files
orca/src/shared/workspace-last-active.test.ts
T
Jinwoo HongandClaude 3af9c22cc9 fix(cleanup): count visits as last activity once terminals stop stamping Recent (dark) (#30397)
* fix(cleanup): count visits as last activity once terminals stop stamping Recent (dark)

With ORCA_SIDEBAR_INPUTS=main, terminal start and exit no longer write
lastActivityAt, so a workspace used only through plain shells could look idle
to workspace cleanup and old in the jump palette. Both now read the later of
the Recent stamp and the last visit. Switch off: unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(cleanup): stamp the workspace you leave; space table reads visits too (dark)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(cleanup): every reveal stamps the workspace you leave, host-aware (dark)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 15:01:08 -04:00

16 lines
701 B
TypeScript

import { describe, expect, it } from 'vitest'
import { getWorkspaceLastActiveAt, withCleanupVisitEvidence } from './workspace-last-active'
import { makeCleanupCandidate } from './workspace-last-active.test-fixture'
// Switch off (the default build): visits never change what readers call "last active".
describe('workspace last active with the switch off', () => {
it('reads the Recent stamp alone', () => {
expect(getWorkspaceLastActiveAt(5, 9)).toBe(5)
})
it('returns the cleanup candidate as main built it', () => {
const candidate = makeCleanupCandidate({ lastActivityAt: 5, reasons: ['idle-clean'] })
expect(withCleanupVisitEvidence(candidate, 9, 10)).toBe(candidate)
})
})