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

Bug/WP-782: Resized View Full Path link in modals #1036

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jmcmillenmusic
Copy link
Collaborator

@jmcmillenmusic jmcmillenmusic commented Dec 12, 2024

Overview

The "View Full Path" links in modals is now too big compared to the rest of the text in the modal.

Related

Changes

I added a modalButton style to the "View Full Path" links and used CSS to reduce its size.

Testing

  1. Log in to cep.test/workbench.
  2. Select a file and click on either Move or Copy.
  3. Note that "View Full Path" is now more appropriately-sized.

UI

As of a9c89af
WP-782 WP-50
PR 1036 WP-50 PR 1036 WP-782
As of 7778ead

image

Notes

@wesleyboar updated UI after a9c89af.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.17%. Comparing base (928dc75) to head (a9c89af).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1036      +/-   ##
==========================================
+ Coverage   72.50%   75.17%   +2.66%     
==========================================
  Files         534      323     -211     
  Lines       33771    27486    -6285     
  Branches     2993     2263     -730     
==========================================
- Hits        24487    20663    -3824     
+ Misses       9086     6785    -2301     
+ Partials      198       38     -160     
Flag Coverage Δ
javascript 75.17% <ø> (ø)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 211 files with indirect coverage changes

Copy link
Collaborator

@chandra-tacc chandra-tacc left a comment

Choose a reason for hiding this comment

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

This did not just change in portals, but also changed in the data files page

Screenshot 2024-12-16 at 1 22 12 PM

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

Now that I have context (your answer, this PR, WP-782, and WP-50), I can offer better guidance.

The Goal

Change the font size of some [type="link"]/.as-link buttons, but not all; while not changing the font size of all buttons in a modal (i.e. modalButton), cuz some buttons should have the standard size (e.g. the [Modal] and [Copy] buttons).

Proposal

Do not extend <Button>. Add style in appropriate component's stylesheet. New fix needed for WP-50.

Details & Video for WP-782

  1. Do not add modalButton. Do not add styles in <Button>.1
  2. Move existing font-size style in DataFilesModals.scss from .dataFilesModal .breadcrumbs to .dataFilesModal .breadcrumbs-container.
    Please use 1.2rem.
WP-782.mov
Why?
  1. The font size of as-link should inherit the font-size of it's parent, because it replicates a <a> which would normally inherit the font-size of it's parent.2
  2. If the breadcrumbs and the breadcrumbs button should be the same font size3 then set the font size on an ancestor element.

Details & Video for WP-50 (#986)

  1. Change .root.as-link { font-size: 1rem } to font-size: inherit.
  2. Add new style to CombinedBreadcrumbs.module.scss as
    .combined-breadcrumbs .breadcrumb-container button {
        font-size: 1rem;
    }
WP-50.mov
Why?
  1. The font size of as-link should, by default, inherit the font-size of it's parent, because it replicates a <a> which would normally inherit the font-size of it's parent.2
  2. Based on context, the style needed is specific to the component, <CombinedBreadcrumbs>, because it can style <DataFilesBreadcrumbs> without affecting modal instances of it. <CombinedBreadcrumbs> is not designed to add a class to a child component, but CombinedBreadcrumbs.module.scss can target an element (button) within a native/global class (breadcrumb-container).

Footnotes

The footnotes are for content hidden in details sections, i.e. "▸ Details & Video for …" and the "▸ Why?" within each. Click the triangle to open.

Footnotes

  1. I appreciate your effort to extend <Button>, but I don't yet believe this is a use case to do so.

  2. "Buttons as links should be same font-size as a regular link text would be in that same location. […] So, if a regular link would be 16px in a location, then a button as link in that location should be 16px." — me answering you in #design channel thread. 2

  3. …and other children do not exist or other children would not need larger font size yet inherit from parent…

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

I added videos to #1036 (review).

@jmcmillenmusic
Copy link
Collaborator Author

This did not just change in portals, but also changed in the data files page

My most recent push (with Wes' help) has fixed this.

@jmcmillenmusic
Copy link
Collaborator Author

I added videos to #1036 (review).

Huge thank you for this! I would not have thought to look in the files you referenced. I greatly appreciate it.

@wesleyboar
Copy link
Member

wesleyboar commented Dec 18, 2024

@jmcmillenmusic, You're welcome. I also would not have thought to work in those files.

I found them to be suitable only because I thought to search which React components include import the components that are adding the buttons in question, and which are not. For me, learning where in the codebase a component is used to be key to understanding where styles can be applied effectively.

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

Code changes look as expected. I have not re-tested yet.

@wesleyboar wesleyboar self-requested a review December 19, 2024 20:52
Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

Mistakes. Some mine. I'll fix and test. Hold on a sec.

@wesleyboar wesleyboar self-requested a review December 20, 2024 17:57
Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

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

Works.

WP-782 WP-50
PR 1036 WP-50 PR 1036 WP-782

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.

3 participants