Skip to content

Remove the tooltip feature entirely#362

Merged
FuJacob merged 1 commit into
mainfrom
chore/remove-tooltips
May 28, 2026
Merged

Remove the tooltip feature entirely#362
FuJacob merged 1 commit into
mainfrom
chore/remove-tooltips

Conversation

@FuJacob

@FuJacob FuJacob commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Two prior PRs (#350, #354) tried to make SwiftUI's .help(_:) actually render on macOS 26 beta for our LSUIElement app. Neither actually shows a visible tooltip — the click-through overlay returns nil from hitTest(_:), and NSToolTipManager only displays a tooltip for the view it hit-tests under the cursor, so the toolTip property was set but never queried. Rather than ship a third attempt, rip the surface out:

  • Delete Cotabby/UI/TooltipSupport.swift.
  • Drop every .cotabbyHelp(...) and remaining .help(...) call across SettingsView, MenuBarView, CustomRulesEditor, and LanguageTagsEditor (44 sites).
  • Regenerate the xcodeproj after the file deletion.

The control labels in those screens already describe what each setting does.

Validation

  • swiftlint lint --quiet → exit 0
  • xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build → ** BUILD SUCCEEDED **
  • xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build-for-testing → ** TEST BUILD SUCCEEDED **
  • xcodegen generate regenerated the project after the source-file deletion.

Linked issues

Refs #313, #350.

Risk / rollout notes

  • Accessibility help text (VoiceOver helpText) is no longer attached to any of those controls. If we want VoiceOver to keep reading the longer descriptions on focus, that's a separate accessibility pass we should do deliberately rather than by side-effect of .help(_:).
  • If the macOS 26 SwiftUI tooltip regression is fixed in a later beta, we can add .help(_:) back in one place at a time only where it has a clear product story — not blanket-restored.

Greptile Summary

This PR strips out the tooltip feature entirely — deleting TooltipSupport.swift and removing all 44 .cotabbyHelp(...) and bare .help(...) call sites across the four UI files — after two prior attempts to work around a SwiftUI tooltip regression in macOS 26 beta both failed at the AppKit hit-test level.

  • TooltipSupport.swift deleted: removes the CotabbyTooltipModifier, TooltipOverlayView, and ClickThroughTooltipView NSView subclass.
  • All call sites cleaned up: SettingsView, MenuBarView, CustomRulesEditor, and LanguageTagsEditor are fully purged of both the custom .cotabbyHelp(...) modifier and the underlying .help(...) calls.
  • xcodeproj regenerated: all three project-file references (PBXBuildFile, PBXFileReference, Sources group) to the deleted Swift file are removed.

Confidence Score: 4/5

Safe to merge — purely a deletion of a non-functional surface with no logic changes.

Every .cotabbyHelp call site is removed and no dangling references remain, so the build stays clean. The one wrinkle is the "Use LM Studio" button: it remains disabled when LM Studio is absent, but the only text that explained the reason to the user (the conditional tooltip) is now gone, leaving a silently-greyed-out button. That is a minor discoverability gap, not a correctness bug.

Cotabby/UI/SettingsView.swift — specifically the disabled "Use LM Studio" button which lost its contextual explanation.

Important Files Changed

Filename Overview
Cotabby/UI/TooltipSupport.swift Deleted entirely — removes the cotabbyHelp ViewModifier, the AppKit overlay NSViewRepresentable, and the ClickThroughTooltipView helper class.
Cotabby/UI/SettingsView.swift Removes all 30+ .cotabbyHelp(...) and bare .help(...) calls; the disabled "Use LM Studio" button now has no UI explanation for why it is greyed out.
Cotabby/UI/MenuBarView.swift Removes all .cotabbyHelp(...) and .help(...) modifier calls; no functional or structural changes to controls or logic.
Cotabby/UI/CustomRulesEditor.swift Removes two .cotabbyHelp(...) calls from the rules header and the Clear button; no other changes.
Cotabby/UI/LanguageTagsEditor.swift Removes two .cotabbyHelp(...) calls from the Languages header and the Clear button; no other changes.
Cotabby.xcodeproj/project.pbxproj Removes three references to TooltipSupport.swift (PBXBuildFile, PBXFileReference, and Sources group entry), correctly regenerated by xcodegen.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["SwiftUI View\n(.cotabbyHelp modifier)"] -->|"PR #362 removes"| B["CotabbyTooltipModifier\n(TooltipSupport.swift — deleted)"]
    B --> C[".help(text)\nSwiftUI tooltip"]
    B --> D["TooltipOverlayView\nNSViewRepresentable"]
    D --> E["ClickThroughTooltipView\nNSView — hitTest returns nil"]
    E --> F["NSToolTipManager\n(AppKit — never queried)"]
    C --> G["NSToolTipManager\n(SwiftUI bridge — broken on macOS 26 beta)"]
    A2["SwiftUI View\n(post-PR)"] -->|"no modifier"| H["No tooltip rendered\n(no VoiceOver helpText either)"]
    style B fill:#f88,stroke:#c00
    style D fill:#f88,stroke:#c00
    style E fill:#f88,stroke:#c00
    style H fill:#ffc,stroke:#aa0
Loading

Comments Outside Diff (1)

  1. Cotabby/UI/SettingsView.swift, line 496-501 (link)

    P2 Disabled "Use LM Studio" button loses its only explanation

    The "Use LM Studio" button is silently disabled when LM Studio is not detected. The previous .cotabbyHelp(...) was the only affordance that told users why it was greyed out — it rendered the string "Install LM Studio with at least one model first. Cotabby couldn't find ~/.lmstudio/models." With the tooltip removed there is nothing in the UI to explain the disabled state to a user who hasn't installed LM Studio yet. Consider replacing the disabled button with a small secondary label, or at minimum keep a non-interactive .help(...) on this control so VoiceOver can convey the reason.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Codex Fix in Claude Code

Fix All in Codex Fix All in Claude Code

Reviews (1): Last reviewed commit: "Remove the tooltip feature entirely" | Re-trigger Greptile

Two prior PRs (#350, #354) attempted to make SwiftUI's .help(_:) actually
render on macOS 26 beta for our LSUIElement app. Both shipped, neither
actually shows a visible tooltip — the click-through overlay returns
nil from hitTest and NSToolTipManager only displays a tooltip for the
view it hit-tests under the cursor, so the toolTip property was set but
never queried. Rather than ship a third attempt, rip the whole surface
out: delete TooltipSupport.swift, drop every .cotabbyHelp(...) and
.help(...) call across SettingsView, MenuBarView, CustomRulesEditor,
and LanguageTagsEditor. The labels in those controls already describe
what they do.
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