AppFlowy icon indicating copy to clipboard operation
AppFlowy copied to clipboard

[Bug] error message when loading themes

Open yotamguttman opened this issue 1 year ago • 5 comments

Bug Description

image receiving different error messages when attempting to upload any theme file.

How to Reproduce

I downloaded all the official themes from the Themes Appflowy Docs Article. I tried to upload them all: base, barbie, and dracula. I kept receiving an error in return that the light theme file is faulty and the learn more button just sends me back to the same docs page...

Expected Behavior

the theme file should have been added to the theme list and applied to the app UI.

Operating System

Fedora 40, Gnome 46

AppFlowy Version(s)

unknown

Screenshots

No response

Additional Context

also, when you download a theme file from the Appflowy docs page, you get a zip file which when extracted, has an odd structure. check this image: image

there's the zipping folder which inside has a folder of the same name and some mac crap folder. and this can be confusing to some users because the docs article steps describe having to unzip the archived file and uploading the extracted folder to the Appflowy theme UI. but if you do that you get the following error message: image

because Appflowy expects to see the light+dark json files right in side this folder, but instead there's a duplication of the same folder and some empty mac folder. I figured that I should pick the folder inside which housed the Json files but it isn't at all reproducible according to the docs article. https://docs.appflowy.io/docs/appflowy/product/themes


and the cherry on top is that the 'debug info' button does not do anything. so I cannot share the version details because it doesn't show in the settings page either. I updated all my apps 2 days ago so I suppose it's the latest vers. Screenshot from 2024-05-18 11-02-31

yotamguttman avatar May 18 '24 09:05 yotamguttman

I believe there are a lot of improvements to the theme upload handler that can be done.

This is one of many, but at least:

  • [ ] A theme should not require dark/light mode versions, it should be optional.
  • [ ] Concise error messages, if eg. a variable is missing, it should warn the user but still succeed in importing (the missing color should be it's default variant, instead of failing completely)

Xazin avatar May 18 '24 13:05 Xazin

let me just emphasis again that the only theme files I've tried to import are from the official doc article. I'd find it hard to believe the theme files were faulty. I did run a quick test and copied the content of the dark json to the light json (I tried it on the 'base' theme) and I still received the same error regarding the light theme... even though it had the exact same content as the 'dark'...

also, while I see why it's good practice to create both light and dark configs when you author a theme, I'd agree with you that it should be optional.

yotamguttman avatar May 18 '24 14:05 yotamguttman

Hey @yotamguttman, the error message is because there is a new color field called secondaryTextColor added to the FlowyColorScheme but the themes in the documentation do not have any color for that field.

I am going to add a new zip adding this new color field. Thanks for filing this issue.

MayurSMahajan avatar May 18 '24 17:05 MayurSMahajan

I have updated the official docs, but the official docs will take some time to reflect those changes, till then you can download this zip file here: Dracula.flowy_plugin.zip

MayurSMahajan avatar May 18 '24 18:05 MayurSMahajan

While we are here, I think the error UI can be improved.

MayurSMahajan avatar May 18 '24 18:05 MayurSMahajan

@yotamguttman , this issue should be fixed. Please feel free to reopen

annieappflowy avatar Sep 30 '24 13:09 annieappflowy