JetpackDuba / Gitnuro

A FOSS Git multiplatform client for newbies and pros

Home Page:https://gitnuro.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Theme - Failed to parse selected theme JSON.

yougotwill opened this issue · comments

Describe the bug
I'm trying to load a custom theme file on macOS called theme.json. This is the contents (the default from GitHub).

{
  "primary": "FF456b00",
  "primaryVariant": "FF456b00",
  "onPrimary": "FFFFFFFFF",
  "secondary": "FF9c27b0",
  "onBackground": "FF141f00",
  "onBackgroundSecondary": "FF595858",
  "error": "FFc93838",
  "onError": "FFFFFFFF",
  "background": "FFe7f2d3",
  "backgroundSelected": "C0cee1f2",
  "surface": "FFc5f078",
  "secondarySurface": "FFedeef2",
  "tertiarySurface": "FFF4F6FA",
  "addFile": "FF32A852",
  "deletedFile": "FFc93838",
  "modifiedFile": "FF0070D8",
  "conflictingFile": "FFFFB638",
  "dialogOverlay": "AA000000",
  "normalScrollbar": "FFCCCCCC",
  "hoverScrollbar": "FF0070D8",
  "diffLineAdded": "FF0070D8",
  "diffLineRemoved": "FF0070D8",
  "isLight": true
}

I suspect it's an issue with the file dialog. You can "open" a folder but not select an individual file. Most likely the path being passed is the folder path and not the file path. Hence it fails.

Any way to check logs or something to confirm? Thanks for this awesome project and keep up the great work @JetpackDuba!

To Reproduce
Steps to reproduce the behavior:

  1. Go to Settings and select Custom theme
  2. Click the Open File button. Go to the folder with your theme file.
  3. Click open
  4. See error message.

Expected behavior
My valid JSON theme file should load.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS
  • Version 13.6.3

Hey! Thanks for your report.

I'm not really sure I have understood the issue properly. The issue is when trying to load the JSON or when using the file picker?

Hi, the issue is trying to load the JSON file.

I think the error is because the file picker is opening the parent folder and not the file itself on macOS.

The file picker was locked to only pick directories only in MacOS, thanks for pointing it out, the fix will be available in the next release.

Awesome thanks @JetpackDuba !