feat: add configurable VDO.Ninja overview and floating window focus

This commit is contained in:
2026-09-22 17:34:35 +09:00
parent 33aac68f16
commit 36806e4dc1
14 changed files with 304 additions and 16 deletions
+20
View File
@@ -0,0 +1,20 @@
import { strict as assert } from 'node:assert'
import { test } from 'node:test'
import { resolveContainerTerminal } from './containerTerminal'
const inspection = (running = true) => JSON.stringify([{
Id: 'container-id', State: { Running: running }, Mounts: [
{ Source: '/home/user/ws', Destination: '/workspace' },
{ Source: '/home/user/ws/module', Destination: '/module' }
]
}])
test('resolves module path from the most specific actual mount', () => {
assert.deepEqual(resolveContainerTerminal(inspection(), '/home/user/ws/module'), { id: 'container-id', cwd: '/module' })
assert.equal(resolveContainerTerminal(inspection(), '/home/user/ws/other').cwd, '/workspace/other')
})
test('rejects stopped containers and unrelated workspace paths', () => {
assert.throws(() => resolveContainerTerminal(inspection(false), '/home/user/ws/module'), /not running/)
assert.throws(() => resolveContainerTerminal(inspection(), '/home/user/ws-other/module'), /not mounted/)
})