CodeEdit icon indicating copy to clipboard operation
CodeEdit copied to clipboard

✨ Themes Preferences

Open austincondiff opened this issue 3 years ago • 13 comments

Is your feature request related to a problem? Please describe. We need a better themes preferences tab to allow for better usability and more scalability as we add more features around themes.

Describe the solution you'd like

15-macOS-code-edit-preferences-themes-10a 15-macOS-code-edit-preferences-themes-10b 15-macOS-code-edit-preferences-themes-10c
  • You see two panels at the top to select a theme and a panel with three tabs, Preview, Editor, and Terminal.
    • Preview: Preview the theme in various languages.
    • Editor: Configure the theme colors for the editor.
    • Terminal: Configure the theme colors for the terminal.
  • Below the panels, you see two checkboxes.
    • The first checkbox says, "Use theme background". When unchecked, it will use the standard window background, when it is checked, it will use the background color that the theme defines.
    • The second checkbox says, "Automatically change theme based on system appearance".
      • This will be checked by default.
      • When this is checked
        • The theme will automatically change with the system or application appearance (light/dark mode)
        • At the top of the theme thumbnail selection panel, you will see two tabs. One for light mode, one for dark mode.
          • The user will use these tabs to make a theme selection for each light and dark mode.
      • When this is unchecked
        • The theme remains the same regardless of system or application appearance (light/dark mode)
        • There are no tabs at the top of the theme selection panel

Alternatives considered

Alternate Concept 2 by @underthestars-zhy CodeEdit Themes Preference Tab Concept 1CodeEdit Themes Preference Tab Concept 2

Alternate Concept 3 CodeEdit Themes Preference Tab Concept 1CodeEdit Themes Preference Tab Concept 2

Description
  • You see two tabs at the top to select a theme for the editor and a theme for the terminal.
  • For the Editor theme, below the tabset inside the well, you see the selected theme name, along with two checkboxes.
    • The first checkbox says, "Use theme background". When unchecked, it will use the standard window background, when it is checked, it will use the background color that the theme defines.
    • The second checkbox says, "Automatically change theme based on system appearance".
      • This will be checked by default.
      • When this is checked
        • The theme will automatically change with the system or application appearance (light/dark mode)
        • To the right of the checkboxes you will see two preview thumbnails. One for light, one for dark.
          • These thumbnails act as tabs to make a theme selection for the selected mode.
          • When the light thumbnail is selected, you can select the theme below that will be applied when the application is in light mode.
          • When the dark thumbnail is selected, the user can then select the dark theme to use when the application is in dark mode.
      • When this is unchecked
        • The theme remains the same regardless of system or application appearance (light/dark mode)
        • To the right of the checkboxes you will see a single preview thumbnail when "Automatically change theme based on system appearance" is unchecked
  • The terminal tabs contents are largely the same, with an added checkbox that says "Use the editor theme".
    • This will be checked by default.
    • When checked
      • It will disable theme selection below while in the terminal tab.
      • It will use the theme selected in the editor tab.
    • When unchecked
      • Theme selection below is enabled.
      • It will apply the selected theme to the terminal only.

Alternate Concept 4 CodeEdit Themes Preference Tab Concept 1CodeEdit Themes Preference Tab Concept 2

Description
  • You see two tabs at the top to select a theme for the editor and a theme for the terminal.
  • For the Editor theme, below the tabset and below the well, you see two checkboxes.
    • The first checkbox says, "Use theme background". When unchecked, it will use the standard window background, when it is checked, it will use the background color that the theme defines.
    • The second checkbox says, "Automatically change theme based on system appearance".
      • This will be checked by default.
      • When this is checked
        • The theme will automatically change with the system or application appearance (light/dark mode)
        • At the top of the theme thumbnail selection panel, you will see two tabs. One for light mode, one for dark mode.
          • The user will use these tabs to make a theme selection for each light and dark mode.
      • When this is unchecked
        • The theme remains the same regardless of system or application appearance (light/dark mode)
        • There are no tabs at the top of the theme selection panel
  • The terminal tab contents are largely the same, with an added checkbox that says "Use the editor theme".
    • This will be checked by default.
    • When checked
      • It will disable theme selection while in the terminal tab.
      • It will use the theme selected in the editor tab.
    • When unchecked
      • Theme selection is enabled.
      • It will apply the selected theme to the terminal only.

Additional context

We want to stay close to how macOS presents this type of interaction. Screen Shot 2022-03-27 at 4 41 12 PMScreen Shot 2022-03-28 at 12 44 51 AM

We may later consider other tabs such as "icons" for different icon sets and application icons.

austincondiff avatar Mar 27 '22 22:03 austincondiff

vote in this comment by emoji

If you like @austincondiff ‘s idea, please give a rocket. If you like @underthestars-zhy ’s idea, please give it a heart

Concept 1 isn’t in this vote. Because concept one can be easily implemented into concepts 2 & 3

underthestars-zhy avatar Mar 28 '22 06:03 underthestars-zhy

Quick instructions about option 2:

Q: If I want theme auto changes when I change the system appearance

A: Use a dynamic theme.

Q: If I want to have different themes on light and dark mode. And they can auto change

A: Choose a light theme and a dark theme. You will see two previews on the right side.

underthestars-zhy avatar Mar 28 '22 06:03 underthestars-zhy

I really like concept 1. I think we should have this code preview to easily see how the theme looks on different languages. This will make customization a lot more accessible.

lukepistrol avatar Mar 28 '22 13:03 lukepistrol

I really like concept 1. I think we should have this code preview to easily see how the theme looks on different languages. This will make customization a lot more accessible.

concept 1 can be implemented to concept 2 and 3 by using menu.

underthestars-zhy avatar Mar 28 '22 13:03 underthestars-zhy

@underthestars-zhy I really appreciate the effort, but you are creating confusion in your attempts to oversimplify the UI. Sometimes being explicit and intentional drives increased user understanding and clarity. Same thing goes for #148 and #205.

austincondiff avatar Mar 28 '22 14:03 austincondiff

@underthestars-zhy I really appreciate the effort, but you are creating confusion in your attempts to oversimplify the UI. Sometimes being explicit and intentional drives increased user understanding and clarity. Same thing goes for #148 and #205.

So, if you use your ideas. Then we need to abandon the dynamic theme. Is there any way to achieve a balance between the two?

underthestars-zhy avatar Mar 28 '22 14:03 underthestars-zhy

Maybe we can have a related theme if a dark theme is associated with a light theme. When the user chooses this dark theme, the light theme can change to the related light theme if the user doesn’t like it. They can shift the light theme back.

This can use concept 3

Or we pop a button. If the user wants to change to the related theme, they tap them

underthestars-zhy avatar Mar 28 '22 14:03 underthestars-zhy

I just discovered that Xcode automatically changes themes on system appearance change. It simply applies the theme selected when the user in in each mode.

For example:

  • I am in dark mode
  • The theme is set to Basic Dark (default)
  • I select High Contrast Dark
  • I change system appearance to light mode
  • The theme automatically changes to Basic Light (default)
  • I change the theme to Sunset
  • I change the system appearance to dark mode
  • The theme automatically changes to High Contrast Dark
  • I change the system appearance to light mode
  • The theme automatically changes to Sunset

As you can see, it simply remembers my preference for each mode. No need for additional UI to set for each mode. Should we do this or keep our design as is?

austincondiff avatar Mar 29 '22 16:03 austincondiff

Please note: I just updated the mockups in the issue description with our new target design.

austincondiff avatar Mar 29 '22 20:03 austincondiff

I'll work on this next!

lukepistrol avatar Mar 30 '22 01:03 lukepistrol

At the moment (as of #343 ) the themes get saved/read to/from ~/.codeedit/themes as a .json file that looks like this:

{
  "type" : "dark",
  "license" : "MIT",
  "author" : "CodeEdit",
  "description" : "CodeEdit default dark theme.",
  "name" : "Default (Dark)",
  "distributionURL" : "https:\/\/github.com\/CodeEditApp\/CodeEdit",
  "version" : "0.0.1",
  "editor" : {
    "strings" : {
      "color" : "#f0907f"
    },
    "comments" : {
      "color" : "#97be71"
    },
    "numbers" : {
      "color" : "#d6c775"
    },
    "commands" : {
      "color" : "#c6a3f9"
    },
    "lineHighlight" : {
      "color" : "#303030"
    },
    "values" : {
      "color" : "#70c1e2"
    },
    "background" : {
      "color" : "#1e1e1e"
    },
    "keywords" : {
      "color" : "#ef8bb6"
    },
    "text" : {
      "color" : "#DDDDDD"
    },
    "insertionPoint" : {
      "color" : "#DDDDDD"
    },
    "selection" : {
      "color" : "#8b8b8b"
    },
    "types" : {
      "color" : "#93c7bc"
    },
    "variables" : {
      "color" : "#70c1e2"
    },
    "attributes" : {
      "color" : "#93c7bc"
    },
    "characters" : {
      "color" : "#93c7bc"
    },
    "invisibles" : {
      "color" : "#636363"
    }
  },
  "terminal" : {
    "text" : {
      "color" : "#ffffff"
    },
    "boldText" : {
      "color" : "#ffffff"
    },
    "cursor" : {
      "color" : "#ffffff"
    },
    "background" : {
      "color" : "#1e1e1e"
    },
    "selection" : {
      "color" : "#8b8b8b"
    },
    "black" : {
      "color" : "#000000"
    },
    "red" : {
      "color" : "#990000"
    },
    "green" : {
      "color" : "#00a600"
    },
    "yellow" : {
      "color" : "#999900"
    },
    "blue" : {
      "color" : "#0000b2"
    },
    "magenta" : {
      "color" : "#b200b2"
    },
    "cyan" : {
      "color" : "#00a6b2"
    },
    "white" : {
      "color" : "#bfbfbf"
    },
    "brightBlack" : {
      "color" : "#666666"
    },
    "brightRed" : {
      "color" : "#e50000"
    },
    "brightGreen" : {
      "color" : "#00d900"
    },
    "brightYellow" : {
      "color" : "#e5e500"
    },
    "brightBlue" : {
      "color" : "#0000ff"
    },
    "brightMagenta" : {
      "color" : "#e500e5"
    },
    "brightCyan" : {
      "color" : "#00e5e5"
    },
    "brightWhite" : {
      "color" : "#e5e5e5"
    }
  }
}

lukepistrol avatar Mar 31 '22 12:03 lukepistrol

What is left on this? @lukepistrol do you want to add a checklist at the issue description if it is still in progress?

austincondiff avatar Apr 05 '22 17:04 austincondiff

@austincondiff, @lukepistrol Can we close this issue or is there still work being done?

nanashili avatar Apr 20 '22 18:04 nanashili

@nanashili maybe this isn't closed yet because of #1215? I agree that we should close this though.

MrDevel0per avatar Apr 24 '23 18:04 MrDevel0per