Fix inconsistencies found by consistency audit of 395f76e

This commit is contained in:
Ian Gulliver
2026-10-23 11:48:42 -07:00
parent 836d3019ac
commit f1d3f9be61
17 changed files with 376 additions and 362 deletions
+5 -5
View File
@@ -102,7 +102,7 @@ extension Store {
func pageTabs(_ taskId: String) -> String {
guard let shown = shownPages[taskId] else {
return "This task's page view has no tabs; open one with show_page."
return "This task's Page view has no tabs; open one with show_page."
}
return shown.pages.map { page in
var line = "tab \(pages.tab(page)): \(page.title(self))"
@@ -118,12 +118,12 @@ extension Store {
func drivenPage(_ taskId: String, _ tab: Int?) throws -> WKWebView {
guard let shown = shownPages[taskId] else {
throw ApiError(status: 0, message: "this task's page view has no tabs; open one with show_page")
throw ApiError(status: 0, message: "this task's Page view has no tabs; open one with show_page")
}
var page = shown.current
if let tab {
guard let p = shown.pages.first(where: { pages.tab($0) == tab }) else {
throw ApiError(status: 0, message: "this task's page view has no tab \(tab); drive_page tabs lists them")
throw ApiError(status: 0, message: "this task's Page view has no tab \(tab); drive_page tabs lists them")
}
page = p
}
@@ -270,7 +270,7 @@ final class Pages {
#if os(macOS)
func capture(_ view: WKWebView) async throws -> Data {
guard unsafe view.window != nil, !view.isHiddenOrHasHiddenAncestor else {
throw ApiError(status: 0, message: "the tab isn't on screen: the human has the page view closed or another tab showing")
throw ApiError(status: 0, message: "the tab isn't on screen: the human has the Page view closed or another tab showing")
}
let image = try await view.takeSnapshot(configuration: nil)
guard let tiff = image.tiffRepresentation, let png = NSBitmapImageRep(data: tiff)?.representation(using: .png, properties: [:]) else {
@@ -281,7 +281,7 @@ final class Pages {
#else
func capture(_ view: WKWebView) async throws -> Data {
guard view.window != nil, !view.isHidden else {
throw ApiError(status: 0, message: "the tab isn't on screen: the human has the page view closed or another tab showing")
throw ApiError(status: 0, message: "the tab isn't on screen: the human has the Page view closed or another tab showing")
}
let image = try await view.takeSnapshot(configuration: nil)
guard let png = image.pngData() else {
+1 -1
View File
@@ -288,7 +288,7 @@ struct FindingActions: View {
try await mark(.fixed)
} catch {
busy = false
overlays.showAlert("fix sent, but not recorded: \(errorText(error))")
overlays.showAlert("Fix sent, but not recorded: \(errorText(error))")
}
}
}