Basic sidebar expander (#15735)

This commit is contained in:
Phil Renaud 2023-01-10 16:35:53 -05:00 committed by GitHub
parent ed5fccc183
commit 4e16ccc5fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 2 deletions

3
.changelog/15735.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
ui: Add a button for expanding the Task sidebar to full width
```

View File

@ -1,6 +1,6 @@
<Portal @target="log-sidebar-portal"> <Portal @target="log-sidebar-portal">
<div <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 {{on-click-outside
@fns.closeSidebar @fns.closeSidebar
capture=true capture=true
@ -40,5 +40,12 @@
{{/if}} {{/if}}
<button
class="button is-borderless widener"
type="button"
{{on "click" this.toggleWide}}
>
{{x-icon (if this.wide "arrow-right" "arrow-left")}}
</button>
</div> </div>
</Portal> </Portal>

View File

@ -1,5 +1,7 @@
// @ts-check // @ts-check
import Component from '@glimmer/component'; import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class TaskContextSidebarComponent extends Component { export default class TaskContextSidebarComponent extends Component {
get isSideBarOpen() { get isSideBarOpen() {
@ -13,4 +15,9 @@ export default class TaskContextSidebarComponent extends Component {
action: () => this.args.fns.closeSidebar(), action: () => this.args.fns.closeSidebar(),
}, },
]; ];
@tracked wide = false;
@action toggleWide() {
this.wide = !this.wide;
}
} }

View File

@ -7,7 +7,7 @@ $subNavOffset: 49px;
width: 750px; width: 750px;
padding: 24px; padding: 24px;
right: 0%; right: 0%;
overflow-y: auto; overflow: visible;
bottom: 0; bottom: 0;
top: $topNavOffset; top: $topNavOffset;
transform: translateX(100%); transform: translateX(100%);
@ -21,6 +21,21 @@ $subNavOffset: 49px;
&.has-subnav { &.has-subnav {
top: calc($topNavOffset + $subNavOffset); 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 { .sidebar-content {