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

EDSC-4421: Fixing styling discrepancies from bootstrap upgrade #1870

Merged
merged 8 commits into from
Feb 28, 2025
Merged

Conversation

dpesall
Copy link
Member

@dpesall dpesall commented Feb 26, 2025

Overview

What is the feature?

Fixing some minor styling errors that resulted from upgrading our version of bootstrap.

What is the Solution?

  • Corrected alignment of subscription action buttons
  • Added ellipses to facets which are cut off due to long names
  • Corrected font size for Additional Filters text to prevent wrapping
  • Fixed x button on Shape File modal

What areas of the application does this impact?

  • EDSC Home Page
  • Shape File Modal
  • Subscriptions Page

Testing

Reproduction steps

  1. Navigate to EDSC home page
  2. Verify that the visuals changed in this ticket have been corrected
  3. Create a subscription
  4. Navigate to Subscriptions page
  5. Verify that the action buttons are aligned properly

Attachments

Screenshot 2025-02-26 at 2 14 56 PM
Screenshot 2025-02-26 at 2 15 15 PM
Screenshot 2025-02-26 at 2 16 23 PM

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

github-actions bot commented Feb 26, 2025

Bundle Size Comparison

Full build details

> earthdata-search@1.0.0 build
> vite build

vite v5.4.14 building for production...
transforming...
✓ 3968 modules transformed.
rendering chunks...
computing gzip size...
static/dist/assets/logo-Bbl3mFh1.png                                      4.74 kB
static/dist/assets/spritesheet-DpIxuf5L.svg                               5.55 kB │ gzip:   1.67 kB
static/dist/assets/orange-bars-circle-Dv91mTXe.png                        6.21 kB
static/dist/assets/logo-Caj-8pKX.png                                     10.40 kB
static/dist/index.html                                                   11.92 kB │ gzip:   2.77 kB
static/dist/assets/logo-B0XgzUx6.png                                     16.71 kB
static/dist/assets/blue-bars-circle-BnwbAiRm.png                         17.43 kB
static/dist/assets/logo-DJkM1oZm.png                                     18.46 kB
static/dist/assets/logo-DV4XbSnR.png                                     19.40 kB
static/dist/assets/logo-BzPAKkwn.png                                     19.52 kB
static/dist/assets/logo-CiiGKrme.png                                     22.18 kB
static/dist/assets/logo-9zKL5_dX.png                                     26.10 kB
static/dist/assets/logo-BQ2w-_9p.png                                     37.37 kB
static/dist/assets/plate_carree_earth_scaled@2x-BIj0Wstc.png             45.03 kB
static/dist/assets/image-unavailable-CcXgOtQr.svg                        52.20 kB │ gzip:  20.77 kB
static/dist/assets/logo-Dcyqcuvp.png                                     85.17 kB
static/dist/assets/logo-ypkTnNcY.png                                    116.54 kB
static/dist/assets/logo-CeuXi2Mj.png                                    140.06 kB
static/dist/assets/tour-video-thumbnail-Dp_EYCVz.png                    163.50 kB
static/dist/assets/earthdata-search-og-image-NnlQJae1.jpg               669.27 kB
static/dist/assets/Preferences-CYv3T8NS.css                               0.17 kB │ gzip:   0.15 kB
static/dist/assets/Card-4Z2ojUmq.css                                      0.24 kB │ gzip:   0.14 kB
static/dist/assets/ContactInfo-C7Pr11wu.css                               0.28 kB │ gzip:   0.18 kB
static/dist/assets/GranuleFiltersContainer-CfwvM6Mp.css                   0.59 kB │ gzip:   0.27 kB
static/dist/assets/PreferencesForm-CNfW6AJC.css                           0.67 kB │ gzip:   0.24 kB
static/dist/assets/TextWindowActions-DJ3-SObR.css                         0.85 kB │ gzip:   0.37 kB
static/dist/assets/Subscriptions-whcrpTXZ.css                             1.20 kB │ gzip:   0.38 kB
static/dist/assets/CollectionDetailsHighlightsContainer-CHDYEfjF.css      1.24 kB │ gzip:   0.44 kB
static/dist/assets/GranuleResultsHighlightsContainer-BIY0O9bb.css         1.24 kB │ gzip:   0.41 kB
static/dist/assets/EchoForm-VVUehB8V.css                                  3.47 kB │ gzip:   1.06 kB
static/dist/assets/CollectionDetailsBody-D5LlDVAO.css                     6.14 kB │ gzip:   1.32 kB
static/dist/assets/Downloads-DqmON7i8.css                                 8.86 kB │ gzip:   2.02 kB
static/dist/assets/Admin-DUdnaYcU.css                                    12.81 kB │ gzip:   2.12 kB
static/dist/assets/Project-D_Afhulk.css                                  20.31 kB │ gzip:   4.10 kB
static/dist/assets/MapContainer-D2CnnjkY.css                             31.20 kB │ gzip:  13.66 kB
static/dist/assets/index-C9u0FVkg.css                                   421.71 kB │ gzip: 124.50 kB
static/dist/assets/logo-kIfxR0kt.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-wNST2Htl.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-CCmqYjka.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-DrPA0kJR.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-Ckt66ggc.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-B3er5AlO.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-BWTFBqRn.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-BPTx5Aq2.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-Ci-dnVwS.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-Bw50Xt1w.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-DWpcBQbn.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-BVv-1ePi.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-DJCGC4Zf.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-Bf2AJzFF.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-BcKojMYq.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-D7UOcUuS.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/logo-BE1QrLrG.js                                       0.06 kB │ gzip:   0.08 kB
static/dist/assets/Table-DzS-EoGZ.js                                      0.54 kB │ gzip:   0.35 kB
static/dist/assets/index-DnKD4f7v.js                                      0.77 kB │ gzip:   0.38 kB
static/dist/assets/RelatedCollection-B9TWRSGp.js                          1.00 kB │ gzip:   0.52 kB
static/dist/assets/logo-CxSOswgE.js                                       3.08 kB │ gzip:   2.37 kB
static/dist/assets/Preferences-Dpye8-hG.js                                4.32 kB │ gzip:   0.87 kB
static/dist/assets/EarthdataDownloadRedirect-Du_wZcOY.js                  6.12 kB │ gzip:   1.12 kB
static/dist/assets/Card-BivE0MOo.js                                       6.25 kB │ gzip:   2.02 kB
static/dist/assets/GranuleResultsHighlightsContainer-C0GTO85e.js          8.53 kB │ gzip:   1.55 kB
static/dist/assets/CollectionDetailsHighlightsContainer-Dlfs4LN1.js      10.81 kB │ gzip:   1.38 kB
static/dist/assets/ContactInfo-NQqscSD0.js                               14.09 kB │ gzip:   1.93 kB
static/dist/assets/Subscriptions-DGHE5CFO.js                             14.30 kB │ gzip:   2.15 kB
static/dist/assets/index-H_Ai5FZA.js                                     15.10 kB │ gzip:   6.28 kB
static/dist/assets/GranuleFiltersContainer-DIgiQCUF.js                   39.52 kB │ gzip:   6.47 kB
static/dist/assets/CollectionDetailsBody-S9HddU5d.js                     46.06 kB │ gzip:   5.82 kB
static/dist/assets/Downloads-BJX300fK.js                                 94.50 kB │ gzip:  15.61 kB
static/dist/assets/Admin-RaYzhHN1.js                                    104.98 kB │ gzip:  18.79 kB
static/dist/assets/EchoForm-iDBOP7SZ.js                                 108.91 kB │ gzip:  33.70 kB
static/dist/assets/MapContainer-ChM1W9Rc.js                             203.20 kB │ gzip:  58.81 kB
static/dist/assets/crs-BSc8tSFl.js                                      251.80 kB │ gzip:  78.16 kB
static/dist/assets/PreferencesForm-BpD7xbpA.js                          327.72 kB │ gzip: 101.19 kB
static/dist/assets/Project-DrhmY20E.js                                  398.32 kB │ gzip: 118.04 kB
static/dist/assets/index-rQgJfwYP.js                                  3,733.14 kB │ gzip: 990.85 kB
✓ built in 35.79s

The full bundle is larger than main by 0.2 kB. ❗

The index.js is smaller than main by 0 kB. 🎉

Run npx vite-bundle-visualizer to review the bundle in more detail.

File Main Branch Diff
Total 7392.62 kB 7392.82 kB 0.2 kB
index.js 3749.01 kB 3749.01 kB 0 kB
index.js (gzip) 997.51 kB 997.51 kB 0 kB
index.css 421.66 kB 421.71 kB 0.05 kB
index.css (gzip) 124.5 kB 124.5 kB 0 kB
Number of files 75 75 0
Build Time 35.4 s 35.79 s 0.39 s

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.42%. Comparing base (adef724) to head (ca118af).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1870   +/-   ##
=======================================
  Coverage   93.42%   93.42%           
=======================================
  Files         781      781           
  Lines       19167    19167           
  Branches     4970     4969    -1     
=======================================
  Hits        17906    17906           
+ Misses       1206     1176   -30     
- Partials       55       85   +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -26,6 +26,10 @@
margin-right: calc(bootstrap.$spacer / 2);
}

.btn-close {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this change. this should be core functionality of react-bootstrap, what are we doing to break it?

Copy link
Member Author

Choose a reason for hiding this comment

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

From what I could find, the bootstrap upgrade likely changed how the close button is positioned within the stacking context which caused this issue. Why it's only on this modal, I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

When we upgraded bootstrap, in the EDSCModal we changed from rendering our own close button to using the react-bootstrap closeButton prop. It looks like we already used that prop on ShapefileUploadModal before the upgrade.

react-bootstrap docs specify that onHide is called when the closeButton is clicked, so we are doing something that breaks that base functionality. The fix for that shouldn't be to override the library's styles, we should find what we are doing to break it and fix that.

Copy link
Contributor

@macrouch macrouch left a comment

Choose a reason for hiding this comment

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

I was able to get the facet length issue fixed with only including overflow: hidden; to FacetsItem.scss on &__title-container. I didn't need to change any min/max-width values

I was able to fix the sidebar filter wrapping text with only adding font-size: 0.825rem; to SidebarFiltersItem.scss on &__body

Using &__header is definitely better than using .btn-close in ShapefileUploadModal.scss. The probem/difference with the Shapefile modal and EDSCModal seems to be the &:before css where we are putting a dashed border inset on the modal.

I was able to fix the Subscription list icon alignment by adding the class align-middle to the EDSCIcon call on line 116 of SubscriptionsListTable.jsx

@@ -13,6 +13,11 @@

&__actions {
text-align: center;
div {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to avoid doing nested selectors if we can. If you cant avoid nesting then maybe theres a class you can use instead of an element selector.

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't need this at all with the addition of the align-middle bootstrap class in SubscriptionListTable.jsx

@trevorlang
Copy link
Collaborator

I was able to get the facet length issue fixed with only including overflow: hidden; to FacetsItem.scss on &__title-container. I didn't need to change any min/max-width values

I was able to fix the sidebar filter wrapping text with only adding font-size: 0.825rem; to SidebarFiltersItem.scss on &__body

Using &__header is definitely better than using .btn-close in ShapefileUploadModal.scss. The probem/difference with the Shapefile modal and EDSCModal seems to be the &:before css where we are putting a dashed border inset on the modal.

I was able to fix the Subscription list icon alignment by adding the class align-middle to the EDSCIcon call on line 116 of SubscriptionsListTable.jsx

I agree with matthew. I noticed that this is using the bootstrap Modal directly and not using our EDSCModalContainer, maybe swapping it over would fix the issue...

Comment on lines 29 to 32
&__header {
z-index: 0;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
&__header {
z-index: 0;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dpesall / @eudoroolivares2016, I played around with this and a better way to fix it would be to add the following in the &:before on line 37

&:before {
    ...
    user-select: none;

    .is-dragging & {
        ....
    }
}

This will prevent that pseudo element from intercepting the click events 😄

@dpesall dpesall merged commit 9a21e16 into main Feb 28, 2025
15 checks passed
@dpesall dpesall deleted the EDSC-4421 branch February 28, 2025 22:02
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.

4 participants