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

Remove nav item & fix greyed out nav item on search #7270

Merged
merged 5 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion changelog/unreleased/bugfix-repair-navigtion-highlighter
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Bugfix: Repair navigation highlighter

We've refactored the navigation highlighter to fix several small glitches.

https://github.com/owncloud/web/pull/7210
https://github.com/owncloud/web/pull/7210
https://github.com/owncloud/web/pull/7270

This file was deleted.

10 changes: 0 additions & 10 deletions packages/web-app-files/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ const appInfo = {
fileSideBars
}
const navItems = [
{
name: $gettext('Search'),
icon: 'search',
route: {
path: `/${appInfo.id}/search/list`
},
enabled() {
return window.location.pathname === this.route.path
}
},
{
name(capabilities) {
return capabilities.spaces?.enabled ? $gettext('Personal') : $gettext('All files')
Expand Down
21 changes: 20 additions & 1 deletion packages/web-runtime/src/components/SidebarNav/SidebarNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
</oc-button>
<nav class="oc-sidebar-nav oc-my-m oc-px-xs" :aria-label="$gettext('Sidebar navigation menu')">
<oc-list>
<div id="nav-highlighter" class="oc-ml-s oc-background-primary-gradient" />
<div
v-show="isAnyNavItemActive"
id="nav-highlighter"
class="oc-ml-s oc-background-primary-gradient"
/>
<sidebar-nav-item
v-for="link in navItems"
:key="link.route.path"
Expand Down Expand Up @@ -63,8 +67,10 @@ export default {
const resizeObserver = new ResizeObserver((data) => {
const width = data[0].borderBoxSize[0].inlineSize
highlighter.style.setProperty('transition-duration', `0.05s`)
if (width === 0) return
highlighter.style.setProperty('width', `${width}px`)
}).observe(navItem)
if (navItem.clientWidth === 0) return
highlighter.style.setProperty('width', `${navItem.clientWidth}px`)
highlighter.style.setProperty('height', `${navItem.clientHeight}px`)

Expand All @@ -83,6 +89,10 @@ export default {

toggleSidebarButtonIcon() {
return this.navigation.closed ? 'arrow-drop-right' : 'arrow-drop-left'
},

isAnyNavItemActive() {
return this.navItems.some((i) => i.active === true)
}
},
methods: {
Expand All @@ -104,6 +114,15 @@ export default {
position: absolute;
border-radius: 5px;
transition: transform 0.2s cubic-bezier(0.51, 0.06, 0.56, 1.37);
&::before {
bottom: 0;
box-shadow: 2px 0 6px rgba(0, 0, 0, 0.14);
content: '';
left: 0;
position: absolute;
top: 0;
width: 40px;
}
}
#web-nav-sidebar {
background-color: var(--oc-color-background-default);
Expand Down