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

Persist state of left sidebar #10611

Merged
merged 4 commits into from
Mar 14, 2024
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
8 changes: 8 additions & 0 deletions changelog/unreleased/enhancement-remember-left-nav-bar-state
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Remember left nav bar state

We've implemented a feature to remember the state of the left navbar. Now, when the user reopens the web application,
the navbar will remain in its last state, either fully open or collapsed,
based on the user's previous interaction with it.

https://github.com/owncloud/web/pull/10611
https://github.com/owncloud/web/issues/9613
5 changes: 3 additions & 2 deletions packages/web-runtime/src/layouts/Application.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ import {
AppLoadingSpinner,
useAppsStore,
useAuthStore,
useExtensionRegistry
useExtensionRegistry,
useLocalStorage
} from '@ownclouders/web-pkg'
import TopBar from '../components/Topbar/TopBar.vue'
import MessageBar from '../components/MessageBar.vue'
Expand Down Expand Up @@ -163,7 +164,7 @@ export default defineComponent({
return unref(navItems).length && !unref(isMobileWidth)
})

const navBarClosed = ref(false)
const navBarClosed = useLocalStorage(`oc_navBarClosed`, false)
const setNavBarClosed = (value: boolean) => {
navBarClosed.value = value
}
Expand Down