Smooth appearance of the tooltip (fixed twitching) (#8617)
Some checks are pending
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions

This commit is contained in:
Alexander Platov 2025-04-18 06:23:21 +03:00 committed by GitHub
parent 8bcedc3bf8
commit cb9a0d5017
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 7 deletions

View File

@ -21,6 +21,7 @@
import Component from './Component.svelte'
import Label from './Label.svelte'
import { capitalizeFirstLetter, formatKey } from '../utils'
import { testing } from '..'
let tooltipHTML: HTMLElement
let nubHTML: HTMLElement
@ -248,6 +249,7 @@
const hideTooltip = (): void => {
if (tooltipHTML) options.visibility = 'hidden'
shown = false
closeTooltip()
}
@ -319,6 +321,7 @@
{#if $tooltip.component && $tooltip.kind !== 'submenu'}
<div
class="popup-tooltip {options.classList} {$tooltip.style}"
class:testing
class:shown
class:doublePadding={$tooltip.label}
use:resizeObserver={(element) => {
@ -374,6 +377,7 @@
bind:this={nubHTML}
style:z-index={($modals.findIndex((t) => t.type === 'tooltip') ?? 1) + 10000}
class="nub {nubDirection ?? ''}"
class:testing
class:shown
/>
{/if}
@ -467,7 +471,6 @@
border-radius: 0.75rem;
box-shadow: var(--theme-popup-shadow);
user-select: none;
opacity: 0;
&.doublePadding {
padding: 1rem;
@ -489,13 +492,25 @@
background-color: var(--popup-color-disabled);
}
}
.popup-tooltip,
.nub {
opacity: 0;
transition: opacity 0.1s ease-in-out;
&.testing {
transition-duration: 0 !important;
}
}
.shown {
opacity: 1;
transition: opacity 0.1s ease-in-out 0.05s;
}
.nub {
position: fixed;
// background-color: rgba(255, 255, 0, .5);
user-select: none;
pointer-events: none;
opacity: 0;
&::after,
&::before {
@ -561,10 +576,6 @@
transform: rotate(-90deg);
}
}
.shown {
transition: opacity 0.1s ease-in-out 0.15s;
opacity: 1;
}
.keys {
margin-left: 0.5rem;

View File

@ -345,7 +345,7 @@ test.describe('Content in the Documents tests', () => {
await documentContentPage.changeCodeBlockLanguage('Line 18', 'plaintext', 'css')
await documentContentPage.applyNote('Line 19', 'warning', testNote)
await documentContentPage.addImage('Line 20')
await page.keyboard.type('Cat')
// await page.keyboard.type('Cat')
newUser2 = generateUser()
await createAccount(request, newUser2)