toggling between views made possible

This commit is contained in:
2026-11-09 14:01:49 +01:00
parent cc6651c08a
commit 2887965a9e
18 changed files with 149 additions and 17 deletions
@@ -166,6 +166,21 @@ import Testing
#expect(route(KeyPress(.escape), context) == .perform(.dismissOverlay))
}
@Test func theSearchSwitchesToTheGitAndSchemaViewsAndOwnsEveryOtherKey() {
let search = KeyContext(overlay: .search, owner: .text(in: nil), schemaAvailable: true)
#expect(OverlayKind(.search(seed: "x")) == .search)
#expect(route(cmd("g"), search) == .perform(.toggleGit))
#expect(route(cmd("d"), search) == .perform(.toggleSchemaView))
#expect(route(cmd("d"), KeyContext(overlay: .search, owner: .text(in: nil))) == .pass)
#expect(route(cmd("f"), search) == .pass)
#expect(route(cmd("s"), search) == .pass)
#expect(route(cmd("g", shift: true), search) == .pass)
#expect(route(KeyPress(.character("g")), search) == .pass)
#expect(route(KeyPress(.down), search) == .pass)
#expect(route(KeyPress(.enter), search) == .pass)
#expect(route(KeyPress(.escape), search) == .perform(.dismissOverlay))
}
@Test func theWorkspaceShortcutsKeepWorkingOverTheDiff() {
let diff = KeyContext(overlay: .diff(busy: false), activePanel: .editor)
#expect(route(cmd("m"), diff) == .perform(.cycleMode))