diff --git a/fallow-baselines/health.json b/fallow-baselines/health.json index 102a23fc54..a50d63a9fb 100644 --- a/fallow-baselines/health.json +++ b/fallow-baselines/health.json @@ -499,7 +499,7 @@ "count": 1 } }, - "src/utils/text-surface.ts": { + "src/snapshot/snapshot-presentation/text-surface.ts": { "crap_high": { "count": 1 } @@ -588,7 +588,7 @@ "src/utils/screenshot-result.ts:high impact", "packages/platform-web/src/json-utils.ts:high impact", "packages/platform-android/src/settings.ts:complexity", - "src/utils/text-surface.ts:high impact", + "src/snapshot/snapshot-presentation/text-surface.ts:high impact", "src/daemon/handlers/session-test-sharding.ts:high impact", "src/daemon/handlers/session-replay-runtime.ts:complexity", "packages/platform-apple/src/core/debug-symbols/utils.ts:high impact", diff --git a/src/commands/interaction/runtime/selector-read-shared.ts b/src/commands/interaction/runtime/selector-read-shared.ts index d50cfa68b5..324286dc57 100644 --- a/src/commands/interaction/runtime/selector-read-shared.ts +++ b/src/commands/interaction/runtime/selector-read-shared.ts @@ -11,7 +11,7 @@ import type { } from '@agent-device/kernel/snapshot'; import { findNodeByRef, normalizeRef } from '@agent-device/kernel/snapshot'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; -import { extractReadableText } from '../../../utils/text-surface.ts'; +import { extractReadableText } from '../../../snapshot/snapshot-presentation/text-surface.ts'; import { now, toBackendContext } from '../../runtime-common.ts'; import { findNodeByLabel } from './selector-read-utils.ts'; import type { SelectorSnapshotInput } from '../../command-input.ts'; diff --git a/src/daemon/handlers/interaction-read.ts b/src/daemon/handlers/interaction-read.ts index eda77362cb..f2c732ba37 100644 --- a/src/daemon/handlers/interaction-read.ts +++ b/src/daemon/handlers/interaction-read.ts @@ -8,7 +8,10 @@ import { runtimeExecutionFromContext } from '../snapshot-runtime-capture-input.t import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import type { SessionState } from '../types.ts'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; -import { extractReadableText, prefersValueForReadableText } from '../../utils/text-surface.ts'; +import { + extractReadableText, + prefersValueForReadableText, +} from '../../snapshot/snapshot-presentation/text-surface.ts'; import type { ContextFromFlags } from './interaction-common.ts'; import { resolveRectCenter } from './interaction-targeting.ts'; diff --git a/src/snapshot/snapshot-lines.ts b/src/snapshot/snapshot-lines.ts index 2d2b2d39e9..b422cf4b39 100644 --- a/src/snapshot/snapshot-lines.ts +++ b/src/snapshot/snapshot-lines.ts @@ -1,6 +1,10 @@ import { isSystemScrollIndicatorLabel } from '@agent-device/kernel/scroll-indicator'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; -import { buildTextPreview, describeTextSurface, trimText } from '../utils/text-surface.ts'; +import { + buildTextPreview, + describeTextSurface, + trimText, +} from './snapshot-presentation/text-surface.ts'; type SnapshotDisplayLine = { node: SnapshotNode; diff --git a/src/utils/__tests__/text-surface.test.ts b/src/snapshot/snapshot-presentation/text-surface.test.ts similarity index 88% rename from src/utils/__tests__/text-surface.test.ts rename to src/snapshot/snapshot-presentation/text-surface.test.ts index e445222274..dcc15196fb 100644 --- a/src/utils/__tests__/text-surface.test.ts +++ b/src/snapshot/snapshot-presentation/text-surface.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { extractReadableText } from '../text-surface.ts'; +import { extractReadableText } from './text-surface.ts'; test('extractReadableText ignores generic implementation identifiers as fallback text', () => { assert.equal( diff --git a/src/utils/text-surface.ts b/src/snapshot/snapshot-presentation/text-surface.ts similarity index 100% rename from src/utils/text-surface.ts rename to src/snapshot/snapshot-presentation/text-surface.ts