Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Cotabby.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
258EAFB0292290C88520E915 /* SystemSettingsWindowLocator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5976600F428C1265121D4C0C /* SystemSettingsWindowLocator.swift */; };
25D4FC8D191A50F63E6391F9 /* ModelAndPresentationValueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03766F6253FF17639230C0F6 /* ModelAndPresentationValueTests.swift */; };
26E0331E9E2F92FAE531BDEE /* ActivationIndicatorController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D84D4528EEC9EFEB8AE8E318 /* ActivationIndicatorController.swift */; };
29A11716A212C8E66202D527 /* CaretGeometrySourceCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6ECC3A26862471FAAF1F906 /* CaretGeometrySourceCacheTests.swift */; };
2C6159231472A849F15BD0AE /* ScreenFrameReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5484C8A04B9C00CF79D589EB /* ScreenFrameReader.swift */; };
2DF5A3826AAB99C279EBB8DE /* InputMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B81DD30EB657368AACE9625A /* InputMonitor.swift */; };
2EE05B312C990104BE934772 /* GhostFontSizeStabilizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BF59EE80F3A0143B79740 /* GhostFontSizeStabilizerTests.swift */; };
Expand Down Expand Up @@ -121,7 +120,6 @@
B00FDD3DEE0B73FF5136C91C /* FocusTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9FDF029F7828CAF3FE8850 /* FocusTracker.swift */; };
B0828FF0D7EE110C0B23DB94 /* TagsInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58C0F017699EE44C81C095CA /* TagsInputView.swift */; };
B0B115C6EBAC37FF6115B4BE /* SuggestionCoordinator+Lifecycle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78E280F4F39A9D86840800D2 /* SuggestionCoordinator+Lifecycle.swift */; };
B2CABC9F92368B4FCB7BF2C4 /* CaretGeometrySourceCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED63EBDD04B6E9EBF7E7D411 /* CaretGeometrySourceCache.swift */; };
B2F7589B8D32ACF97BB642AB /* HuggingFaceModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = A520809E71697E3BB9A8139C /* HuggingFaceModels.swift */; };
B93AB7E845086F6FBB068369 /* SuggestionRequestFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE94342B888A5A2CCF66BC93 /* SuggestionRequestFactoryTests.swift */; };
BB6325CA50F97B18B9725918 /* SuggestionTextNormalizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B424E2AC97C99D335B0D5751 /* SuggestionTextNormalizer.swift */; };
Expand Down Expand Up @@ -288,7 +286,6 @@
C046CB4F3CB4BFE9391DB5DE /* AXTextGeometryResolverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AXTextGeometryResolverTests.swift; sourceTree = "<group>"; };
C05B0439348261163B37C508 /* SuggestionAvailabilityEvaluatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionAvailabilityEvaluatorTests.swift; sourceTree = "<group>"; };
C1C5DE0F3FF63545000E2453 /* DisplayCoordinateConverterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayCoordinateConverterTests.swift; sourceTree = "<group>"; };
C6ECC3A26862471FAAF1F906 /* CaretGeometrySourceCacheTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaretGeometrySourceCacheTests.swift; sourceTree = "<group>"; };
C7B2D34A6F3AC9DFD61350F7 /* CotabbyDebugOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CotabbyDebugOptions.swift; sourceTree = "<group>"; };
CA942A53B7C09D1F4EC57239 /* SuggestionInteractionState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionInteractionState.swift; sourceTree = "<group>"; };
CB58035EFFD65B767949BAE6 /* AXTextGeometryResolver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AXTextGeometryResolver.swift; sourceTree = "<group>"; };
Expand All @@ -311,7 +308,6 @@
E7F42112F14026E6253BB865 /* PermissionAndContextModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionAndContextModelTests.swift; sourceTree = "<group>"; };
EAAE6B395FAB604DF059280A /* KeyCodeLabels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyCodeLabels.swift; sourceTree = "<group>"; };
EBEDE359CFD99EF906FA50BC /* IndicatorIconImageProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndicatorIconImageProcessor.swift; sourceTree = "<group>"; };
ED63EBDD04B6E9EBF7E7D411 /* CaretGeometrySourceCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaretGeometrySourceCache.swift; sourceTree = "<group>"; };
ED8672B87CEC72BE3978C6BB /* CotabbyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CotabbyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EE94342B888A5A2CCF66BC93 /* SuggestionRequestFactoryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionRequestFactoryTests.swift; sourceTree = "<group>"; };
EFD89799BB82AF7A92559AEB /* ClipboardContentDistillerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClipboardContentDistillerTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -435,7 +431,6 @@
isa = PBXGroup;
children = (
CB58035EFFD65B767949BAE6 /* AXTextGeometryResolver.swift */,
ED63EBDD04B6E9EBF7E7D411 /* CaretGeometrySourceCache.swift */,
04E25414C307A20B6F9F20EC /* FocusSnapshotResolver.swift */,
5C9FDF029F7828CAF3FE8850 /* FocusTracker.swift */,
);
Expand Down Expand Up @@ -493,7 +488,6 @@
A168A7B6A7AD11559B60C56B /* ApplicationBundleMetadataTests.swift */,
C046CB4F3CB4BFE9391DB5DE /* AXTextGeometryResolverTests.swift */,
18D990E515E1AE4F312F4E95 /* BundledRuntimeLocatorTests.swift */,
C6ECC3A26862471FAAF1F906 /* CaretGeometrySourceCacheTests.swift */,
EFD89799BB82AF7A92559AEB /* ClipboardContentDistillerTests.swift */,
90B0D133AB77A2503FB08827 /* ClipboardRelevanceFilterTests.swift */,
AF1E065C7FFB697FCEB2FA5C /* CotabbyTestFixtures.swift */,
Expand Down Expand Up @@ -747,7 +741,6 @@
C4C6734678797669055988E0 /* AppUpdateManager.swift in Sources */,
66C23A7C2FCDE0266FF425F8 /* ApplicationBundleMetadata.swift in Sources */,
3CBBC3BFAC0DC8952EE24EF7 /* BundledRuntimeLocator.swift in Sources */,
B2CABC9F92368B4FCB7BF2C4 /* CaretGeometrySourceCache.swift in Sources */,
6E01052209B73D7361C12CEF /* ClipboardContentDistiller.swift in Sources */,
D2CAA59F69BCBC07DDA2B0D8 /* ClipboardContextProvider.swift in Sources */,
157A55EB796BEB7819B90D5D /* ClipboardRelevanceFilter.swift in Sources */,
Expand Down Expand Up @@ -862,7 +855,6 @@
6D0E79CF3C1A8CE53046FCE5 /* AXTextGeometryResolverTests.swift in Sources */,
A36481222BB5B2A67349D389 /* ApplicationBundleMetadataTests.swift in Sources */,
58AC3193D846FDE88513377D /* BundledRuntimeLocatorTests.swift in Sources */,
29A11716A212C8E66202D527 /* CaretGeometrySourceCacheTests.swift in Sources */,
8865B95FE84198D70390DF80 /* ClipboardContentDistillerTests.swift in Sources */,
BFCA7FAFDAEBF586AB615567 /* ClipboardRelevanceFilterTests.swift in Sources */,
5E10EFC426217CB7218A5847 /* CotabbyTestFixtures.swift in Sources */,
Expand Down
41 changes: 1 addition & 40 deletions Cotabby/App/Coordinators/SuggestionCoordinator+Input.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import CoreGraphics
import Foundation
import Logging

Expand All @@ -25,7 +24,7 @@ extension SuggestionCoordinator {

func handleFocusSnapshotChange(_ snapshot: FocusSnapshot) {
CotabbyLogger.suggestion.trace(
"Focus snapshot changed: app=\(snapshot.applicationName) capability=\(snapshot.capability.shortLabel) \(focusDiagnostics(for: snapshot))"
"Focus snapshot changed: app=\(snapshot.applicationName) capability=\(snapshot.capability.shortLabel)"
)
// Start capturing visual context for a newly focused input even when predictions are
// temporarily disabled by transient field states (e.g., "text is selected" or "secure
Expand Down Expand Up @@ -194,41 +193,3 @@ extension SuggestionCoordinator {
}
}
}

private extension SuggestionCoordinator {
/// Website editors often expose unstable AX trees, so this log keeps the next repro actionable
/// without writing the user's message text into the debug file.
func focusDiagnostics(for snapshot: FocusSnapshot) -> String {
let inspection = snapshot.inspection
guard let context = snapshot.context else {
return "reason=\"\(snapshot.capability.summary)\" "
+ "focusedRole=\(inspection?.focusedRoleSummary ?? "n/a") "
+ "resolvedRole=\(inspection?.resolvedRoleSummary ?? "n/a") "
+ "missing=\(inspection?.missingCapabilitySummary ?? "n/a")"
}

let textLength = context.precedingText.count + context.trailingText.count
return "role=\(context.role)/\(context.subrole ?? "n/a") "
+ "selection=\(context.selection.location)+\(context.selection.length) "
+ "textLength=\(textLength) before=\(context.precedingText.count) after=\(context.trailingText.count) "
+ "secure=\(context.isSecure) sequence=\(context.focusChangeSequence) "
+ "caret=\(context.caretQuality.label):\(context.caretSource) "
+ "caretRect=\(formatRect(context.caretRect)) inputRect=\(formatOptionalRect(context.inputFrameRect)) "
+ "resolvedRole=\(inspection?.resolvedRoleSummary ?? "n/a") "
+ "missing=\(inspection?.missingCapabilitySummary ?? "n/a")"
}

func formatOptionalRect(_ rect: CGRect?) -> String {
rect.map(formatRect) ?? "nil"
}

func formatRect(_ rect: CGRect) -> String {
String(
format: "(x=%.0f,y=%.0f,w=%.0f,h=%.0f)",
rect.origin.x,
rect.origin.y,
rect.width,
rect.height
)
}
}
Loading
Loading