refactor(file-upload): SSR-first state, click-to-replace, cleaner preview
- Server renders initial file-upload state (src, alt, label text, has-current class) so there is no flash of broken-image icon while JS boots. JS no longer duplicates that work — it only reacts to user input (select, clear, drag-and-drop) and uses data-current-src solely to restore the server file after a blob preview. - Clicking the current preview image now opens the file dialog, mirrors the Replace button, with hover affordance (cursor + primary border). - Drop the transparency checker pattern in the preview — the admin UI does not need Figma-style transparency semantics. Preview is now a flat theme-aware surface (--app-preview-bg) that keeps white or black logos visible against a neutral gray. - Move tenant favicon out of the aside into the Master-data tab as its own details block next to the Tenant-logos section. Uses the same barrier-form pattern (HTML5 form attribute + app-file-upload.phtml) for a consistent instant-upload UX. - Tenant-logo slot label is a native <label> element — picks up the global form-label typography and spacing, no custom muted-color class needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,15 +32,15 @@
|
||||
object-fit: contain;
|
||||
object-position: center;
|
||||
border: 1px solid var(--app-muted-border-color);
|
||||
background-color: var(--app-preview-checker-bg);
|
||||
background-image:
|
||||
linear-gradient(45deg, var(--app-preview-checker-fg) 25%, transparent 25%),
|
||||
linear-gradient(-45deg, var(--app-preview-checker-fg) 25%, transparent 25%),
|
||||
linear-gradient(45deg, transparent 75%, var(--app-preview-checker-fg) 75%),
|
||||
linear-gradient(-45deg, transparent 75%, var(--app-preview-checker-fg) 75%);
|
||||
background-size: 16px 16px;
|
||||
background-position: 0 0, 0 8px, 8px -8px, -8px 0;
|
||||
background-color: var(--app-preview-bg);
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s ease, opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.app-file-upload-current-image:hover {
|
||||
border-color: var(--app-primary);
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.app-file-upload-current-meta {
|
||||
@@ -189,14 +189,7 @@
|
||||
object-fit: contain;
|
||||
object-position: center;
|
||||
border: 1px solid var(--app-muted-border-color);
|
||||
background-color: var(--app-preview-checker-bg);
|
||||
background-image:
|
||||
linear-gradient(45deg, var(--app-preview-checker-fg) 25%, transparent 25%),
|
||||
linear-gradient(-45deg, var(--app-preview-checker-fg) 25%, transparent 25%),
|
||||
linear-gradient(45deg, transparent 75%, var(--app-preview-checker-fg) 75%),
|
||||
linear-gradient(-45deg, transparent 75%, var(--app-preview-checker-fg) 75%);
|
||||
background-size: 16px 16px;
|
||||
background-position: 0 0, 0 8px, 8px -8px, -8px 0;
|
||||
background-color: var(--app-preview-bg);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,20 +18,15 @@
|
||||
max-height: calc(var(--app-topbar-height) - 1rem);
|
||||
}
|
||||
|
||||
/* Tenant-edit "Tenant logos" slots — two Pico .grid columns. */
|
||||
/* Tenant-edit "Tenant logos" slots — two Pico .grid columns.
|
||||
The slot's <label> uses the standard form-label rule (block,
|
||||
margin-bottom, --app-color, text-sm) so it matches other inputs. */
|
||||
.tenant-logo-slot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.tenant-logo-slot-label {
|
||||
font-size: var(--text-sm);
|
||||
color: var(--app-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tenant-logo-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
Reference in New Issue
Block a user