Skip to content

Conversation

rgeraskin
Copy link
Contributor

Add "Open Custom Layouts Folder" button to Layouts preferences

Closes #1434

What's Changed

Added a new button in the Layouts preferences tab that allows users to quickly open the custom layouts directory in Finder.

Why This Feature?

  • Better User Experience: Users no longer need to manually navigate to ~/Library/Application Support/Amethyst/Layouts/
  • Improved Discoverability: Makes it easier for users to find where to place custom layout JavaScript files
  • Consistency: Follows macOS app patterns of providing direct access to user data directories

How It Works

  • Button is positioned to the left of the existing "Relaunch Amethyst" button
  • Clicking "Open Custom Layouts Folder" opens the layouts directory in Finder
  • If the directory doesn't exist, it's automatically created (via existing layoutsDirectory() method)
  • Graceful error handling with logging if directory access fails

Implementation Details

  • UI Changes: Added button with proper Auto Layout constraints in LayoutsPreferencesViewController.xib
  • Controller Changes: Added @IBOutlet and @IBAction in LayoutsPreferencesViewController.swift
  • Leverages Existing API: Uses the existing FileManager.layoutsDirectory() extension method
  • Native macOS Integration: Uses NSWorkspace.shared.open() to open directory in default file manager

Files Modified

  • Amethyst/Preferences/LayoutsPreferencesViewController.xib - Added button UI and constraints
  • Amethyst/Preferences/LayoutsPreferencesViewController.swift - Added outlet and action method

User Benefit

This enhancement reduces friction for users who want to create or manage custom layouts, making the feature more accessible and user-friendly.

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.

Add button or menu item to open custom layouts folder
1 participant