Skip to content

Add Linux folder picker support using zenity/kdialog#77

Closed
RohithVangalla1 wants to merge 1 commit into
nowork-studio:mainfrom
RohithVangalla1:feat/linux-folder-picker-support
Closed

Add Linux folder picker support using zenity/kdialog#77
RohithVangalla1 wants to merge 1 commit into
nowork-studio:mainfrom
RohithVangalla1:feat/linux-folder-picker-support

Conversation

@RohithVangalla1

Copy link
Copy Markdown

Summary

Implements the Linux folder picker that was marked as TODO, enabling the
Browse button to work on Linux desktops.

Implementation

  • zenity (GTK-based) as primary — most common on GNOME/Ubuntu/Fedora
  • kdialog (KDE/Plasma) as fallback — for KDE users
  • Returns clear error message if neither tool is available
  • Falls back gracefully: UI can show text input when kind: "error" is returned

Details

  • Uses ENOENT detection to distinguish "not installed" from real errors
  • Handles user cancellation (exit code 1) correctly for both tools
  • Respects the same DIALOG_TIMEOUT_MS (5 min) as the macOS implementation
  • Normalizes output (strips trailing slash) for consistency with macOS behavior
  • Extracted shared execDialog() helper to avoid duplication between zenity/kdialog paths

Addresses

TODO in pick-folder.ts:

"linux (zenity / kdialog)"

Type of change

  • New feature

Implements the Linux folder picker TODO by adding support for:
- zenity (GTK-based, common on GNOME/Ubuntu/Fedora) as primary
- kdialog (KDE/Plasma) as fallback

The implementation:
- Tries zenity first with --file-selection --directory flags
- Falls back to kdialog --getexistingdirectory if zenity is not found
- Returns a clear error message if neither tool is available
- Handles user cancellation (exit code 1) correctly for both tools
- Uses ENOENT detection to distinguish 'not installed' from real errors
- Respects the same DIALOG_TIMEOUT_MS as the macOS implementation
- Normalizes output (strips trailing slash) for consistency

Addresses the TODO:
  'linux (zenity / kdialog)'
TheophilusChinomona added a commit to TheophilusChinomona/NotFair that referenced this pull request Jun 29, 2026
…er picker, --no-open precedence

Apply fixes from open upstream PRs that apply cleanly to our fork:

- AbortSignal (nowork-studio#80, ErnestHysa): wire signal? parameter through pickFolder
  and pickFolderMac to execFile, enabling clean cancellation of osascript.
  Also extend to the new Linux execDialog helper.

- Linux folder picker (nowork-studio#77, RohithVangalla1): implement pickFolderLinux using
  zenity (GTK) with kdialog (KDE) fallback, replacing the TODO stub.
  Linux users can now use the Browse button in the NotFair UI.

- --no-open precedence (nowork-studio#92, Osamaali313): extract the auto-open guard in
  bin/notfair-content-calendar into a _should_auto_open helper that checks
  --no-open before platform. Fixes macOS/Windows ignoring the flag.

Co-authored-by: Claude
TheophilusChinomona added a commit to TheophilusChinomona/NotFair that referenced this pull request Jul 8, 2026
…er picker, --no-open precedence

Apply fixes from open upstream PRs that apply cleanly to our fork:

- AbortSignal (nowork-studio#80, ErnestHysa): wire signal? parameter through pickFolder
  and pickFolderMac to execFile, enabling clean cancellation of osascript.
  Also extend to the new Linux execDialog helper.

- Linux folder picker (nowork-studio#77, RohithVangalla1): implement pickFolderLinux using
  zenity (GTK) with kdialog (KDE) fallback, replacing the TODO stub.
  Linux users can now use the Browse button in the NotFair UI.

- --no-open precedence (nowork-studio#92, Osamaali313): extract the auto-open guard in
  bin/notfair-content-calendar into a _should_auto_open helper that checks
  --no-open before platform. Fixes macOS/Windows ignoring the flag.

Co-authored-by: Claude
ununununium added a commit that referenced this pull request Jul 21, 2026
The Browse button's native picker now works on Linux desktops: zenity
(GTK) first, kdialog (KDE/Plasma) fallback, clear error when neither is
installed. Implements the file's standing TODO. Ported from PR #77,
which targeted the pre-rename notfair-cmo/ tree; logic unchanged.

Co-authored-by: Rohith Vangalla <rohith.vangalla@optum.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCgSPUk9yU25nyxWrMEwp1
@ununununium

Copy link
Copy Markdown
Member

Thank you — this is a solid implementation and it's now on main, shipped in commit 1e92095 with your authorship preserved via Co-authored-by.

One wrinkle prevented merging the PR directly: it was written against notfair-cmo/src/server/fs/pick-folder.ts, and the app tree was renamed to notfair/ in the 0.9.0 release, so GitHub reported permanent conflicts. Rather than ask for a rebase over a trivial path move, we ported your change verbatim to the new location (notfair/src/server/fs/pick-folder.ts) — zenity-first, kdialog fallback, ENOENT-based tool detection, and the cancel/error mapping are all exactly your logic. The only additions were updating the file's header doc (Linux is no longer a TODO) and a changelog entry crediting you.

Closing this PR since the change is merged in spirit and in code. Thanks again — the Windows FolderBrowserDialog TODO is still open if you're interested!

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