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

feat: Upgrade Ant to version 5 #166

Merged
merged 69 commits into from
Jun 18, 2024
Merged

feat: Upgrade Ant to version 5 #166

merged 69 commits into from
Jun 18, 2024

Conversation

ShrimpCryptid
Copy link
Contributor

@ShrimpCryptid ShrimpCryptid commented Jun 6, 2024

Problem

Closes #165, upgrading Ant Design to version 5. This is a required dependency of website-3d-volume-viewer as of version 2.9.0, and unblocks #164.

Estimated size: large, ~50-60 minutes, but it's all CSS. Turning off whitespace changes is recommended.

Solution

  • Removes old Less styling rules and replaces it with Ant's new ConfigProvider model.
  • Fixed an existing bug where, on narrow screens, parts of the Gallery could not be interacted with.
  • Fixed an existing bug where a gap would appear next to the main plot view.
  • Fixes a list of roughly 50 UI-related issues, as noted in Upgrade to Ant Design v5 #165.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Steps to Verify:

  1. Run locally. Click around to interact

Screenshots (optional):

image

image

Keyfiles (delete if not relevant):

  1. main file/entry point
  2. other important file

Thanks for contributing!

@ShrimpCryptid ShrimpCryptid marked this pull request as ready for review June 11, 2024 18:47
@ShrimpCryptid ShrimpCryptid requested a review from a team as a code owner June 11, 2024 18:47
@ShrimpCryptid ShrimpCryptid requested review from blairlyons, frasercl and interim17 and removed request for a team and blairlyons June 11, 2024 18:47
Comment on lines +69 to +70
<Descriptions column={1} size="small" colon={false}>
{userData.totalCells && <Descriptions.Item label="Number of Cells:">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes colons part of the label to prevent a weird alignment bug with multiline labels

@ShrimpCryptid ShrimpCryptid changed the base branch from feat/upgrade-w3cv to main June 13, 2024 16:59
@ShrimpCryptid ShrimpCryptid changed the base branch from main to feat/upgrade-w3cv June 13, 2024 17:01
@ShrimpCryptid ShrimpCryptid linked an issue Jun 13, 2024 that may be closed by this pull request
53 tasks
Copy link

@interim17 interim17 left a comment

Choose a reason for hiding this comment

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

Running locally looks good and all the changes look sensible.

To be fair its a lot of code and its very similar to the code its replacing, which I think makes it easy to miss things in review, but I didn't catch anything. Tried to interact with all the pieces in the UI.

Nice job with the refactor!

Copy link
Contributor

@frasercl frasercl left a comment

Choose a reason for hiding this comment

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

This looks like a lot of work and is overall a massive improvement - thank you for doing it! Realizing looking back that I left a lot of comments... but that's only down to the size of this PR. They're mostly minor polish, and none are blocking.

src/components/GalleryCard/index.tsx Outdated Show resolved Hide resolved
<Button icon="download" />
<Tooltip key={`${props.cellID}-download`} title={hasDownload ? null : NO_DOWNLOADS_TOOLTIP}>
<Dropdown menu={{ items: menuItems }} trigger={["click"]}>
<Button className={hasDownload ? "" : styles.disabled}>
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious: was this disabled behavior just not working before, or is this a class that antd 3 used to apply that our code now applies itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Disabled styling doesn't seem to have worked very well before. I ended up removing the disabled behavior from the 3D view button, and fixing the Dropdown to work correctly as a disabled component.

src/components/LandingPage/style.css Outdated Show resolved Hide resolved
Comment on lines +8 to +9
const MouseFollower = React.forwardRef<HTMLDivElement, React.PropsWithChildren<MouseFollowerProps>>(
(props, ref) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat!

src/components/SliderWithCustomMarks/index.tsx Outdated Show resolved Hide resolved
src/containers/Cfe/index.tsx Outdated Show resolved Hide resolved
src/containers/Cfe/index.tsx Outdated Show resolved Hide resolved
src/containers/Cfe/style.css Outdated Show resolved Hide resolved
src/containers/MainPlotContainer/index.tsx Outdated Show resolved Hide resolved
src/containers/ThumbnailGallery/index.tsx Outdated Show resolved Hide resolved
ShrimpCryptid added a commit that referenced this pull request Jun 18, 2024
- Updates web-3d-viewer to version 2.9.0.
- Updates the API for the web-3d-viewer.
- Fixes some broken styling caused by Ant version mismatch. (Will be removed in #166.)

Full changes:
* fix: Changed props for ImageViewerApp to match new w3cv API

* refactor: Upgrade web-3d-viewer to 2.9.0

* fix: Fix styling on channel settings tab due to ant version or font

* fix:  Fixed missing ant drawer

* fix: Icons in toolbar were off-center

* fix: Missing type declaration in tests

* test: Update CI action to node v20

* test: Import type declarations

* test: Use original type declaration import, change CI action ordering

* fix: Fixed build issues caused by local w3cv project instance being included in package-lock.json
Base automatically changed from feat/upgrade-w3cv to main June 18, 2024 16:19
@ShrimpCryptid ShrimpCryptid merged commit 65d2ecf into main Jun 18, 2024
1 check passed
@ShrimpCryptid ShrimpCryptid deleted the feat/upgrade-ant branch June 18, 2024 16:32
ShrimpCryptid added a commit that referenced this pull request Sep 24, 2024
- Removes old Less styling rules and replaces it with Ant's new `ConfigProvider` model.
- Fixed an existing bug where, on narrow screens, parts of the Gallery could not be interacted with.
- Fixed an existing bug where a gap would appear next to the main plot view.
- Fixes a list of roughly 50 UI-related issues, as noted in #165.

Full changes:
* fix: Changed props for ImageViewerApp to match new w3cv API

* refactor: Upgrade web-3d-viewer to 2.9.0

* fix: Fix styling on channel settings tab due to ant version or font

* fix:  Fixed missing ant drawer

* fix: Icons in toolbar were off-center

* fix: Missing type declaration in tests

* test: Update CI action to node v20

* test: Import type declarations

* test: Use original type declaration import, change CI action ordering

* fix: Fixed build issues caused by local w3cv project instance being included in package-lock.json

* refactor: Upgrade to Ant ^5.16.2, fix compile issues

* fix: Removed unsupported babel plugin

* fix: Text colors, title colors, header font weight

* fix: Page background color, link color

* fix: Header alignment

* fix: Button colors and shadows, landing page text size

* fix: Title color, paragraph padding, table margins

* fix: Bad colon alignment on dataset descriptions

* fix: Layout issues on viewer page

* fix: Loading spinner color

* fix: Header colors, alignment

* feat: Increased tab icon sizes, alignment fixes

* refactor: Make palette colors a constant

* fix: Fixed overlap of viewer title and menu tab buttons

* fix: Header menu tab styling

* fix: Incorrect font in cookie banner

* fix: Sider background colors

* fix: Card action formatting

* fix: Gallery background width, transparency

* fix: Button and icon styling on gallery sidebar

* fix: Action list on button icons

* fix: Menu header being the incorrect height

* fix: Album list hover and selection colors

* fix: Removed extra margin at bottom of page caused by gallery sider

* fix: Unclickable gallery close button, searchbar overlapping scrollbar

* fix: Removed deprecated properties on menus, modals, and dropdowns

* fix: Checkbox colors

* fix: Fixed 3d viewer and plot extending into gallery sider

* fix: Close button on selected set

* fix: Album text alignment

* fix: Popconfirm background color, removed button shadows

* fix: Axis dropdown not changing on selection, showing keys instead of names on dropdown

* feat: Adjusted selected set delete button style

* fix: Style matching on thumbnail popover

* fix: Popover now follows mouse

* refactor: Deleted unused style CSS

* feat: Adjusted margin on gallery buttons

* fix: Gallery card button spacing, fixed download dropdown

* fix: Dropdowns extending up into header and being unclickable

* fix: Temporarily fixed dropdowns by overriding width

* fix: Linting

* refactor: Restored .gitkeep

* refactor: Import sorting, renamed variables

* refactor: Palette now has base colors to prevent reused strings

* refactor: Code cleanup, increased tab icon size

* fix: Alignment of 3d viewer text, increased plot height

* fix: Dropdown arrow color, dropdown width

* fix: Alignment on gallery header

* refactor: Removed style overrides for CellViewer

* refactor: Removed unused less dependencies

* refactor: Removed additional unused dependencies

* refactor: Sorted imports, moved CSS

* refactor: Moved imports, prevented theme re-calculation

* refactor: Use single JSX tag instead of opening + closing tags

Co-authored-by: Cameron Fraser <53030214+frasercl@users.noreply.github.com>

* refactor: More import sorting, removed unused CSS

* fix: Disabled button styling in Gallery view

* fix: Linting

---------

Co-authored-by: Cameron Fraser <53030214+frasercl@users.noreply.github.com>

refactor: Upgrade web-3d-viewer to 2.9.0

fix: Fix styling on channel settings tab due to ant version or font

fix: Icons in toolbar were off-center

fix: Missing type declaration in tests

test: Update CI action to node v20

test: Import type declarations

test: Use original type declaration import, change CI action ordering

fix: Fixed build issues caused by local w3cv project instance being included in package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Ant Design v5
3 participants