Skip to content

feat(macos): introduce native macOS edition (SwiftUI) with modern mod management - #378

Closed
kxgcayh wants to merge 13 commits into
Floogen:developmentfrom
kxgcayh:development
Closed

kxgcayh wants to merge 13 commits into
Floogen:developmentfrom
kxgcayh:development

Conversation

@kxgcayh

@kxgcayh kxgcayh commented Oct 4, 2026

Copy link
Copy Markdown

Summary

This pull request introduces StardropMac, a native macOS mod manager for Stardew Valley built with Swift and SwiftUI. It resides independently in the StardropMac/ directory, leaving the existing C# / Avalonia codebase completely untouched while sharing the exact same configuration files, profiles, and data directory structure.


Why a Native macOS Version?

While Stardrop already offers a cross-platform build via Avalonia (.NET / C#), running a desktop application on macOS through cross-platform UI frameworks comes with inherent platform limitations:

  1. True AppKit / Cocoa UI vs. Canvas Rendering:

    • The Avalonia version renders UI controls on a custom Skia canvas rather than using native AppKit/Cocoa widgets.
    • As a result, standard macOS conventions such as trackpad kinetic scrolling, rubber-band bounce physics, CoreText subpixel antialiasing, native dropdowns, and modal window sheets are either emulated or behave like Windows desktop controls.
    • StardropMac uses native SwiftUI and AppKit components, behaving identically to first-party macOS applications (such as Finder or Xcode).
  2. Performance, Startup Time, and Runtime Overhead:

    • The native Swift binary compiles directly to machine code for both Apple Silicon (arm64) and Intel (x86_64).
    • It eliminates the requirement for the .NET runtime bundle, resulting in instantaneous cold launches, lower idle memory consumption, and zero runtime dependencies.
  3. Deep macOS System Integration:

    • Window layout follows Apple Human Interface Guidelines using NavigationSplitView with translucent sidebars.
    • Menus are wired directly into the global macOS system menu bar with standard macOS keyboard shortcuts (⌘,, ⌘O, ⌘R, ⌘U).
    • Deleting mods integrates with FileManager.default.trashItem, safely sending files to the macOS Trash Bin (~/.Trash) rather than performing unrecoverable disk deletion.
    • Supports native macOS drag-and-drop archive installation directly into the window.
  4. 100% Data and Profile Compatibility:

    • StardropMac is not an isolated fork with proprietary formats. It reads and writes the exact same Settings.json, Profiles/*.json, and Notion.json (using AES-256-CBC obscurity matching Stardrop's C# implementation) in ~/Library/Application Support/Stardrop/Data/.
    • Users can seamlessly switch between the C# Avalonia build and the native macOS app without migrating or losing their configuration.

Key Features

  • Native Architecture: Built using Swift 6 and SwiftUI targeting macOS 14+ (Sonoma and Sequoia). Zero impact on existing C# project files.
  • Mod Separator System: MO2-style visual separator banners with collapsible sections, reordering, and bulk enable/disable actions.
  • Batch Mod Selection and Quick Toggling:
    • Contiguous selection with Shift + Click and Shift + ↑ / ↓.
    • Multi-selection toggles with Command + Click and Command + A.
    • Batch enable/disable with Spacebar.
  • Mod Archive Installation: Drag and drop archives (.zip, .7z, .rar, .tar.gz) or uncompressed folders into the app with automatic manifest discovery and config.json preservation.
  • Deletion Safety and Dependency Warnings: Right-click and sidebar mod deletion with dependency checking that warns users if deleting a mod breaks enabled dependents.
  • Nexus Mods Integration & Endorsements: Account API key validation, Premium detection, endorsement status display, and native endorse/abstain toggling.
  • SMAPI Protection: Manifest parsing safeguards core SMAPI components (ConsoleCommands, SaveBackup, ErrorHandler) against accidental disabling or deletion.
  • Profile Management: Profile switching, cloning, and symlink staging into Selected Mods/ for SMAPI launching.
  • In-App Config Editor: Direct config.json editing with syntax validation.
  • Automated Packaging: Includes standalone build scripts for application bundles (build-mac-app.sh) and compressed disk images (build-dmg.sh).

How to Test

  1. Navigate to the StardropMac directory:
    cd StardropMac
  2. Build and run via Swift Package Manager:
    swift run
  3. Or package the application bundle:
    ./build-mac-app.sh
    open build/Stardrop.app
  4. Verify that existing Stardrop profiles and settings in ~/Library/Application Support/Stardrop/Data/ are loaded properly.

kxgcayh added 13 commits October 4, 2026 04:31
- Built with Swift 6 and SwiftUI targeting macOS 14+ (Sonoma & Sequoia)
- 3-column navigation: Library categories, Profiles, diagnostic Tools, and Nexus Services
- Center-view collapsible mod groups with centered status toggles and batch controls
- Official Nexus Mods API integration with live key validation and Premium detection
- Live SMAPI launcher with symlink staging and SMAPI_MODS_PATH injection
- In-app mod config.json editor
- Native About dialog with environment diagnostics, attribution, and license links
- Full compatibility with existing Stardrop Settings.json and Profiles/*.json
- Packaged build script build-mac-app.sh and dedicated StardropMac/README.md
…rotection

- Add ModSeparator model, SeparatorService, and management sheets
- Support grouping mods by separator with collapse/expand, reorder, and bulk actions
- Add direct list toggling via checkbox and status pills
- Add Spacebar shortcut for toggling selected mod with Up/Down arrow navigation
- Fix case-insensitive manifest decoding for SMAPI core mods (UniqueId vs UniqueID)
- Enforce core SMAPI component protection (ConsoleCommands, SaveBackup, ErrorHandler)
- Clean up sidebar profile header controls and update indicators
- Add build-dmg.sh packaging tool with Retina background generation
- Configure Finder layout, custom volume icon, and /Applications symlink
- Support UDZO maximum compression and SHA256 checksum generation
- Add CFBundleURLTypes (nxm://) to build-mac-app.sh Info.plist
- Update StardropMac README with DMG build instructions
- Support installing mods from archives (.zip, .7z, .rar, .tar.gz) and folders
- Enable drag-and-drop onto the main window with visual drop zone and progress overlay
- Add manual archive picker via Command+O, toolbar '+' button, and context menu
- Preserve user config.json files when updating existing mods
- Support Nexus Mods endorsements with AES-256-CBC key obscurity compatible with Notion.json
- Modularize MainView view modifiers to optimize Swift compiler type-check performance
…ht click & sidebar

- Add 'Delete Mod...' to table row context menu and right inspector sidebar
- Detect if mod is a required dependency of any currently enabled mods
- Present warning confirmation dialog listing affected dependent mods
- Safely move deleted mod folder to macOS Trash via FileManager.trashItem
- Clean up deleted mod references across profiles and separators
- Protect core SMAPI mods from deletion
- Support range selection via Shift+Click and Shift+Arrow Up/Down
- Support individual toggle selection via Command+Click and Command+A (Select All)
- Enable Space shortcut to batch toggle all selected mods (mixed -> enabled -> disabled)
- Update context menu and inspector sidebar with batch actions and batch deletion
- Centralize app versioning in AppVersion.swift (1.11.0, build 2)
- Update AboutSheet, ModUpdateService, and NexusService headers to 1.11.0
- Update build-mac-app.sh and build-dmg.sh defaults to 1.11.0
@Floogen Floogen added the wontfix This will not be worked on label Oct 4, 2026
@Floogen

Floogen commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Hello!

While I agree there are some benefits in utilizing Swift, I don't believe they outweigh the cost of having to maintain two separate codebases for cross-platform support (which is one of the reasons I went with Avalonia). Stardrop currently already enjoys cross-platform support and I believe some of the more outstanding compatibility issues will be resolved after migrating to the latest Avalonia version.

My project is open source, so please feel free to maintain your own fork!

@Floogen Floogen closed this Oct 4, 2026
@kxgcayh

kxgcayh commented Oct 4, 2026

Copy link
Copy Markdown
Author

Thanks for your response, so I can upload it on nexus?

@Floogen

Floogen commented Oct 4, 2026

Copy link
Copy Markdown
Owner

As Stardrop is open-source, you are free to do as you like so long as you follow the project's license. I am fairly sure you will need to upload it under a different name (i.e. not Stardrop) for Nexus Mods, as they have their own rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants