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

closes #2288: rework workspace type selection dialog #2352

Merged
merged 19 commits into from
Apr 16, 2019

Conversation

glefi
Copy link
Collaborator

@glefi glefi commented Apr 1, 2019

@ggeisler The ListItemText component provides the possibility to define a primary and a secondary text, that I used. I'm not sure, if the resulting text formatting matches the desired one.
@jvine Could you attach the workspace type thumbs? I've added some placeholders for now.

@ggeisler
Copy link
Collaborator

ggeisler commented Apr 1, 2019

@glefi Thanks for checking. As I mentioned in #2288, the typography for those elements should be styled as an H3 (the label of the workspace type; but leave the element as is; don't make it an <h3 />) and Body1 (the text description of each type). See the typography details for those ("Headline 3" and "Body 1") here: #2093

If you update those elements to match the typographic specifications in #2093, plus update the dialog header to be an H2, the result should look similar to this:

workspace-type-dialog

By the way, the mouse selection looks good (highlighting and cursor) but I notice I can't use the dialog with the keyboard. But I know this is WIP so you might not have gotten to that yet.

@glefi glefi force-pushed the 2288-update-the-select-workspace-type-dialog branch from 95ae7a4 to 837a98b Compare April 2, 2019 12:34
@codecov-io
Copy link

codecov-io commented Apr 2, 2019

Codecov Report

Merging #2352 into master will decrease coverage by 0.21%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2352      +/-   ##
==========================================
- Coverage   92.71%   92.49%   -0.22%     
==========================================
  Files         135      137       +2     
  Lines        1852     1852              
==========================================
- Hits         1717     1713       -4     
- Misses        135      139       +4
Impacted Files Coverage Δ
src/components/icons/WorkspaceTypeMosaicIcon.js 0% <0%> (ø)
src/lib/ListKeyboardNavigation.js 94.73% <0%> (ø) ⬆️
src/components/icons/WorkspaceTypeElasticIcon.js 0% <0%> (ø)
src/components/WindowSideBarButtons.js 97.56% <100%> (-0.12%) ⬇️
src/components/WorkspaceSelectionDialog.js 66.66% <100%> (-22.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e408be...a50ad21. Read the comment docs.

@glefi
Copy link
Collaborator Author

glefi commented Apr 2, 2019

@ggeisler I've changed the text formatting according to the typographic specifications and the keyboard navigation works now, too. But now the required height of the text elements is slightly higher than 100px, maybe we should increase the image height, what do you think?

@glefi glefi changed the title [WIP] #2287: rework workspace type selection dialog closes #2287: rework workspace type selection dialog Apr 2, 2019
container={container}
id="workspace-settings"
onClose={handleClose}
onKeyDown={event => this.keyDownHandler(event)}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know if it's common, to set the keyDownListener to the hosting node, but I thought, especially when there will be more workspaceTypes perhaps in the future, we could save some locs this way.

}

/** */
selectPreviousItem() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A simple toggling function would have been sufficient here, but I tried to be prepared for some additional workspaceTypes that may come in the future.

@ggeisler
Copy link
Collaborator

ggeisler commented Apr 2, 2019

But now the required height of the text elements is slightly higher than 100px, maybe we should increase the image height, what do you think?

@glefi Sure, assuming you only need to make the images a little bit taller (110 or 120px?) that sounds fine.

This is looking good but a couple things I noticed (in case you aren't aware):

  • When I switch to elastic mode (using the mouse) and then choose the workspace type menu item again, the dialog shows the selected mode is Mosaic, when it should reflect that I am currently in Elastic:

Screen Shot 2019-04-02 at 9 56 41 AM

This actually works correctly when using the keyboard (nice work on getting the keyboard nav working!) but compare the difference when using the mouse.

  • The color of the text for the workspace type description <p />s is a gray (I think coming from .jss381 or the simple dialog default styles) but it should be our default color (I think the color in .jss357 that is overriden by .jss381). Otherwise, the color contrast when the item is selected is not accessible.

@glefi glefi changed the title closes #2287: rework workspace type selection dialog closes #2288: rework workspace type selection dialog Apr 3, 2019
@glefi glefi changed the title closes #2288: rework workspace type selection dialog [WIP] #2288: rework workspace type selection dialog Apr 3, 2019
@glefi glefi force-pushed the 2288-update-the-select-workspace-type-dialog branch from 514bd95 to 99947ef Compare April 8, 2019 10:32
@glefi glefi changed the title [WIP] #2288: rework workspace type selection dialog closes #2288: rework workspace type selection dialog Apr 8, 2019
@camillevilla camillevilla requested a review from ggeisler April 10, 2019 15:05
Copy link
Collaborator

@ggeisler ggeisler left a comment

Choose a reason for hiding this comment

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

@glefi This is getting closer but I think we need further work to get it to look right:

Images

It's great to see the SVGs in there but something isn't right about the sizing. These SVGs have a native aspect ratio of 4:3 (e.g., 160px wide by 120px high) but what I see in the app is almost square (from the web inspector it seems that they are sized 126px wide by 120px high), which distorts the image. It looks like you have defined the width and height to be 160x120 but for some reason that is not what is being rendered.

I know we previously discussed making the images taller, but aside from the aspect ratio problem, I think the images and entire rows for the two options are bigger than they need to be. So I suggest:

  • Make the images 90px in height
  • Make sure the images have the correct aspect ratio of 4:3

Option heading typography

The "Elastic" and "Mosaic" headings are using an H2 element. In the ticket specifications for this I suggested the headings be:

styled using the H3 typography, but don't use a heading element

I think we should stick to that because these are not structural elements that we want to appear in a list of headings read by a screenreader, for example. So we want them to use a non-heading element (I think a p would work) but then apply the H3 typography styling to them so they appear visually similar to an H3. I don't know how we do that, but I think others on the team have applied a typographical style to change an element from its default typographical styling.

@glefi glefi force-pushed the 2288-update-the-select-workspace-type-dialog branch from 153f472 to dd2ce46 Compare April 11, 2019 07:46
@glefi glefi requested a review from ggeisler April 11, 2019 07:52
Copy link
Collaborator

@ggeisler ggeisler left a comment

Choose a reason for hiding this comment

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

Nice @glefi, the SVGs look great now. I have three more suggestions, which are minor spacing-related suggestions. It looks good overall but I think the spacing should be a bit tighter. I assume you can make these adjustments just to this dialog and these won't affect anything more globally, but let me know if that is not the case.

The first two suggestions are to reduce the vertical padding on the div that contains the option title and description text. They are both to the .jss514 class as shown in the screenshot below.

  • Add 0 for the top/bottom padding of .jss514.
  • Reduce the .jss514:last-child padding-bottom to 12px (from 24px)

Screen Shot 2019-04-11 at 9 22 14 AM

The other suggestion is to add a new padding-bottom: 0; to .jss328, the p that contains the option titles. That will just provide a bit of vertical space between the option title and its description text and better distinguish the option title from the description.

Screen Shot 2019-04-11 at 9 25 08 AM

@glefi glefi force-pushed the 2288-update-the-select-workspace-type-dialog branch from dd2ce46 to b2239ef Compare April 12, 2019 08:12
@glefi
Copy link
Collaborator Author

glefi commented Apr 12, 2019

@ggeisler Thanks for your feedback. I've added your suggestions to the pr. What do you think about it?

ggeisler
ggeisler previously approved these changes Apr 12, 2019
@ggeisler
Copy link
Collaborator

Looks good @glefi!

<Card className={classes.card}>
<CardMedia
className={classes.media}
image="/src/images/icon_workspace_elastic.svg"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm concerned that referencing the image this way will hardcode the image path (and its not included in the build). Is there a way to reference the SVG directly?

Copy link
Member

Choose a reason for hiding this comment

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

@mejackreed Do we have a pattern established for this anywhere else in the repo?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I think the predominate pattern is to wrap the SVG in a component like we do with the icons:

https://github.com/ProjectMirador/mirador/blob/master/src/components/icons/BookViewIcon.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ggeisler Could you provide the two SVGs in a scaled variant (90x120)? Because resizing the files with inkscape seems not to work properly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@glefi glefi force-pushed the 2288-update-the-select-workspace-type-dialog branch from 6296487 to a50ad21 Compare April 16, 2019 13:07
Copy link
Collaborator

@mejackreed mejackreed left a comment

Choose a reason for hiding this comment

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

Looks good @glefi .. thanks for getting this fixed up!

} = this.props;
return (
<Dialog
aria-labelledby="workspace-selection-dialog-title"
container={container}
id="workspace-settings"
id="workspace-selection-dialog"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like how you renamed this to be more accurate

@mejackreed mejackreed merged commit 8ec919d into master Apr 16, 2019
@mejackreed mejackreed deleted the 2288-update-the-select-workspace-type-dialog branch April 16, 2019 14:31
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.

5 participants