Skip to content

Commit 8b079cf

Browse files
committed
Horizontal slider update
1 parent ed2c8e5 commit 8b079cf

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

packages/app/src/app.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ export class WebdriverIODevtoolsApplication extends Element {
3838
@query('section')
3939
window?: HTMLElement
4040

41+
@query('section[data-resizer-window]')
42+
resizerWindow?: HTMLElement
43+
4144
async #getWindow() {
4245
await this.updateComplete
43-
return this.window as Element
46+
return this.resizerWindow as Element
4447
}
4548

4649
connectedCallback(): void {
@@ -66,16 +69,15 @@ export class WebdriverIODevtoolsApplication extends Element {
6669
}
6770

6871
return html`
69-
<section class="flex h-[calc(100%-40px)] w-full relative">
72+
<section data-resizer-window class="flex h-[calc(100%-40px)] w-full relative">
7073
${
7174
// only render sidebar if trace file is captured using testrunner
7275
this.dataManager.traceType === TraceType.Testrunner
73-
? html`<wdio-devtools-sidebar style="${this.#drag.getPosition()}"></wdio-devtools-sidebar>`
76+
? html`<wdio-devtools-sidebar style="${this.#drag?.getPosition()}"></wdio-devtools-sidebar>`
7477
: nothing
7578
}
76-
79+
${this.#drag.getSlider('h-full')}
7780
<wdio-devtools-workbench class="basis-auto"></wdio-devtools-workbench>
78-
${this.#drag.getSlider()}
7981
</section>
8082
`
8183
}

packages/app/src/components/workbench.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import './workbench/metadata.js'
1818
import './browser/snapshot.js'
1919

2020
const MIN_WORKBENCH_HEIGHT = 600
21-
const MIN_METATAB_WIDTH = 250
21+
const MIN_METATAB_WIDTH = 260
2222
const RERENDER_TIMEOUT = 10
2323

2424
const COMPONENT = 'wdio-devtools-workbench'
@@ -35,6 +35,7 @@ export class DevtoolsWorkbench extends Element {
3535
color: var(--vscode-foreground);
3636
background-color: var(--vscode-editor-background);
3737
position: relative;
38+
margin-left: 10px;
3839
}
3940
`]
4041

packages/app/src/components/workbench/actions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export class DevtoolsActions extends Element {
9191
:host, .action-list {
9292
width: 100%;
9393
height: 100%;
94-
overflow-y: auto;
9594
}
9695
9796
.step-summary {

packages/app/src/utils/DragController.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,25 @@ export class DragController implements ReactiveController {
6060
this.#getDraggableEl(),
6161
options.getContainerEl()
6262
]).then(([draggableEl, containerEl]) => {
63-
if (!draggableEl) {
64-
console.warn('getDraggableEl() did not return an element HTMLElement')
65-
}
66-
if (!containerEl) {
67-
console.warn('getContainerEl() did not return an element HTMLElement')
68-
}
69-
7063
if (!draggableEl || !containerEl) {
64+
// Retry after a short delay
65+
setTimeout(async () => {
66+
const [retryDraggableEl, retryContainerEl] = await Promise.all([
67+
this.#getDraggableEl(),
68+
options.getContainerEl()
69+
])
70+
if (!retryDraggableEl) {
71+
console.warn('getDraggableEl() did not return an element HTMLElement')
72+
}
73+
if (!retryContainerEl) {
74+
console.warn('getContainerEl() did not return an element HTMLElement')
75+
}
76+
if (retryDraggableEl && retryContainerEl) {
77+
this.#draggableEl = retryDraggableEl as HTMLElement
78+
this.#containerEl = retryContainerEl as HTMLElement
79+
this.#init()
80+
}
81+
}, 50)
7182
return
7283
}
7384

0 commit comments

Comments
 (0)