Skip to content

Remove the dead summarizing-text visual-context state#509

Merged
FuJacob merged 1 commit into
mainfrom
chore/remove-dead-summarize-stage
Jun 1, 2026
Merged

Remove the dead summarizing-text visual-context state#509
FuJacob merged 1 commit into
mainfrom
chore/remove-dead-summarize-stage

Conversation

@FuJacob
Copy link
Copy Markdown
Owner

@FuJacob FuJacob commented Jun 1, 2026

Summary

The visual-context summarizer was deleted in #499, so VisualContextStatus.summarizingText and the matching "Summarize" debug stage are now unreachable — nothing ever produces them. This removes the status case, the debug stage, and their switch arms so the visual-context state machine and the focus debug overlay only model the stages that can actually occur (capture → OCR → inject).

Validation

rm -rf build/DerivedData
xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' \
  build-for-testing -derivedDataPath build/DerivedData
# ** TEST BUILD SUCCEEDED **  (clean build, so the removed enum case can't hide behind stale objects)

swiftlint lint --quiet
# 0 violations
  • rg 'summarizingText' and rg '\.summarize' across the app and tests return no remaining references.
  • VisualContextModelTests.test_status_detail_returnsNonEmptyStringForEachCase updated to drop the removed case from its enumeration; it still asserts every remaining status has a unique, non-empty detail.

Linked issues

Refs #499.

Risk / rollout notes

  • Pure dead-code removal of an unreachable state; no behavior change. The only surfaces touched are the visual-context status enum and the developer-only focus debug overlay, which now shows three stages (Capture, OCR, Inject) instead of a never-active Summarize pill.

Greptile Summary

This PR removes the VisualContextStatus.summarizingText enum case and the matching VisualContextDebugStage.summarize case from the developer-only focus debug overlay, following the deletion of the visual-context summarizer service in #499.

  • VisualContextStatus is trimmed from 7 to 6 cases; all switch statements across both changed files remain exhaustive.
  • VisualContextDebugStage shrinks from 4 to 3 pills (Capture → OCR → Inject) in the debug overlay, and stageState(for:) correctly reflects the simplified pipeline.
  • The test in PermissionAndContextModelTests is updated to drop the removed case from its enumeration, and still asserts every remaining status has a unique, non-empty detail string.

Confidence Score: 5/5

Pure dead-code removal with no behaviour change; safe to merge.

Every switch that touched summarizingText is now exhaustive over the six remaining cases, and the compiler would have rejected the build otherwise. The test update correctly mirrors the enum change and the uniqueness assertion still exercises every live case. No production logic was altered — only an unreachable state and its developer-debug rendering were deleted.

No files require special attention. The stale summarizer-related doc comments in VisualContextModels.swift (lines 61–62) are pre-existing and out of scope for this PR.

Important Files Changed

Filename Overview
Cotabby/Models/VisualContextModels.swift Removes summarizingText enum case and its detail switch arm; remaining switch is exhaustive. Stale doc comments referencing the summarizer exist but are outside this PR's scope and maxSummaryCharacters is still actively used by ScreenshotContextGenerator.
Cotabby/Services/UI/FocusDebugOverlayController.swift Removes summarizingText arms from all four switch statements and drops VisualContextDebugStage.summarize; all switches remain exhaustive and the stage pill set correctly reflects the three-step capture→OCR→inject pipeline.
CotabbyTests/PermissionAndContextModelTests.swift Drops .summarizingText from the manual case list in test_status_detail_returnsNonEmptyStringForEachCase; all remaining cases are still covered and the uniqueness assertion still holds.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([idle]) --> B([capturing])
    B --> C([extractingText])
    C --> D([ready])
    B --> E([unavailable / failed])
    C --> E

    style A fill:#555,color:#fff
    style B fill:#b8860b,color:#fff
    style C fill:#b8860b,color:#fff
    style D fill:#2d6a2d,color:#fff
    style E fill:#8b0000,color:#fff
Loading

Reviews (1): Last reviewed commit: "Remove the dead summarizing-text visual-..." | Re-trigger Greptile

The visual-context summarizer was deleted in #499, so the
VisualContextStatus.summarizingText state and the matching Summarize debug
stage are now unreachable: nothing ever produces them. Remove the status
case, the debug stage, and their switch arms so the visual-context state
machine and the focus debug overlay only model stages that can actually
occur (capture -> OCR -> inject).
@FuJacob FuJacob merged commit f209df6 into main Jun 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant