Skip to content

Commit

Permalink
refactor(editor): N8N-4540 Main navigation layout rework (#4060)
Browse files Browse the repository at this point in the history
* ✨ Implemented new editor layout using css grid

* ✨ Reworking main navigation layout, migrating some styling to css modules

* ✨ Reworking main sidebar layout and responsiveness

* 💄 Minor type update

* ✨ Updated editor grid layout so empty cells are collapsed (`fit-content`), fixed updates menu items styling

* ✨ Implemented new user area look & feel in main sidebar

* 💄 Adjusting sidebar bottom padding when user area is not shown

* 💄 CSS cleanup/refactor + minor vue refactoring

* ✨ Fixing overscoll issue in chrome and scrolling behaviour of the content view

* 👌 Addressing review feedback

* ✨ Added collapsed and expanded versions of n8n logo

* ✨ Updating infinite scrolling in templates view to work with the new layout

* 💄 Updating main sidebar expanded width and templates view left margin

* 💄 Updating main content height

* 💄 Adding global styles for scrollable views with centered content, minor updates to user area

* ✨ Updating zoomToFit logic, lasso select box position and new nodes positioning

* ✨ Fixing new node drop position now that mouse detection has been adjusted

* 👌 Updating templates view scroll to top logic and responsive padding, aligning menu items titles

* 💄 Moving template layout style from global css class to component level
  • Loading branch information
MiloradFilipovic authored Sep 15, 2022
1 parent f40ae50 commit aee8912
Show file tree
Hide file tree
Showing 17 changed files with 494 additions and 383 deletions.
2 changes: 1 addition & 1 deletion packages/design-system/theme/src/reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ html {
body {
height: 100%;
width: 100%;
overscroll-behavior-x: none;
overscroll-behavior: none;
line-height: 1;
font-size: var(--font-size-m);
font-weight: var(--font-weight-regular);
Expand Down
3 changes: 3 additions & 0 deletions packages/editor-ui/public/n8n-logo-collapsed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions packages/editor-ui/public/n8n-logo-expanded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 32 additions & 16 deletions packages/editor-ui/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<template>
<div :class="$style.container">
<div :class="{[$style.app]: true, ['root-container']: true, ['menu-collapsed']: sidebarMenuCollapsed}">
<LoadingView v-if="loading" />
<div v-else id="app" :class="$style.container">
<div id="header" :class="$style.header">
<div
v-else
id="app"
:class="{
[$style.container]: true,
[$style.sidebarCollapsed]: sidebarMenuCollapsed
}"
>
<div id="header" :class="$style['header']">
<router-view name="header"></router-view>
</div>
<div id="sidebar" :class="$style.sidebar">
<div id="sidebar" :class="$style['sidebar']">
<router-view name="sidebar"></router-view>
</div>
<div id="content" :class="$style.content">
<div id="content" :class="$style['content']">
<router-view />
</div>
<Modals />
Expand Down Expand Up @@ -47,6 +54,7 @@ export default mixins(
computed: {
...mapGetters('settings', ['isHiringBannerEnabled', 'isTemplatesEnabled', 'isTemplatesEndpointReachable', 'isUserManagementEnabled', 'showSetupPage']),
...mapGetters('users', ['currentUser']),
...mapGetters('ui', ['sidebarMenuCollapsed']),
defaultLocale (): string {
return this.$store.getters.defaultLocale;
},
Expand Down Expand Up @@ -180,26 +188,34 @@ export default mixins(
</script>

<style lang="scss" module>
.app {
height: 100vh;
overflow: hidden;
}
.container {
height: 100%;
width: 100%;
display: grid;
grid-template-areas:
"sidebar header"
"sidebar content";
grid-auto-columns: fit-content($--sidebar-expanded-width) 1fr;
grid-template-rows: fit-content($--sidebar-width) 1fr;
}
.content {
composes: container;
background-color: var(--color-background-light);
position: relative;
grid-area: content;
overflow: auto;
height: 100vh;
}
.header {
z-index: 10;
position: fixed;
width: 100%;
grid-area: header;
z-index: 999;
}
.sidebar {
z-index: 15;
position: fixed;
grid-area: sidebar;
height: 100vh;
z-index: 999;
}
</style>

7 changes: 0 additions & 7 deletions packages/editor-ui/src/components/MainHeader/MainHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,11 @@ export default mixins(

<style lang="scss">
.main-header {
position: fixed;
top: 0;
background-color: var(--color-background-xlight);
height: 65px;
width: 100%;
box-sizing: border-box;
padding-left: $--sidebar-width;
&.expanded {
padding-left: $--sidebar-expanded-width;
}
}
.top-menu {
Expand Down
Loading

0 comments on commit aee8912

Please sign in to comment.