-
Notifications
You must be signed in to change notification settings - Fork 919
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
[UX] Consolidate menu bars #1586
[UX] Consolidate menu bars #1586
Conversation
bb2b765
to
d2a2e09
Compare
One issue discovered is that the reporting plugin has hard-coded the popover positioning, so I may need a follow-up PR there to fix that in their repo, and is something to call out for plugin authors in general: @kgcreative also pointed out that there's some inconsistency with popover positioning - we may need to revisit the default positioning to ensure consistency (the preference is for the underneath popover): Also, the reporting menu action item doesn't appear in the mobile menu: |
Functional test failures currently under investigation:
|
cb03814
to
3e6c7d5
Compare
Codecov Report
@@ Coverage Diff @@
## main #1586 +/- ##
==========================================
- Coverage 67.51% 67.50% -0.02%
==========================================
Files 3073 3074 +1
Lines 59069 59127 +58
Branches 8963 8988 +25
==========================================
+ Hits 39881 39911 +30
- Misses 17005 17031 +26
- Partials 2183 2185 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! Can we delete this file as well now? https://github.com/tmarkley/OpenSearch-Dashboards/blob/c74c1f57d119f63462fdbd3fde5986957bc8a79a/src/core/server/core_app/assets/default_branding/opensearch_logo.svg
@@ -221,15 +221,37 @@ export default function ({ getService, getPageObjects }) { | |||
await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); | |||
await PageObjects.visEditor.clickGo(); | |||
const labels = await PageObjects.visChart.getYAxisLabels(); | |||
const expectedLabels = ['0', '2,000', '4,000', '6,000', '8,000', '10,000']; | |||
const expectedLabels = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did these change because of the additional space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, just enough vertical room at whatever display height the functional tests run at to allow for the extra ticks.
c100d33
to
20132ce
Compare
Did we want to convert this to draft since it's not targeting 2.0? Or close it since it's being reworked? |
20132ce
to
2a65dfb
Compare
Although we're not currently using it anywhere, I don't think there's a need to remove it from the repo altogether; my understanding is that @kgcreative may decide to use it elsewhere (possibly on the loading or welcome screens). |
ea2e3e6
to
22bbaf9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs additional tests, but this is ready for initial review.
{/* Pinned items */} | ||
<EuiFlexItem grow={false} style={{ flexShrink: 0 }}> | ||
<EuiCollapsibleNavGroup | ||
background="light" | ||
className="eui-yScroll" | ||
style={{ maxHeight: '40vh' }} | ||
> | ||
<EuiListGroup | ||
aria-label={i18n.translate('core.ui.primaryNav.pinnedLinksAriaLabel', { | ||
defaultMessage: 'Pinned links', | ||
})} | ||
listItems={[ | ||
{ | ||
label: 'Home', | ||
iconType: 'home', | ||
href: homeHref, | ||
onClick: (event) => { | ||
if (isModifiedOrPrevented(event)) { | ||
return; | ||
} | ||
|
||
event.preventDefault(); | ||
closeNav(); | ||
navigateToApp('home'); | ||
}, | ||
}, | ||
]} | ||
maxWidth="none" | ||
color="text" | ||
gutterSize="none" | ||
size="s" | ||
/> | ||
</EuiCollapsibleNavGroup> | ||
</EuiFlexItem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing home link from the collapsible menu.
/> | ||
{useExpandedMenu && ( | ||
<EuiHeader | ||
theme="dark" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird that we kind of misuse the theme to hard-code this expanded menu as dark, but there's no good reason to change, especially now that it won't be enabled by default.
...(observables.navControlsExpandedCenter$ && { | ||
items: [ | ||
<EuiShowFor sizes={['m', 'l', 'xl']}> | ||
<HeaderNavControls navControls$={observables.navControlsExpandedCenter$} /> | ||
</EuiShowFor>, | ||
], | ||
}), | ||
borders: 'none', | ||
}, | ||
{ | ||
...((observables.navControlsExpandedCenter$ || | ||
observables.navControlsExpandedRight$) && { | ||
items: [ | ||
<EuiHideFor sizes={['m', 'l', 'xl']}> | ||
<HeaderNavControls navControls$={observables.navControlsExpandedCenter$} /> | ||
</EuiHideFor>, | ||
<HeaderNavControls navControls$={observables.navControlsExpandedRight$} />, | ||
], | ||
}), | ||
borders: 'none', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a breaking change for Bitergia - they'll need to update their menu plugin to uses these new navControls locations. But because we're going to the simplified menu by default, I think that's the best migration path (and better than trying to find some conditional solution) - any other plugins using the existing navControls locations won't need to do anything.
const getIconProps = () => { | ||
const iconType = customMark | ||
? customMark | ||
: useExpandedMenu | ||
? 'home' | ||
: `${assetFolderUrl}/${defaultMark}`; | ||
const testSubj = customMark ? 'customLogo' : useExpandedMenu ? 'homeLogo' : 'defaultLogo'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally don't like nested ternaries, but I didn't particularly like the other options here either. Essentially, we'll always use a custom mark if provided; otherwise we'll use the OSD logo in the default mode or a home icon in the expanded mode.
Open to suggestions!
.headerIsExpanded & { | ||
min-height: calc(100vh - #{$euiHeaderHeightCompensation * 2}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems wrong to need to have this calculation done imperatively at the plugin level. But we don't have access to variables defined in the core, such as $osdHeaderOffset
. I explored the idea of using root CSS variables that are reset, instead of toggling the body class, but this seemed like the safest and least invasive approach. 😧
Looking cool! However, even though I believe this is by design, the top logo not being clickable in the expanded view feels a little weird especially if existing UX would do that. |
We should make the top logo clickable, even if we do have the bottom bar also go "home". |
ef78e8f
to
3051ba6
Compare
Done. |
LGTM! In the doc issue we can add more details about the plan switch over? Like we plan to consolidate by default for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a few nit's that can either be addressed in a future PR or just something to look out for in future.
- update branding mark unit tests - fix header spacing at smallest breakpoint - update custom branding functional test - update line chart functional test ticks to account for more ticks visisble with larger height of viz area - update release notes Signed-off-by: Josh Romero <[email protected]>
- add branding config for expanded menu Signed-off-by: Josh Romero <[email protected]>
- revert release note addition Signed-off-by: Josh Romero <[email protected]>
- remove home link from collapsible nav Signed-off-by: Josh Romero <[email protected]>
- Add expanded header option - Move navControlsRight to left of help - Rename HeaderLogo to HomeLoader - Serves as unified home button and global loading indicator - Add title for tooltip, because purpose may not be obvious - Rename Mark to HomeIcon - Uses home icon when header expanded by default - Restore HeaderLogo for expanded header - Duplicate default logo, rename to match mark naming (default, dark) - Add new nav control areas for expanded menu only - navControlsExpandedRight - navControlsExpandedCenter - Add new body class for expanded header - used by styles to correctly set app height - remove unecessary duplicate header mixin inclusion Signed-off-by: Josh Romero <[email protected]>
- fix functional tests - update test subjects - convert home tests to ts - update names and methods to be more clear Signed-off-by: Josh Romero <[email protected]>
- update snapshots Signed-off-by: Josh Romero <[email protected]>
- add, update, improve unit tests Signed-off-by: Josh Romero <[email protected]>
- keep expanded as default config Signed-off-by: Josh Romero <[email protected]>
- restore logo link - update functional tests Signed-off-by: Josh Romero <[email protected]>
- group dark mode branding tests Signed-off-by: Josh Romero <[email protected]>
- final review updates Signed-off-by: Josh Romero <[email protected]>
0be36bc
to
a8d9e71
Compare
I'll squash the commit message when merging:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Add a config option to remove the upper global header and incorporate all items into a single header. While the previous expanded dual header is still the default, we've added a new home button which also serves as the location of the global loading indicator. Additional changes: * update branding unit tests * fix header spacing at smallest breakpoint * update branding functional tests Issue resolved: #1583 Squashed commits: - update branding mark unit tests - fix header spacing at smallest breakpoint - update custom branding functional test - update line chart functional test ticks to account for more ticks visisble with larger height of viz area - update release notes - add branding config for expanded menu - revert release note addition - remove home link from collapsible nav - Add expanded header option - Move navControlsRight to left of help - Rename HeaderLogo to HomeLoader - Serves as unified home button and global loading indicator - Add title for tooltip, because purpose may not be obvious - Rename Mark to HomeIcon - Uses home icon when header expanded by default - Restore HeaderLogo for expanded header - Duplicate default logo, rename to match mark naming (default, dark) - Add new nav control areas for expanded menu only - navControlsExpandedRight - navControlsExpandedCenter - Add new body class for expanded header - used by styles to correctly set app height - remove unecessary duplicate header mixin inclusion - fix functional tests - update test subjects - convert home tests to ts - update names and methods to be more clear - update snapshots - add, update, improve unit tests - keep expanded as default config - restore logo link - update functional tests - group dark mode branding tests - final review updates Signed-off-by: Josh Romero <[email protected]> (cherry picked from commit ae6cb80)
Add a config option to remove the upper global header and incorporate all items into a single header. While the previous expanded dual header is still the default, we've added a new home button which also serves as the location of the global loading indicator. Additional changes: * update branding unit tests * fix header spacing at smallest breakpoint * update branding functional tests Issue resolved: #1583 Squashed commits: - update branding mark unit tests - fix header spacing at smallest breakpoint - update custom branding functional test - update line chart functional test ticks to account for more ticks visisble with larger height of viz area - update release notes - add branding config for expanded menu - revert release note addition - remove home link from collapsible nav - Add expanded header option - Move navControlsRight to left of help - Rename HeaderLogo to HomeLoader - Serves as unified home button and global loading indicator - Add title for tooltip, because purpose may not be obvious - Rename Mark to HomeIcon - Uses home icon when header expanded by default - Restore HeaderLogo for expanded header - Duplicate default logo, rename to match mark naming (default, dark) - Add new nav control areas for expanded menu only - navControlsExpandedRight - navControlsExpandedCenter - Add new body class for expanded header - used by styles to correctly set app height - remove unecessary duplicate header mixin inclusion - fix functional tests - update test subjects - convert home tests to ts - update names and methods to be more clear - update snapshots - add, update, improve unit tests - keep expanded as default config - restore logo link - update functional tests - group dark mode branding tests - final review updates Signed-off-by: Josh Romero <[email protected]> (cherry picked from commit ae6cb80) Co-authored-by: Josh Romero <[email protected]>
Description
Add a config option to remove the upper global header and incorporate all items into a single header. While the previous expanded dual header is still the default, we've added a new home button which also serves as the location of the global loading indicator.
Additional changes:
Issues Resolved
Fixes #1583
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr