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

fix: stopped switcher from moving outside the header #1693

Closed

Conversation

varshannagarajan
Copy link
Contributor

Description of changes

Changed the header bar to be a flex box. This was done to make sure all components of the header bar were centered at all times. Fixes the switcher position problem as mentioned in issue #1219 . I wrapped the logo, header text and switcher div keeping the gear option outside.

No bookmarklet:
image

With bookmarklet without fix:
image

With bookmarklet and fix:
image

Pull request checklist

  • Addresses an existing issue: WCAG 2.1 1.4.12 Text spacing in the Switcher  #1219
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). Check workflow guide at: <rootDir>/docs/workflow.md
  • (UI changes only) Added screenshots/GIFs to description above
  • (UI changes only) Verified usability with NVDA/JAWS

@varshannagarajan varshannagarajan requested a review from a team as a code owner November 14, 2019 23:29
@msftclas
Copy link

msftclas commented Nov 14, 2019

CLA assistant check
All CLA requirements met.

@smoralesd smoralesd closed this Nov 19, 2019
@smoralesd smoralesd reopened this Nov 19, 2019
@varshannagarajan
Copy link
Contributor Author

varshannagarajan commented Nov 21, 2019

The error seems to be from a test timing out, the message is "Exceeded timeout of 20000ms for a hook.". The test that fails is device-connection-dialog test. But I don't think anything I modified should have caused this.

@smoralesd smoralesd closed this Nov 21, 2019
@smoralesd smoralesd reopened this Nov 21, 2019
@peterdur
Copy link
Contributor

@varshannagarajan Thanks for following up on your earlier PR with this fix! Looks like re-running the tests addressed the test issue you mentioned above. We want to take a little extra time to validate this fix across multiple scenarios; between that, the holiday week, and ongoing work on #1591, it may be a little while longer before we review and merge.

z-index: 1000;
display: flex;
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to remove the redundant float: attributes from the direct children, since the flex display will now be laying them out appropriately

@@ -308,8 +304,18 @@ div.insights-file-issue-details-dialog-container {
}
.header-bar {
padding-left: 12px;
position: fixed;
position: relative;
z-index: 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

The high z-index is probably unnecessary after this change

Copy link
Contributor

@dbjorge dbjorge left a comment

Choose a reason for hiding this comment

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

see inline

dbjorge added a commit that referenced this pull request Dec 5, 2019
…1803)

#### Description of changes

This PR fixes an issue caught during v2.11.0 release validation introduced in #1606 where if you resize the details view down to the minimum window size allowed by Chrome (500px) at default zoom levels, the settings gear icon overflows out of the header bar:

![screenshot with missing settings icon](https://user-images.githubusercontent.com/376284/70194913-f1846280-16b8-11ea-8a0f-9765db695f97.png)

@varshannagarajan 's outstanding PR #1693 fixes a variant of this issue for the switcher dialog at high zoom/text spacing levels. This PR takes the same idea as #1693 but expands it to the entire header bar (it therefore obsoletes #1693)
* It runs the *entire* header bar into a flexbox
* It enables text-overflow behavior on the extension title, so it will shrink before functional elements do
* It adjusts styling slightly such that everything fits at default zoom level + Chrome's default minimum window size (500px)

Since this essentially amounted to a rewrite of the relevant styling, I took it as an opportunity to pull it out of the big shared scss files and into modules. This involved a little gymnastics for some of the office fabric style overrides that previously relied on being within a `#details-container` selector to achieve the necessary specificity.

To enable re-use of the new modularized styles in guidance pages, this also extracts out the common parts of the header to a new common Header component for the guidance content page to reuse. This happened to be the first point where the guidance content pages required css module styles, so I also added the necessary reference from `insights.html` to `bundle/insights.css`.

The most questionable bit of CSS is the use of `margin-left: auto` on the settings icon styling to get it to functionally float right inside the flexbox; I thought using this was a little more pleasant to reason about than the alternative of using nested flexboxes in the same direction, but was a bit on the fence about which technique to use.

Screenshots:

**details view, 500px 100% zoom**
![image](https://user-images.githubusercontent.com/376284/70195769-76707b80-16bb-11ea-9223-af35246e3051.png)

**details view, 500px 100% zoom, text-spacing bookmarklet**
![image](https://user-images.githubusercontent.com/376284/70196042-4675a800-16bc-11ea-9854-985bab775fdf.png)

**details view, 1280px, 100% zoom**
![image](https://user-images.githubusercontent.com/376284/70195982-162e0980-16bc-11ea-82cf-a4f5f5ae7ca3.png)

**details view, 1280px 400% zoom**
![image](https://user-images.githubusercontent.com/376284/70195991-21813500-16bc-11ea-8ffb-7d9ebcd0bf97.png)

**fastpass report, 500px 100% zoom**
![image](https://user-images.githubusercontent.com/376284/70195911-eaab1f00-16bb-11ea-9dd6-ed1f8e4b4fed.png)

**assessment report, 500px 100% zoom**
![image](https://user-images.githubusercontent.com/376284/70195923-f860a480-16bb-11ea-9a60-af13bc25c463.png)


#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox -->
- [n/a] Addresses an existing issue: #0000
- [x] Ran `yarn fastpass`
- [x] Added/updated relevant unit test(s) (and ran `yarn test`)
- [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage`
- [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). Check workflow guide at: `<rootDir>/docs/workflow.md`
- [x] (UI changes only) Added screenshots/GIFs to description above
- [x] (UI changes only) Verified usability with NVDA/JAWS
@peterdur
Copy link
Contributor

peterdur commented Dec 6, 2019

@varshannagarajan, thanks again for sending us this PR! During our validation pass this week, we discovered some related issues around header bar behavior at small sizes. @dbjorge on our team, having reviewed your proposed changes earlier, was able to extend what you did to cover those issues as well in #1803. Since that PR includes the changes here, this PR is now obsolete. We'll make sure to include you in our contributor thanks in the next release!

@peterdur peterdur closed this Dec 6, 2019
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