Skip to content

feat: restore info bubble as SwiftUI popover on badge icons#239

Open
2ndalpha wants to merge 3 commits intomasterfrom
feat/restore-bubble-window
Open

feat: restore info bubble as SwiftUI popover on badge icons#239
2ndalpha wants to merge 3 commits intomasterfrom
feat/restore-bubble-window

Conversation

@2ndalpha
Copy link
Owner

@2ndalpha 2ndalpha commented Mar 1, 2026

Summary

  • Restore the error/offline info bubble that was accidentally removed in PR feat: removed bubble window #208 when InfoBubble was deleted
  • Replace the legacy MAAttachedWindow (2007 3rd-party ObjC library) with native SwiftUI .popover() modifiers on badge icons in HostsRowView
  • Clean up all dead code left behind by the incomplete PR feat: removed bubble window #208 removal

Screenshots

Error popover with "Open in Browser" button (e.g. Server Not Found)

Server Not Found popover

Error popover without URL (e.g. Download Failed)

Download Failed popover

Offline popover (No Internet Connection)

Offline popover

Changes

New file:

  • ErrorPopoverView.swift — SwiftUI view showing error title, optional description, and optional "Open in Browser" button

Modified:

  • HostsRowView.swift — Badge icons (error triangle, offline wifi.slash) are now Buttons that show a .popover() with error details on click. Added errorTitle(for:) helper to map ErrorType enum values to human-readable titles. Added accessibility labels.
  • ListController.m — Removed 6 dead methods (showEditError:, locationOfHosts:, rightCenterLocationOfHosts:, centerLocationOfHostsOnScreen:, handleHostsFileRemoval:, textShouldEndEditing:) and the NSToolbarPoofAnimator import

Deleted:

  • MAAttachedWindow.h/m — Dead 3rd-party library with zero consumers since PR feat: removed bubble window #208
  • NSToolbarPoofAnimator.h — Private API shim, only consumer was the removed handleHostsFileRemoval:

Net: +92 −1,269 lines (mostly deletions of dead code)

Test plan

  • Add a remote hosts file with a bad URL → wait for sync failure → click yellow triangle badge → verify popover shows correct error title, description, and "Open in Browser" button
  • Verify group-level error badge also shows a popover
  • Disconnect from network → click wifi.slash badge → verify "No Internet Connection" popover
  • Click "Open in Browser" button → verify URL opens in default browser
  • Click outside popover → verify it dismisses
  • Verify light/dark mode rendering
  • Clean build with no new warnings

2ndalpha added 3 commits March 1, 2026 09:30
Restore the error/offline info bubble that was accidentally removed in
PR #208 when InfoBubble was deleted. Replace the legacy MAAttachedWindow
(2007 3rd-party ObjC library) with native SwiftUI .popover() modifiers
on badge icons in HostsRowView.

- Add ErrorPopoverView showing error title, description, and optional
  "Open in Browser" button
- Make error and offline badge icons tappable with popover details
- Remove dead MAAttachedWindow and NSToolbarPoofAnimator files
- Clean up dead code in ListController.m left behind by PR #208
  (showEditError:, locationOfHosts:, handleHostsFileRemoval:, etc.)
…-window

# Conflicts:
#	Gas Mask.xcodeproj/project.pbxproj
#	Source/ListController.m
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