Skip to content

Conversation

@florianduros
Copy link
Member

@florianduros florianduros commented Jul 21, 2025

Flex & Box components will be used by some shared components (ongoing PRs). This PR:

  • moves the Flex/Box component
  • transform the pcss into a css module
  • fix some dirty class override of the flex/Box component

@florianduros florianduros added the T-Task Tasks for the team like planning label Jul 21, 2025
@florianduros florianduros force-pushed the florianduros/share-flex branch from 0d17e61 to 926bee6 Compare July 21, 2025 16:25
line-height: $font-25px;

/* E2E icon wrapper */
.mx_Flex > span {
Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't seem to be used anymore

fdroidUrl?: string;
}> = ({ appleAppStoreUrl, googlePlayUrl, fdroidUrl }) => (
<Flex gap="var(--cpd-space-6x)">
<Flex gap="var(--cpd-space-6x)" className="mx_Flex">
Copy link
Member Author

Choose a reason for hiding this comment

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

Override already declared here:

.mx_Flex {
margin: 0 auto;
max-width: max-content;
flex-wrap: wrap;
justify-content: space-evenly;
}

Adding the class manually since the Flex component use a css module.

Copy link
Member

Choose a reason for hiding this comment

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

in which case this class should be changed to something scoped to mx_ErrorView

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

I think Box should be taken with it, given it is the same style of component

/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
* Copyright 2025 New Vector Ltd.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this can just shed the old copyrights given the majority of the file hasn't changed

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 7b4f240

SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
* Copyright 2025 New Vector Ltd.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Member Author

Choose a reason for hiding this comment

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

<div class="mx_MatrixChat">
<main class="mx_RoomView">
<div class="mx_Flex mx_RoomHeader light-panel">
<div class="mx_RoomHeader light-panel">
Copy link
Member

Choose a reason for hiding this comment

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

Flex class name not showing up in snapshots seems like an issue, you can't differentiate between a div and a Flex container

Copy link
Member Author

Choose a reason for hiding this comment

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

I can keep a dummy mx_Flex classname in the Flex component

Copy link
Member

Choose a reason for hiding this comment

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

Why is the css module classname not visible? it is for e.g. Compound components

Copy link
Member Author

@florianduros florianduros Jul 22, 2025

Choose a reason for hiding this comment

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

Hmmm, I suppose we are missing some jest/webpack configuration. In compound we are using vitest using the vite conf

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@florianduros florianduros requested a review from a team as a code owner July 22, 2025 13:51
@florianduros florianduros force-pushed the florianduros/share-flex branch from 65e15b4 to a38ec2b Compare July 22, 2025 13:53
@florianduros florianduros changed the title Move Flex component into shared component folder Move Flex & Box component into shared component folder Jul 22, 2025
@florianduros florianduros force-pushed the florianduros/share-flex branch from b0d5b7a to d041219 Compare July 22, 2025 14:46
@florianduros
Copy link
Member Author

I moved the Box component too. Completed the jest conf to handle the css module.

@florianduros florianduros enabled auto-merge July 22, 2025 16:02
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.

Haven't checked the detail of most of the changes, but the crypto stuff looks fine

@florianduros florianduros added this pull request to the merge queue Jul 22, 2025
Merged via the queue into develop with commit 1e689ac Jul 22, 2025
37 checks passed
@florianduros florianduros deleted the florianduros/share-flex branch July 22, 2025 17:18
Dileep9999 pushed a commit to hemanth-nag/element-web that referenced this pull request Oct 8, 2025
)

* refactor: move Flex component in shared components

* refactor: update imports

* refactor: remove Flex pcss file

* fix: Flex component css override

* test: update snapshots

* fix: html export

* chore: add css module support to jest

* chore: keep old copyright

* refactor: change `mx_Flex` in `ErrorView` to `mx_ErrorView_flexContainer`

* test: update snapshots

* refactor: move Box component in shared components

* refactor: update import and css override

* test: update snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants