[PR #13386] Fix macOS directory selection dialog for single selection #19460

Open
opened 2026-04-16 07:08:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13386
Author: @ZeeeUs
Created: 12/8/2025
Status: 🔄 Open

Base: mainHead: fix/macos-dir-dialog-single-selection


📝 Commits (1)

  • a6c5b91 addFix macOS directory selection dialog for single selection

📊 Changes

1 file changed (+45 additions, -31 deletions)

View changed files

📝 app/dialog/cocoa/dlg.m (+45 -31)

📄 Description

Fix macOS directory selection dialog for single selection

Problem

The directory selection dialog on macOS was always returning "Cancelled" when selecting a model directory through the Settings UI. The dialog would appear and allow selection, but the selected path was never captured.

Root Cause

In app/dialog/cocoa/dlg.m, the code only handled multiple file selection (allowMultiple == true), but did not process single directory selection. When a user selected a directory, the path was never written to the buffer, resulting in an empty string that was interpreted as cancellation.

Solution

  • Added handling for single file/directory selection in dlg.m to extract and write the path to the buffer

Testing

  • Verified directory selection works correctly on macOS
  • Confirmed Windows build is unaffected (uses separate implementation)

Fixes: Directory selection in Settings → Model location

Fix: #13364 and #12883


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13386 **Author:** [@ZeeeUs](https://github.com/ZeeeUs) **Created:** 12/8/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/macos-dir-dialog-single-selection` --- ### 📝 Commits (1) - [`a6c5b91`](https://github.com/ollama/ollama/commit/a6c5b91344a56b12a0b7014eaf5e48b8839613bd) addFix macOS directory selection dialog for single selection ### 📊 Changes **1 file changed** (+45 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `app/dialog/cocoa/dlg.m` (+45 -31) </details> ### 📄 Description ## Fix macOS directory selection dialog for single selection ### Problem The directory selection dialog on macOS was always returning "Cancelled" when selecting a model directory through the Settings UI. The dialog would appear and allow selection, but the selected path was never captured. ### Root Cause In `app/dialog/cocoa/dlg.m`, the code only handled multiple file selection (`allowMultiple == true`), but did not process single directory selection. When a user selected a directory, the path was never written to the buffer, resulting in an empty string that was interpreted as cancellation. ### Solution - Added handling for single file/directory selection in `dlg.m` to extract and write the path to the buffer ### Testing - Verified directory selection works correctly on macOS - Confirmed Windows build is unaffected (uses separate implementation) Fixes: Directory selection in Settings → Model location Fix: #13364 and #12883 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:08:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#19460