Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Conform the style rules of GeneralUserSettingsTab.tsx to the style guide #10595

Merged
merged 4 commits into from
May 12, 2023
Merged

Conform the style rules of GeneralUserSettingsTab.tsx to the style guide #10595

merged 4 commits into from
May 12, 2023

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Apr 13, 2023

This PR intends to conform the style rules of general user settings tab to our updated style guide.

type: task

Signed-off-by: Suguru Hirahara luixxiul@users.noreply.github.com

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This change is marked as an internal change (Task), so will not be included in the changelog.

@github-actions github-actions bot added Z-Community-PR Issue is solved by a community member's PR T-Task Refactoring, enabling or disabling functionality, other engineering tasks labels Apr 13, 2023
@luixxiul luixxiul changed the title Add general-user-settings-tab.spec.ts and apply style rules to the tab strictly Add general-user-settings-tab.spec.ts and conform the style rules to the style guide Apr 17, 2023
@luixxiul luixxiul marked this pull request as ready for review April 17, 2023 16:21
@luixxiul luixxiul requested a review from a team as a code owner April 17, 2023 16:21
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

@luixxiul: I'm a bit concerned that this is making some quite significant changes to the CSS, and it is hard to review them for correctness. Is there any way we can land the test without changing the CSS so much?

src/components/views/settings/ChangePassword.tsx Outdated Show resolved Hide resolved
@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 18, 2023

@luixxiul: I'm a bit concerned that this is making some quite significant changes to the CSS, and it is hard to review them for correctness. Is there any way we can land the test without changing the CSS so much?

It is possible, and the test indeed should be landed at first, with a Percy snapshot test which I have forgotten to add. I am going to create another PR which cherry-picks the commit of the test, adjusting class names. Changing CSS rules will be properly tested then. I'm wondering if this would look fine.

@richvdh
Copy link
Member

richvdh commented Apr 18, 2023

It sounds perfect to me!

@luixxiul
Copy link
Contributor Author

The PR for the test was created here: #10658

@artcodespace artcodespace removed their request for review April 20, 2023 14:52
@luixxiul luixxiul changed the title Add general-user-settings-tab.spec.ts and conform the style rules to the style guide Conform the style rules of GeneralUserSettingsTab.tsx to the style guide Apr 20, 2023
@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 21, 2023

@richvdh The snapshot (User settings tab - General) was taken as expected, and now it should be good to restart working on this 👍 I'll ping you after I finish checking the style rules.

1

) : null;

return (
<div className="mx_SettingsTab_section">
<div className="mx_SettingsTab_section mx_GeneralUserSettingsTab_section--discovery">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should not change how .mx_SettingsTab_subheading and .mx_Spinner are displayed, as both of them are elements inside threepidSection, which this element consists.

@luixxiul luixxiul requested a review from richvdh April 23, 2023 04:26
@luixxiul
Copy link
Contributor Author

It looks like something is wrong with the test. I'm checking.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

looks sensible to me otherwise

@luixxiul
Copy link
Contributor Author

@richvdh Thank you for the review. It should be fine now.

@luixxiul
Copy link
Contributor Author

luixxiul commented May 1, 2023

#10679 should be merged at first. Merging this or that PR will result in a conflict which needs to be fixed.

Comment on lines 45 to 49
.mx_GeneralUserSettingsTab_discovery_existing {
display: flex;
align-items: center;
margin-bottom: 5px;
}
Copy link
Member

Choose a reason for hiding this comment

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

Following @gsouquet's comments on #10679, these were moved to the top level. It seems wrong that you should nest them now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Above .mx_GeneralUserSettingsTab_section--discovery_existing is nested, and setting this mx_GeneralUserSettingsTab_section--discovery_existing to a different level can lead to a regression due to the difference of specificity.

This means that mx_GeneralUserSettingsTab on this line above should be removed, in order to remove the difference of specificity altogether.

I am going to push a commit to address this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed with 4cb0e59.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And I remember that comment was directed to nesting of mx_GeneralUserSettingsTab_section--discovery_existing_address and mx_GeneralUserSettingsTab_section--discovery_existing_promptText into mx_GeneralUserSettingsTab_section--discovery_existing, so the nesting by this PR was not related to that comment anyway, because this PR was going to nest those selectors' declarations to mx_GeneralUserSettingsTab.

@richvdh
Copy link
Member

richvdh commented May 4, 2023

This has changed quite a bit since the earlier reviews, so I think it needs a full re-review. I don't think I'll have time today.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

@luixxiul I'm afraid I'm still struggling to follow this. It's probably fine, but I am conscious of the risk of introducing bugs if anything is incorrect. I appreciate your work in adding a test, but it cannot detect every problem so we still need to review changes like this carefully.

One thing that makes it hard to review is that it seems to be conflating two different types of change into the same PR:

  • Renaming classes like mx_GeneralUserSettingsTab_accountSection to mx_GeneralUserSettingsTab_section--account to conform to the style guide
  • Restructuring the CSS to collect all the settings for a given class (such as mx_SetIdServer) into one place.

Would it be possible to split up this PR to separate the structural changes from the renames?

@luixxiul
Copy link
Contributor Author

luixxiul commented May 5, 2023

I understood. I'll recreate the PR from removing commits for another PR, so please forget the current status of the PR.

@luixxiul
Copy link
Contributor Author

luixxiul commented May 5, 2023

I updated the PR to exclude anything not related to conforming the file to our naming policy.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

Thanks.

I have to say that I'm not convinced this sort of renaming exercise provides much value, compared to the time taken to write and review the changes.

Nevertheless, this looks sensible enough.

@richvdh richvdh added this pull request to the merge queue May 12, 2023
@luixxiul
Copy link
Contributor Author

luixxiul commented May 12, 2023

Thanks for the review!

the time taken to write and review the changes

You would not have to be worried about my side as I am just doing that on my free will for free, following our style guide, to make the style codebase understandable to anyone, as easily as possible, for the sake of nothing more than the Matrix ecosystem.

In this sense, I am a little bit sad because I feel you basically told me that it was a waste of time to review such a meaningless change.

Merged via the queue into matrix-org:develop with commit cb779fe May 12, 2023
richvdh pushed a commit that referenced this pull request May 12, 2023
…guide (#10595)

* Nesting: `mx_GeneralUserSettingsTab_changePassword`

* Nesting: `mx_Spinner`

* Conform the style rules to the naming policy

For elements inside "mx_GeneralUserSettingsTab_accountSection" and "mx_GeneralUserSettingsTab_discovery"

* Conform `mx_GeneralUserSettingsTab_discovery_existing*` to the naming policy
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants