fix(web): keep the image-ref conflict indicator from reflowing the form
Build / build (push) Successful in 11m30s
Build / build (push) Successful in 11m30s
Move the conflict-checking hint inside the image-ref field as an absolutely-positioned overlay so a blur→check→clear cycle no longer shifts the rows below it on the /apps/new wizard.
This commit is contained in:
@@ -219,18 +219,34 @@
|
|||||||
>{$t('apps.new.imageRefLabel')}<span class="req-star" aria-label={$t('apps.new.fieldRequired')}>*</span></span
|
>{$t('apps.new.imageRefLabel')}<span class="req-star" aria-label={$t('apps.new.fieldRequired')}>*</span></span
|
||||||
>
|
>
|
||||||
<div class="input-with-button">
|
<div class="input-with-button">
|
||||||
<input
|
<div class="input-wrap">
|
||||||
id="app-image-ref"
|
<input
|
||||||
type="text"
|
id="app-image-ref"
|
||||||
class="input mono"
|
type="text"
|
||||||
bind:value={form.ref}
|
class="input mono"
|
||||||
oninput={onImageRefInput}
|
bind:value={form.ref}
|
||||||
onblur={onImageRefBlur}
|
oninput={onImageRefInput}
|
||||||
placeholder={$t('apps.new.imageRefPlaceholder')}
|
onblur={onImageRefBlur}
|
||||||
autocomplete="off"
|
placeholder={$t('apps.new.imageRefPlaceholder')}
|
||||||
spellcheck="false"
|
autocomplete="off"
|
||||||
required
|
spellcheck="false"
|
||||||
/>
|
required
|
||||||
|
/>
|
||||||
|
<!--
|
||||||
|
Conflict-lookup affordance lives INSIDE the field as an
|
||||||
|
absolutely-positioned overlay, so a blur → check → clear
|
||||||
|
cycle never reflows the rows below it. (The old inline hint
|
||||||
|
sat in normal flow and flashed in/out, shifting the whole
|
||||||
|
form.) A left fade masks ref text behind it; the aria-live
|
||||||
|
region still announces the lookup to assistive tech.
|
||||||
|
-->
|
||||||
|
{#if enableConflicts && conflictLoading}
|
||||||
|
<span class="conflict-checking" role="status" aria-live="polite">
|
||||||
|
<IconLoader size={12} />
|
||||||
|
<span>{$t('apps.new.imageConflictChecking')}</span>
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="discover-btn"
|
class="discover-btn"
|
||||||
@@ -265,18 +281,6 @@
|
|||||||
{:else if inspectStatus === 'error'}
|
{:else if inspectStatus === 'error'}
|
||||||
<span class="discover-pill discover-pill-bad inline">{$t('apps.new.errors.inspectFailed')}</span>
|
<span class="discover-pill discover-pill-bad inline">{$t('apps.new.errors.inspectFailed')}</span>
|
||||||
{/if}
|
{/if}
|
||||||
<!--
|
|
||||||
Conflict-checking indicator. Reserves no layout when idle and is a
|
|
||||||
quiet inline hint (not the full panel) while a lookup is in flight,
|
|
||||||
so a no-conflict blur no longer flashes the warning panel in then
|
|
||||||
out. The panel itself renders only for REAL conflicts below.
|
|
||||||
-->
|
|
||||||
{#if enableConflicts && conflictLoading}
|
|
||||||
<span class="conflict-checking" role="status" aria-live="polite">
|
|
||||||
<IconLoader size={12} />
|
|
||||||
<span>{$t('apps.new.imageConflictChecking')}</span>
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</label>
|
</label>
|
||||||
{#if enableConflicts && conflicts.length > 0}
|
{#if enableConflicts && conflicts.length > 0}
|
||||||
<div class="conflict-panel" role="status" aria-live="polite">
|
<div class="conflict-panel" role="status" aria-live="polite">
|
||||||
@@ -551,7 +555,18 @@
|
|||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
gap: 0.4rem;
|
gap: 0.4rem;
|
||||||
}
|
}
|
||||||
.input-with-button > .input {
|
.input-with-button > .input-wrap {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
/* Wrapper exists only to anchor the absolute conflict-checking overlay to
|
||||||
|
the field's box (inputs can't host positioned children themselves). */
|
||||||
|
.input-wrap {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.input-wrap > .input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
@@ -649,20 +664,32 @@
|
|||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius-sm);
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
/* Quiet inline "checking…" hint shown near the image-ref input while a
|
/* Quiet "checking…" affordance shown while a conflict lookup is in flight.
|
||||||
conflict lookup is in flight. Deliberately NOT the full panel, so a
|
Pinned as an absolute overlay inside the image-ref field's right edge so
|
||||||
no-conflict blur doesn't flash a panel in and out. Self-aligned so it
|
it sits ENTIRELY out of document flow — toggling it on a blur → check →
|
||||||
sits with the inspect status pills without shifting form layout. */
|
clear cycle can no longer reflow the form rows beneath it (the old
|
||||||
|
in-flow hint flashed in/out and shifted the whole form). The left fade
|
||||||
|
lets a long ref scroll cleanly under the pill instead of hard-cutting,
|
||||||
|
and pointer-events:none keeps the field fully clickable underneath. */
|
||||||
.conflict-checking {
|
.conflict-checking {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: 0.5rem;
|
||||||
|
transform: translateY(-50%);
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.35rem;
|
gap: 0.35rem;
|
||||||
align-self: flex-start;
|
padding: 0.28rem 0.55rem 0.28rem 1.6rem;
|
||||||
|
border-radius: var(--radius-md);
|
||||||
|
background: linear-gradient(90deg, transparent, var(--surface-input) 1.1rem);
|
||||||
font-family: var(--forge-mono);
|
font-family: var(--forge-mono);
|
||||||
font-size: 0.62rem;
|
font-size: 0.62rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
letter-spacing: 0.06em;
|
letter-spacing: 0.06em;
|
||||||
color: var(--text-tertiary);
|
color: var(--text-tertiary);
|
||||||
|
white-space: nowrap;
|
||||||
|
pointer-events: none;
|
||||||
|
animation: cc-fade-in 140ms ease-out;
|
||||||
}
|
}
|
||||||
.conflict-checking :global(svg) {
|
.conflict-checking :global(svg) {
|
||||||
animation: spin 0.9s linear infinite;
|
animation: spin 0.9s linear infinite;
|
||||||
@@ -672,6 +699,21 @@
|
|||||||
transform: rotate(360deg);
|
transform: rotate(360deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@keyframes cc-fade-in {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Respect users who opt out of motion: no spin, no fade. */
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.conflict-checking,
|
||||||
|
.conflict-checking :global(svg) {
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
.conflict-heading {
|
.conflict-heading {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 0.84rem;
|
font-size: 0.84rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user