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

#7268: Fix editor sidebar logo sizing #7269

Merged
merged 6 commits into from Jan 8, 2024
Merged

#7268: Fix editor sidebar logo sizing #7269

merged 6 commits into from Jan 8, 2024

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Jan 5, 2024

What does this PR do?

Before After
Screenshot 10 Screenshot 11

In the collapsed sidebar, I dropped the house icon altogether because it doesn't really match the behavior of the button. Also it was the easiest solution instead of keeping the awkward dual-icon dual-color button.

The expanded sidebar is unchanged (except some sizing improvements that reduce the code require for all of this)

Checklist

@fregante fregante added the bug Something isn't working label Jan 5, 2024
@@ -20,7 +20,4 @@
.button {
background-color: $P500;
border-color: $P500;

display: flex;
align-items: center;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Already handled by <Button/>

onClick={
onClick ??
(() => {
dispatch(editorSlice.actions.showHomePane());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The button should unequivocally expand the sidebar, not have a dual behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not just pass the showHomePane action in in SidebarExpanded and make onClick required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because I didn't think of that. 😃
Can do either way. I'll make that change later today

>
<img src={home} alt="Return to Page Editor Home" />
{children ?? <img src={home} alt="Return to Page Editor Home" />}
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 thought it'd make sense to just use one icon.

@@ -44,7 +44,7 @@ const ReloadButton: React.FunctionComponent = () => (
className="mt-auto"
onClick={onReload}
>
<FontAwesomeIcon icon={faSync} />
<FontAwesomeIcon icon={faSync} fixedWidth />
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 didn't know it when I added the reload buttons, but this is a better way to make a "square" button, instead of forcing a hard-coded $logoSize

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0cde4f2) 71.58% compared to head (fedfc8a) 71.58%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7269   +/-   ##
=======================================
  Coverage   71.58%   71.58%           
=======================================
  Files        1201     1201           
  Lines       37583    37583           
  Branches     7055     7055           
=======================================
  Hits        26904    26904           
  Misses      10679    10679           

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

@BrandonPxBx
Copy link

I'm worried about the implementation here. We've removed the opportunity to hit the home button from the collapsed menu. Is there any primary reasoning for swapping out the functionality of the button? @fregante

@fregante
Copy link
Collaborator Author

fregante commented Jan 5, 2024

We've removed the opportunity to hit the home button from the collapsed menu

Was that intentional?

The intent of the two-color button was initially only to expand the sidebar. You can find the original demo in:

When the HomeButton was implemented, its nesting did both, IMHO confusingly so: when the sidebar is closed, the most common intent is to expand it, not to lose the selected extension.

If that behavior is still preferred, I can restore the two buttons without nesting.

@BrandonPxBx
Copy link

I agree that it was strange that it expanded the menu, but I think the answer is to have it go home without expanding the menu, not eliminating the opportunity for a user to get to the home state while the menu is collapsed.

Copy link
Collaborator Author

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Done. Now the PR does this:

  • fixes home button style
  • removes nested buttons
  • removes hardcoded sizes
  • the home button no longer toggles the sidebar open
Screen.Recording.mov

Copy link

github-actions bot commented Jan 8, 2024

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@fregante fregante merged commit e481e62 into main Jan 8, 2024
19 checks passed
@fregante fregante deleted the F/bug/editor-sidebar branch January 8, 2024 14:28
fregante added a commit that referenced this pull request Jan 9, 2024
@grahamlangford grahamlangford added this to the 1.8.7 milestone Jan 11, 2024
@fregante fregante mentioned this pull request Feb 8, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The editor sidebar logo is misaligned and double-wrapped
3 participants