[ui] Keyboard shortcuts for widening and narrowing task sidebar (#15807)
* keyboard-commands helper to add widen and narrow commands * Percy flake fix
This commit is contained in:
parent
4e82c96d36
commit
a30a7e6bdf
|
@ -89,6 +89,11 @@
|
||||||
type="button"
|
type="button"
|
||||||
{{on "click" this.toggleWide}}
|
{{on "click" this.toggleWide}}
|
||||||
>
|
>
|
||||||
|
{{#if this.wide}}
|
||||||
|
{{keyboard-commands (array this.narrowCommand)}}
|
||||||
|
{{else}}
|
||||||
|
{{keyboard-commands (array this.widenCommand)}}
|
||||||
|
{{/if}}
|
||||||
{{x-icon (if this.wide "arrow-right" "arrow-left")}}
|
{{x-icon (if this.wide "arrow-right" "arrow-left")}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,6 +16,18 @@ export default class TaskContextSidebarComponent extends Component {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
narrowCommand = {
|
||||||
|
label: 'Narrow Sidebar',
|
||||||
|
pattern: ['ArrowRight', 'ArrowRight'],
|
||||||
|
action: () => this.toggleWide(),
|
||||||
|
};
|
||||||
|
|
||||||
|
widenCommand = {
|
||||||
|
label: 'Widen Sidebar',
|
||||||
|
pattern: ['ArrowLeft', 'ArrowLeft'],
|
||||||
|
action: () => this.toggleWide(),
|
||||||
|
};
|
||||||
|
|
||||||
@tracked wide = false;
|
@tracked wide = false;
|
||||||
@action toggleWide() {
|
@action toggleWide() {
|
||||||
this.wide = !this.wide;
|
this.wide = !this.wide;
|
||||||
|
|
|
@ -85,7 +85,10 @@ module('Acceptance | task logs', function (hooks) {
|
||||||
.dom('.task-context-sidebar h1.title')
|
.dom('.task-context-sidebar h1.title')
|
||||||
.includesText(task.state, 'Task state is correctly displayed');
|
.includesText(task.state, 'Task state is correctly displayed');
|
||||||
await percySnapshot(assert, {
|
await percySnapshot(assert, {
|
||||||
percyCSS: '.allocation-row td { display: none; }',
|
percyCSS: `
|
||||||
|
.allocation-row td { display: none; }
|
||||||
|
.task-events table td:nth-child(1) { color: transparent; }
|
||||||
|
`,
|
||||||
});
|
});
|
||||||
|
|
||||||
await click('.sidebar button.close');
|
await click('.sidebar button.close');
|
||||||
|
|
Loading…
Reference in a new issue