Skip to content

Commit

Permalink
Basic sidebar expander
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Jan 10, 2023
1 parent 865ee8d commit a7f7266
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/15735.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: Add a button for expanding the Task sidebar to full width
```
9 changes: 8 additions & 1 deletion ui/app/components/task-context-sidebar.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Portal @target="log-sidebar-portal">
<div
class="sidebar task-context-sidebar has-subnav {{if this.isSideBarOpen "open"}}"
class="sidebar task-context-sidebar has-subnav {{if this.wide "wide"}} {{if this.isSideBarOpen "open"}}"
{{on-click-outside
@fns.closeSidebar
capture=true
Expand Down Expand Up @@ -40,5 +40,12 @@


{{/if}}
<button
class="button is-borderless widener"
type="button"
{{on "click" this.toggleWide}}
>
{{x-icon (if this.wide "arrow-right" "arrow-left")}}
</button>
</div>
</Portal>
7 changes: 7 additions & 0 deletions ui/app/components/task-context-sidebar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @ts-check
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';

export default class TaskContextSidebarComponent extends Component {
get isSideBarOpen() {
Expand All @@ -13,4 +15,9 @@ export default class TaskContextSidebarComponent extends Component {
action: () => this.args.fns.closeSidebar(),
},
];

@tracked wide = false;
@action toggleWide() {
this.wide = !this.wide;
}
}
17 changes: 16 additions & 1 deletion ui/app/styles/components/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $subNavOffset: 49px;
width: 750px;
padding: 24px;
right: 0%;
overflow-y: auto;
overflow: visible;
bottom: 0;
top: $topNavOffset;
transform: translateX(100%);
Expand All @@ -21,6 +21,21 @@ $subNavOffset: 49px;
&.has-subnav {
top: calc($topNavOffset + $subNavOffset);
}

&.wide {
width: calc(100vw - $gutter-width - 1rem);
}

.button.widener {
position: absolute;
left: 0;
top: calc(50% - 16px);
width: 32px;
height: 32px;
left: -16px;
box-shadow: -5px 0 10px -5px rgb(0 0 0 / 20%);
border-radius: 16px;
}
}

.sidebar-content {
Expand Down

0 comments on commit a7f7266

Please sign in to comment.