appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Enhancement] Improve StyledComponents theme Autocomplete for React Client Code

Open rishabhrathod01 opened this issue 4 years ago • 21 comments

check the code here - https://github.com/appsmithorg/appsmith/blob/release/app/client/src/constants/DefaultTheme.tsx#L345

Problem

Currently, for generic type value in theme for example colors: any, when we need to add something like color: ${props.theme.colors.dropdown.header.text}; using styled-components

We do not get an auto-complete prediction for such cases and also if wrote theme objects value reference incorrectly no error is generated.

Expected

  1. To see predictions when referring to theme objects value :

Example

`props.theme.colors.dropdown.hea`
                          -- header 
                          -- heading
  1. See error when incorrectly used theme object

Example

const theme = {
  colors: {
      primary: "#FFFFFF"
  }
};

// demo component
const Wrapper = styled.div`
color: ${props => props.theme.colors.incorrectPrimary}; // Should show error - no incorrectPrimary is defined
`

Solution

Ideally, we could generate the Colors type from the union of theme object's colors value & dark and light theme's color values.

rishabhrathod01 avatar Aug 24 '21 20:08 rishabhrathod01

@Rishabh-Rathod @somangshu hey I would like to take up this issue.

parul5sahoo avatar Oct 06 '21 12:10 parul5sahoo

Greetings @parul5sahoo, thanks for showing interest 🎉 , This is all yours. Assigning this to you now.

Please don't forget to read the Contribution Guidelines. Would appreciate it if you can open a PR within the next 4 days.

rishabhrathod01 avatar Oct 06 '21 14:10 rishabhrathod01

Thanks @Rishabh-Rathod ! Given this issue begins with a [Task] tag should I name the new branch that I commit changes to as "Task/ImproveStyledComponentsthemeAutocomplete" or something of the sort? Or should it begin with "/fix" or "/feature"?

parul5sahoo avatar Oct 06 '21 15:10 parul5sahoo

@parul5sahoo you can name it

chore/theme-autocomplete-enhancement-6843

rishabhrathod01 avatar Oct 06 '21 15:10 rishabhrathod01

@Rishabh-Rathod Hey, I have created a PR with a possible solution and that enables autocomplete features and subsequently solves the second part of the issue as well. Do let me know if this looks fine.

parul5sahoo avatar Oct 18 '21 17:10 parul5sahoo

@Rishabh-Rathod could I please be assigned to this?

Tallon66 avatar Oct 19 '22 03:10 Tallon66

Can I pick up this issue?

Bisht13 avatar Oct 24 '22 13:10 Bisht13

@Tallon66 sorry we are late looking at your comment; If you are available please raise a PR for this in the next 2 days and let us know here.

@Bisht13 I see you have a few other issue assigned, If the above person does not get back in 48hrs, Ill assign this to you

somangshu avatar Oct 25 '22 06:10 somangshu

@Bisht13 are you willing to pick the issue up?

somangshu avatar Oct 31 '22 09:10 somangshu

Hello, I would like to work on this, can it be assigned to me

abhisheksharma010 avatar Jul 13 '23 08:07 abhisheksharma010

@abhisheksharma886 please pick this up. Apologies for the late response here. Assigning this to you. Please raise the PR soon and let us know here, we will take it ahead for a review

somangshu avatar Jul 19 '23 12:07 somangshu

Hey, is anyone working on this issue? @somangshu

mahimathacker avatar Oct 17 '23 09:10 mahimathacker

Greetings @Thackermahima, thanks for showing interest 🎉 , This is all your. Assigning this to you now.

Please don't forget to read the Contribution Guidelines. Would appreciate if you can open a PR within the next 2 days and let me know here.

somangshu avatar Oct 17 '23 14:10 somangshu

Hello, can I pick up this issue?

razelos avatar Mar 26 '24 10:03 razelos

@rishabhrathod01 if this issue available can i take this up

Ameerjafar avatar Oct 02 '24 03:10 Ameerjafar

@rishabhrathod01 Hello can i pick up?

definitelynotchirag avatar Oct 12 '24 15:10 definitelynotchirag

@rishabhrathod01 Hello can i pick up?

@definitelynotchirag Could you please share, what would be your approach to solve this?

rishabhrathod01 avatar Oct 13 '24 07:10 rishabhrathod01

Is this issue still open?

Ayush-singh141 avatar Mar 28 '25 05:03 Ayush-singh141

hey i'm ready to work on this issue

danishhly avatar Aug 04 '25 07:08 danishhly

@rishabhrathod01 can i work on this

Harshvardhan-91 avatar Oct 02 '25 04:10 Harshvardhan-91

Is this issue still open?

champacked avatar Oct 22 '25 13:10 champacked