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

[WIP] [Don't Merge] Utilize frontend-component-header for studio header #69

Conversation

brian-smith-tcril
Copy link
Contributor

@brian-smith-tcril brian-smith-tcril commented Sep 27, 2022

This PR is a work in progress

todo list

  • use helper classes instead of making new ones where possible/appropriate

Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Excellent work, @brian-smith-tcril! I totally approve of the direction: I find the whole thing to be much more pleasant to navigate. To be perfectly honest, modulo removal of some commented code and a couple of console issues, I would consider this to be Almost Done ™️. Congrats!

Btw, I think it's a good idea to consolidate commits somewhat before merging. I'll leave it to you to pick locus themes.

Another note: there are some feature flag-hidden UI elements to this MFE that I haven't tested, yet, but since I know for a fact the underlying feature I'm thinking of is not actually working at the moment (LTI 1.3 support), I'll leave that to yet another issue to put in the backlog.

@@ -37,8 +37,9 @@
"dependencies": {
"@edx/brand": "npm:@edx/brand-openedx@1.1.0",
"@edx/frontend-component-footer": "10.2.1",
"@edx/frontend-platform": "1.15.2",
"@edx/paragon": "19.25.3",
"@edx/frontend-component-header": "github:brian-smith-tcril/frontend-component-header#studio-header-for-prs",
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this. Makes it much easier to test.

Do you mind making a PR out of the frontend-component-header changes, though? However WIP it still is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent, thank you!

<div className="wrapper">
<StudioHeader />
<main>
{/* todo: look for a better way to do this, using these routes in
Copy link
Contributor

Choose a reason for hiding this comment

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

Interested in hearing suggestions for alternatives. I assume you're wrapping StudioHeaderWrapper in the Switch in order to clear the component's state? when on the home page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my main issue with this implementation is having multiple route switches in the index.jsx file here

i did add it in f934987 to clear the state (since loadingStatus would stay loaded when navigating back to the list page)

i was hoping i'd have some better ideas by now, but nothing is coming to mind

Copy link
Contributor

Choose a reason for hiding this comment

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

For what it's worth, it seems to me like a legitimate use of Switch, and a reasonable place to put it in. 🤷🏼

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good, i'll remove the todo

src/index.scss Outdated
@import '~@edx/frontend-component-footer/dist/footer';

@import 'vendor/normalize.css';
@import 'vendor/studio.scss';
@import 'vendor/overrides.scss';

@import './library-authoring/index.scss';

// Breadcrumbs
// todo: figure out why this var isn't working (and change it to a reasonable value)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we figured it out, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup! removed in brian-smith-tcril@f048454

edit: actually removed in 79fb801

<Button variant="success" className="mr-1" size="lg" disabled={sending} onClick={quickAddBehavior}>
{/* todo: either reimplement the scroll to the add components button functionality,
figure out a better UX for the add component button at the top, or just
remove it entirely */}
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you remove it as a UX consideration, or just to simplify the refactor temporarily?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from a UX stand point i think that button was bad. i'm perfectly happy with the solution being "just have the add component buttons at the bottom", but i can see how needing to scroll through a long list of blocks to get there could be frustrating.

i don't think having a "scroll me to the bottom" button labeled as a "add component" makes much sense

i guess my general UX feeling tl;dr here is: either we should:

  • only have the buttons on bottom
    OR
  • only have a button on top (just move the existing bottom buttons functionality into a dropdown on top)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with getting rid of the button, for now. In the end it won't be a decision to make on our own, but we can always add the button back if somebody complains.

(What will eventually happen, I expect, is that this page will suffer a major UX overhaul. Whoever develops the changes will likely get handed down a full design document.)

</ActionRow>
{/* todo: figure out how we want to handle these at low screen widths.
mobile is currently unsupported: so it doesn't make sense
to have partially implemented responsive logic */}
Copy link
Contributor

Choose a reason for hiding this comment

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

+1. As we discussed previously, mobile is not currently a priority for Studio-like MFEs such as this one.

// <span className="value">{new Date(task.created_at).toLocaleString()}</span>
// </span>
// </div>
// </div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to remove the reference material :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 42c82d4

<div className="wrapper-mast wrapper">
{/* todo: figure out what we want here, the header text always says "Component", and the
"back to library" button is redundant considering the header link with the
library name goes back to the library */}
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. I think it's fine to get rid of the redundancy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// font-size: 1.4rem;
// }
// }
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to get rid of the saved reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 42c82d4

<Link
className='content-title-block'
to={destination}
aria-label={ariaLabel}
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for sticking with a11y. 👍🏼

(Disclaimer: I'm not doing a proper accessibility review here. This is going to be the topic of a separate discussion. Simply using more Paragon helps a lot, though.)


// todo: probably want to move this to the header component
// but for now i'm just making changes here so the logos in
// the header and the footer line up at every viewport width
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we definitely want to move stuff off of vendor. We can leave that for the next issue to tackle: #72

@arbrandes
Copy link
Contributor

Two things I forgot to note above:

  • I tested everything I could and things Just Worked (kudos!)
  • We'll also want to fix the linting issues prior to merging, of course

<Card.Header
className='library-authoring-block-card-header'
title={block.display_name}
// subtitle={library.blockTypes.find(bt => bt.block_type == block.block_type).display_name}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arbrandes this is a leftover from a thought i had about including the block type in the cards as the subtitle

i think it could be a nice addition, but it didn't exist before, maybe it's worth making an issue on the repo for?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is one of those things that will have to be brought up in a UX/Design discussion with stakeholders. For now, I think the best place to keep track of these ideas is in issues in this repository: either all of them in a single one, or tracking them separately (but as subtasks of another).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<h1 className="page-header">{library.title}</h1>
</div>
<ActionRow.Spacer />
{/* todo: hide/show previews seems odd where it is right now, maybe change that? */}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this todo is putting it lightly, having a global show/hide previews button has caused the tab to crash for me when enabling all the previews at once and scrolling around.

i'm not sure if there's a good way to address that issue without any UX changes, and i'd be very happy if we could move to a "show preview per block" UX instead

Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned above, let's track this. It's definitely worth its own issue, since it has clear adverse effects - even if it's not the easiest to reproduce.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

)}
<Link to={editView}>
<Button size="lg" className="mr-1">
<Card className='w-auto m-2'>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

using m-2 here makes it feel a little cramped on the list in my opinion, but adding mb-3 makes it feel a little too spaced out. i prefer m-2, and i'd rather stick to using bootstrap helper classes for this if possible

Copy link
Contributor

Choose a reason for hiding this comment

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

No objections at all.

Comment on lines +12 to +17
.library-authoring-sidebar {
font-size: 90%;
h3 {
font-size: 100%;
font-weight: bold;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tried using fs-* helper classes but those might be only available in a newer version of bootstrap? keeping this class for now

Comment on lines 106 to 123
{/* todo: figure out if we want this, we already have the "New Team Member" button at the top, having a
"Add User" button with identical functionality feels redundant */}
{/* {isAdmin && (
<div className="well mt-3">
<Row className="h-100">
<Col xs={12} md={8} className="my-auto">
<h2 className="h2 font-weight-bold">{intl.formatMessage(messages['library.access.well.title'])}</h2>
<p>{intl.formatMessage(messages['library.access.well.text'])}</p>
</Col>
<Col xs={12} md={4} lg={3} className="my-auto offset-lg-1 text-center text-md-right">
<Button variant="success" size="lg" onClick={() => setShowAdd(true)}>
<FontAwesomeIcon icon={faPlus} className="pr-1 icon-inline" />
<strong>{intl.formatMessage(messages['library.access.well.button'])}</strong>
</Button>
</Col>
</Row>
</div>
)} */}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'd like to just remove this because of redundancy, is that cool?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please do! I know for a fact this page was whipped up with no UX supervision, so we have some leeway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed in e38d674

@@ -37,8 +37,9 @@
"dependencies": {
"@edx/brand": "npm:@edx/brand-openedx@1.1.0",
"@edx/frontend-component-footer": "10.2.1",
"@edx/frontend-platform": "1.15.2",
"@edx/paragon": "19.25.3",
"@edx/frontend-component-header": "github:brian-smith-tcril/frontend-component-header#studio-header-for-prs",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brian-smith-tcril
Copy link
Contributor Author

implemented in #74

@brian-smith-tcril brian-smith-tcril deleted the use-frontend-component-header branch October 21, 2022 13:05
@arbrandes arbrandes linked an issue Oct 31, 2022 that may be closed by this pull request
4 tasks
@arbrandes arbrandes removed a link to an issue Oct 31, 2022
4 tasks
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.

Use a shared header component, instead of a custom one.
2 participants