JetpackDuba / Gitnuro

A FOSS Git multiplatform client for newbies and pros
https://gitnuro.com/
GNU General Public License v3.0
869 stars 44 forks source link

Custom Theme - Failed to parse selected theme JSON. #198

Closed yougotwill closed 4 months ago

yougotwill commented 5 months ago

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):

JetpackDuba commented 5 months ago

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?

yougotwill commented 5 months ago

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.

JetpackDuba commented 4 months ago

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.

yougotwill commented 4 months ago

Awesome thanks @JetpackDuba !