codeui icon indicating copy to clipboard operation
codeui copied to clipboard

[Fix] Same colors but different digits should be grouped together

Open usernamehw opened this issue 6 years ago • 14 comments

  1. Toggle View to Palette View
  2. #ccc & #cccccc is in 2 different groups

Screenshot (64)

All 4 colors are the same:

  • #fff
  • #ffff
  • #ffffff
  • #ffffffff

EDIT(@ryanraposo):

Considerations

  • For individual items, its important that CodeUI shows the hex value as it would appear in the theme file/settings.json.
  • We might need to change group titles. An example: use the shortest, or most 'reduced' hex code possible for the group's color.

usernamehw avatar Aug 26 '19 15:08 usernamehw

New here? Welcome.

If you want to get started on this Issue but need some help, leave a comment and we'll work through it together!

ryanraposo avatar Dec 14 '20 16:12 ryanraposo

I 'm new and i want to progress, so i could try to resolve this issue if you want ;)

Judikaelle avatar Dec 14 '20 18:12 Judikaelle

I 'm new and i want to progress, so i could try to resolve this issue if you want ;)

Hell yeah! Go for it!

Did you have any questions/want any help??

ryanraposo avatar Dec 14 '20 19:12 ryanraposo

First time on a vscode extension. I'll start by searching by myself and if I have any questions I'll come back and ask them here.

Judikaelle avatar Dec 15 '20 08:12 Judikaelle

@Judikaelle 👍

ryanraposo avatar Dec 15 '20 16:12 ryanraposo

@Judikaelle remember to trust your instincts on non-extension-specific code: if it looks wonky, it probably is. There is definitely sub-optimal code here and there, particularly in the TreeView providers (elements.ts & info.ts). Most common is drawn-out, wordy code that made it easier to debug.

ryanraposo avatar Dec 16 '20 11:12 ryanraposo

@Judikaelle my first thought for this issue: a solution based on converting away from hex and then back. Thats before checking into it at all, but I figure that way we can just let the color library determine equivalency for us. What were your first impressions?

ryanraposo avatar Dec 16 '20 11:12 ryanraposo

Thx @ryanraposo for your messages. My first impressions were to convert all color values to hex as you said

Judikaelle avatar Dec 16 '20 15:12 Judikaelle

I'm going to try something tomorrow and post my solution here

Judikaelle avatar Dec 16 '20 18:12 Judikaelle

I didn't take much time to solve this problem but I'm still looking for it. I have made progress on the problem anyway. I think that converting the value of the colors in Hex (6 characters) or HexA will allow not to duplicate them.

Usefull link : https://css-tricks.com/converting-color-spaces-in-javascript/

I think creating "utils" folder is a good thing

Judikaelle avatar Dec 18 '20 10:12 Judikaelle

Usefull link : https://css-tricks.com/converting-color-spaces-in-javascript/

Really nice link! I had no idea the conversions were so simple. I actually know very little about color spaces and that boost in understanding was a big deal for me, so thank you!

I think creating "utils" folder is a good thing

First of all, I agree, I know you're right. There are some obvious candidates (functions) I can think of, some that should exist and don't yet, but honestly I'm not always sure what would qualify.

Would you say that utils are generally loose functions that serve more than one module? I guess they also wouldn't depend on non-utils? Does that sound about right?

Sometimes I feel like the utils file/folder in my projects just becomes a landfill for reject functions that didn't quite make it into the class structure.

ryanraposo avatar Jan 02 '21 03:01 ryanraposo

I'm not sure as a junior but in my opinion, the utils folder is a grouping of general functions that can/will be called several times.

Sometimes I feel like the utils file/folder in my projects just becomes a landfill for reject functions that didn't quite make it into the class structure.

I've heard something like that too. I'm just going to focus on the problem for now. We can refactor later.

Would a BDD/TDD process be a possibility eventually?

Judikaelle avatar Jan 02 '21 11:01 Judikaelle

I'm not sure as a junior but in my opinion, the utils folder is a grouping of general functions that can/will be called several times.

@Judikaelle I hear you. I'd have to do some research on it also.

I've heard something like that too. I'm just going to focus on the problem for now. We can refactor later.

Yeah of course.

Would a BDD/TDD process be a possibility eventually?

I'll look into that!

ryanraposo avatar Jan 04 '21 20:01 ryanraposo

@Judikaelle right, so tests.

We had a setup (see: https://github.com/ryanraposo/codeui/commit/03749dfc505644ea84b3731bbaa4481ba74dea0a) but I didn't take a serious look into writing any so eventually got rid of it. I know enough to know that I underestimate their impact, though.

I'm guessing the VS Code extension-specifics don't change too much about the process so that might be great if you're familiar. Here's the link for that:

https://code.visualstudio.com/api/working-with-extensions/testing-extension

Otherwise, I believe you have control over framework choices and the rest. If you do have any questions/need a review, you can ask, I'm more diligent about learning in those scenarios so I might be of some use. We could use a decent Issue for it, also.

ryanraposo avatar Jan 04 '21 21:01 ryanraposo