Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header colored #581

Merged
merged 21 commits into from
Aug 7, 2023
Merged

Conversation

CamilleLegeron
Copy link
Collaborator

Context

#320

Content

The style of header in GridView

Peek 2023-07-20 11-57

We could rename the file CellStyle.ts by ColumnStyle.ts but it would break the translation. Or we could create an HeaderStyle.ts new file and use the css style are in the CellStyle.ts file.

@CamilleLegeron
Copy link
Collaborator Author

Two problems remain :

  • when we select a color for a column header and we cancel the choice the color remains, until we reload the page. This problem appends only for color and background color (see the gif)
  • when we select a cell with no header background color, the background color doesn't change. The style .column_name.selected in viewCommon.css file works halfway

@CamilleLegeron
Copy link
Collaborator Author

Should I only add tests in the nbBrowser/MultiColumn.ts file, or are there any other tests you'd like to add before validating this PR?

@georgegevoian georgegevoian self-requested a review July 20, 2023 17:44
@georgegevoian
Copy link
Contributor

Two problems remain :

  • when we select a color for a column header and we cancel the choice the color remains, until we reload the page. This problem appends only for color and background color (see the gif)
  • when we select a cell with no header background color, the background color doesn't change. The style .column_name.selected in viewCommon.css file works halfway

I believe the second one is happening because --grist-header-color and --grist-header-background-color are set to undefined, which is treated as defined when CSS custom properties are evaluated, so the fallbacks don't get used. Changing it so that those properties are not set at all on the element should fix it.

I haven't been able to reproduce the first one so far. Seems to be working ok for me?

@georgegevoian
Copy link
Contributor

Should I only add tests in the nbBrowser/MultiColumn.ts file, or are there any other tests you'd like to add before validating this PR?

I'd say one test in MultiColumn.ts similar to the one for cell styles, and a couple of new tests in a new file, HeaderStyles.ts, that check the basic behavior would be good.

There's already some utils in gristUtils.ts for checking cell styles that you may be able to adapt to work with header styles too, if you'd like. We have some tests for cell styles that aren't yet in this repo that we'll try to get moved over by next week; tests for header styles should be very similar, so if you can wait a little bit, you can reuse those for the new tests.

@CamilleLegeron CamilleLegeron marked this pull request as ready for review July 31, 2023 18:35
@CamilleLegeron
Copy link
Collaborator Author

thanks @georgegevoian, I added tests and correct the little error I had.
I set my PR to ready

Copy link
Contributor

@georgegevoian georgegevoian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the PR @CamilleLegeron.

I left some comments and suggestions.

static/locales/en.client.json Outdated Show resolved Hide resolved
test/nbrowser/gristUtils.ts Outdated Show resolved Hide resolved
test/nbrowser/gristUtils.ts Outdated Show resolved Hide resolved
test/nbrowser/CellColor.ts Outdated Show resolved Hide resolved
app/client/models/Styles.ts Show resolved Hide resolved
test/nbrowser/MultiColumn.ts Outdated Show resolved Hide resolved
app/client/components/GridView.js Outdated Show resolved Hide resolved
app/client/components/viewCommon.css Outdated Show resolved Hide resolved
static/custom.css Outdated Show resolved Hide resolved
app/client/components/viewCommon.css Outdated Show resolved Hide resolved
CamilleLegeron and others added 9 commits August 1, 2023 10:45
Co-authored-by: George Gevoian <85144792+georgegevoian@users.noreply.github.com>
Co-authored-by: George Gevoian <85144792+georgegevoian@users.noreply.github.com>
Co-authored-by: George Gevoian <85144792+georgegevoian@users.noreply.github.com>
Co-authored-by: George Gevoian <85144792+georgegevoian@users.noreply.github.com>
Co-authored-by: George Gevoian <85144792+georgegevoian@users.noreply.github.com>
Co-authored-by: George Gevoian <85144792+georgegevoian@users.noreply.github.com>
Copy link
Contributor

@georgegevoian georgegevoian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments.

The TypeChange test failures are unrelated so you can ignore them. (We're working on a fix.)

app/client/widgets/CellStyle.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@georgegevoian georgegevoian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CamilleLegeron!

Will merge once the MultiColumn tests are passing. (I think it's just the fill color that needs to be changed.)

test/nbrowser/MultiColumn.ts Outdated Show resolved Hide resolved
@georgegevoian georgegevoian merged commit 02841bd into gristlabs:main Aug 7, 2023
13 checks passed
Ocarthon pushed a commit to Ocarthon/grist-core that referenced this pull request Aug 10, 2023
@vviers vviers mentioned this pull request Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants