Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

refactor(notification-macos): reorganize Swift file structure for maintainability

Summary

Refactors the Swift notification code in crates/notification-macos/swift-lib/src/ by splitting the monolithic NotificationManager+Helpers.swift (675 lines) into focused, single-responsibility extension files:

New File Lines Purpose
NotificationManager+Layout.swift 85 Positioning & screen calculations
NotificationManager+Creation.swift 138 UI component factories
NotificationManager+CompactView.swift 75 Compact notification view
NotificationManager+ExpandedView.swift 163 Expanded notification view
NotificationManager+Animation.swift 111 Animations & transitions
NotificationManager+MouseTracking.swift 40 Mouse hover tracking
NotificationManager+Lifecycle.swift 62 High-level orchestration

Also extracted button classes (CloseButton, ActionButton, DetailsButton) from NotificationViews.swift into NotificationButtons.swift.

This is a pure refactoring with no functional changes - the diff shows 873 insertions and 872 deletions (essentially 1:1 code movement).

Review & Testing Checklist for Human

  • Test on macOS: This code cannot be properly tested on Linux. Verify notifications display correctly, animate in/out, and respond to user interactions
  • Verify button interactions: Test close button, action button, and details button all trigger correct callbacks to Rust
  • Test display change handling: Connect/disconnect external display and verify notifications reposition correctly (uses non-animated repositioning)
  • Verify expanded view: Click "Details" button and confirm expanded notification view renders and collapses properly

Recommended test plan: Build and run the desktop app on macOS, trigger a notification, and verify:

  1. Notification slides in with animation
  2. Hover shows close button
  3. Clicking notification dismisses it
  4. Details button expands/collapses the view
  5. Multiple notifications stack correctly

Notes

  • The repositionNotifications method was consolidated from two similar methods into one with an animated: Bool parameter - this is the only minor logic change
  • Pre-existing hardcoded placeholder data in expanded view (participant names, meeting details) was preserved as-is
  • Requested by: yujonglee (@yujonglee)
  • Session: https://app.devin.ai/sessions/e21594eca3804779bfacb8afcd5f6f46

…ter maintainability

Split the monolithic NotificationManager+Helpers.swift (675 lines) into focused, single-responsibility files:

- NotificationManager+Layout.swift: positioning and screen calculations
- NotificationManager+Creation.swift: UI component factories
- NotificationManager+CompactView.swift: compact notification UI
- NotificationManager+ExpandedView.swift: expanded notification UI
- NotificationManager+Animation.swift: animations and transitions
- NotificationManager+MouseTracking.swift: mouse events and hover
- NotificationManager+Lifecycle.swift: high-level orchestration

Also extracted button classes from NotificationViews.swift into NotificationButtons.swift for better separation of concerns.

This refactoring improves code organization without changing functionality.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 2, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit d0490f5
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/695720a959595d000842fd7f

@netlify
Copy link

netlify bot commented Jan 2, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit d0490f5
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/695720a9d02b1900097ca4f3

@netlify
Copy link

netlify bot commented Jan 2, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit d0490f5
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/695720a93822d50008f7c875

@yujonglee yujonglee merged commit 87d5310 into main Jan 2, 2026
@yujonglee yujonglee deleted the devin/1767316994-refactor-notification-macos-swift branch January 2, 2026 01:34
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.

2 participants