-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc: Move browser dropdown within AUT URL bar #31216
Changes from all commits
7db059b
7952e8f
904efd0
eef419d
b51e9f8
0d06668
d4e529b
365e1e3
386ae59
9fa1a05
c01adca
044e2dc
a8f6c87
1d7dbbc
c0eb16d
7e57eb9
37fc77b
e63d1a0
a102ab8
c0629e2
56abccd
8bd4480
fb7f2c7
cb94aa1
167149f
057fcaf
22e5e0e
44dace8
86103c5
6a49184
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<!-- Be careful with changing styles of the panels, it can impact our screenshot tests --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lesson learned....... |
||
<template> | ||
<div | ||
id="resizable-panels-root" | ||
|
@@ -46,9 +47,7 @@ | |
data-cy="aut-panel" | ||
class="grow h-full bg-gray-100 relative" | ||
:class="{'pointer-events-none':panel2IsDragging}" | ||
:style="{ | ||
width: `${panel3width}px` | ||
}" | ||
:style="{ width: `${panel3width}px` }" | ||
> | ||
<slot | ||
name="panel3" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
<template> | ||
<Popover | ||
:key="`${props.disabled}`" | ||
class="bg-white rounded border-[1px] border-gray-100 h-[32px] relative" | ||
class="rounded-[50px] h-[30px] mx-[6px] py-[2px] relative" | ||
#="{ open, close }" | ||
> | ||
<PopoverButton | ||
class="border-transparent rounded grow h-full border-[1px] px-[12px] group" | ||
class="bg-white border rounded-[50px] self-center h-full grow px-[5px] group" | ||
:class="{ | ||
'hocus-default': !props.disabled, | ||
'opacity-50 cursor-auto': props.disabled, | ||
'rounded-[5px] border-[1px] border-indigo-100': !props.minimal, | ||
'border-transparent': props.minimal, | ||
}" | ||
:disabled="props.disabled" | ||
> | ||
|
@@ -26,6 +28,7 @@ | |
:close="close" | ||
/> | ||
<i-cy-chevron-down | ||
v-if="!props.minimal" | ||
class="transform transition-all w-[10px] duration-300" | ||
:class="{ | ||
'group-hocus:icon-dark-indigo-500': !props.disabled, | ||
|
@@ -61,14 +64,15 @@ import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue' | |
const props = withDefaults(defineProps<{ | ||
variant?: 'panel' | ||
align?: 'left' | 'right' | ||
|
||
minimal?: boolean | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add a comment or two describing the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can see one allows for a visual dropdown with a chevron vs the browser icon being the dropdown? |
||
// The disabled prop is used as the Popover key so that changes to the prop | ||
// cause the Popover component to mount again. This re-mounting ensures that | ||
// the PopoverPanel is closed if an enabled dropdown later becomes disabled. | ||
disabled?: boolean | ||
}>(), { | ||
minimal: true, | ||
variant: undefined, | ||
align: 'right', | ||
align: 'left', | ||
disabled: false, | ||
}) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,15 @@ | |
<div class="flex flex-wrap grow p-[16px] gap-[12px] justify-end"> | ||
<div | ||
data-cy="aut-url" | ||
class="border rounded flex grow border-gray-100 h-[32px] overflow-hidden align-middle" | ||
class="border rounded flex grow border-gray-100 h-[32px] align-middle" | ||
:class="{ | ||
'bg-gray-50': autStore.isLoadingUrl | ||
}" | ||
> | ||
<Button | ||
data-cy="playground-activator" | ||
:disabled="isDisabled" | ||
class="rounded-none border-gray-100 border-r-[1px] mr-[12px]" | ||
class="rounded-none border-gray-100 border-r-[1px]" | ||
variant="text" | ||
:aria-label="t('runner.selectorPlayground.toggle')" | ||
@click="togglePlayground" | ||
|
@@ -24,14 +24,36 @@ | |
:class="[selectorPlaygroundStore.show ? 'icon-dark-indigo-500' : 'icon-dark-gray-500']" | ||
/> | ||
</Button> | ||
<SpecRunnerDropdown | ||
v-if="selectedBrowser?.displayName" | ||
data-cy="select-browser" | ||
:disabled="autStore.isRunning" | ||
> | ||
<template #heading> | ||
<component | ||
:is="allBrowsersIcons[selectedBrowser.displayName?.toLowerCase()] || allBrowsersIcons.generic" | ||
class="min-w-[16px] w-[16px]" | ||
:alt="selectedBrowser.majorVersion ? `${selectedBrowser.displayName} ${selectedBrowser.majorVersion}` : selectedBrowser.displayName" | ||
/> | ||
</template> | ||
<template #default> | ||
<div class="max-h-[50vh] overflow-auto"> | ||
<VerticalBrowserListItems | ||
:gql="props.gql" | ||
:spec-path="activeSpecPath" | ||
/> | ||
</div> | ||
</template> | ||
</SpecRunnerDropdown> | ||
<input | ||
ref="autUrlInputRef" | ||
data-cy="aut-url-input" | ||
:disabled="urlDisabled" | ||
:value="inputValue" | ||
:placeholder="inputPlaceholder" | ||
aria-label="url of the application under test" | ||
class="aut-url-input flex grow mr-[12px] leading-normal max-w-full text-indigo-500 z-51 self-center hocus-link-default truncate" | ||
class="aut-url-input flex grow mr-[12px] leading-normal max-w-full text-indigo-500 self-center hocus-link-default truncate" | ||
:style="{ zIndex: inputZIndex }" | ||
@input="setStudioUrl" | ||
@click="openExternally" | ||
@keyup.enter="visitUrl" | ||
|
@@ -65,30 +87,6 @@ | |
</span> | ||
</Tag> | ||
</div> | ||
|
||
<SpecRunnerDropdown | ||
v-if="selectedBrowser?.displayName" | ||
data-cy="select-browser" | ||
:disabled="autStore.isRunning" | ||
> | ||
<template #heading> | ||
<component | ||
:is="allBrowsersIcons[selectedBrowser.displayName?.toLowerCase()] || allBrowsersIcons.generic" | ||
class="min-w-[16px] w-[16px]" | ||
:alt="selectedBrowser.displayName" | ||
/> | ||
{{ selectedBrowser.displayName }} {{ selectedBrowser.majorVersion }} | ||
</template> | ||
|
||
<template #default> | ||
<div class="max-h-[50vh] overflow-auto"> | ||
<VerticalBrowserListItems | ||
:gql="props.gql" | ||
:spec-path="activeSpecPath" | ||
/> | ||
</div> | ||
</template> | ||
</SpecRunnerDropdown> | ||
</div> | ||
|
||
<SelectorPlayground | ||
|
@@ -184,6 +182,12 @@ watchEffect(() => { | |
|
||
const autIframe = props.getAutIframe() | ||
|
||
const inputZIndex = computed(() => { | ||
// input needs to be above the Studio prompt overlay | ||
// but other times it needs to be below other resizable panels | ||
return studioStore.needsUrl ? 51 : 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the studio prompt overlay have a z-index of 50 or something near that? Is there a better way to determine the z-index value here over static values? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yah, the overlay has a 50 zindex. It is a good point, this code was so brittle with the zindex changes. I suffered a lot. |
||
}) | ||
|
||
const displayScale = computed(() => { | ||
return autStore.scale < 1 ? `${Math.round(autStore.scale * 100) }%` : 0 | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has legitimately changed, previously the browser dropdown at this width was lessening the AUT height.
