Show metadata transfer apply progress
This commit is contained in:
@@ -200,6 +200,20 @@ test('metadata transfer refresh updates only the transfer panel when it is mount
|
||||
assert.equal(tooltipBindCount, 1);
|
||||
});
|
||||
|
||||
test('metadata transfer shows a spinner while applying', () => {
|
||||
const context = createTransferContext();
|
||||
const state = createTransferState([
|
||||
{ category: 'text_encoders', original_path: 'imported.safetensors' },
|
||||
]);
|
||||
state.transfer.applying = true;
|
||||
|
||||
const html = context.renderMetadataTransferPanel(state);
|
||||
|
||||
assert.match(html, /aria-busy="true"/);
|
||||
assert.match(html, /class="mr-image-transfer-action-spinner" aria-hidden="true"/);
|
||||
assert.match(html, /<span>Applying\.\.\.<\/span>/);
|
||||
});
|
||||
|
||||
test('metadata transfer exposes Undo transfer while the post-transfer workflow is unchanged', () => {
|
||||
const context = createTransferContext();
|
||||
const state = createTransferState([
|
||||
|
||||
@@ -5305,6 +5305,18 @@ button.mr-info-link:disabled {
|
||||
border-top: 1px solid var(--mr-border);
|
||||
}
|
||||
|
||||
.mr-image-transfer-action-spinner {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
flex: 0 0 12px;
|
||||
border: 2px solid currentColor;
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: mr-image-inspector-spin 700ms linear infinite;
|
||||
}
|
||||
|
||||
.mr-image-transfer-empty {
|
||||
margin: var(--mr-spacing-8) 0;
|
||||
color: var(--mr-text-muted);
|
||||
|
||||
@@ -1474,8 +1474,10 @@ export const imageMetadataMethods = {
|
||||
<div class="mr-image-transfer-category-list">${targetRows}</div>
|
||||
<div class="mr-image-transfer-actions">
|
||||
<span class="mr-image-transfer-selection-count">${this.escapeHtml(selectionSourceText)} · ${selectedTargetCount} selected node${selectedTargetCount === 1 ? '' : 's'}</span>
|
||||
<button type="button" class="mr-btn mr-btn-primary mr-btn-sm" data-image-inspector-action="apply-transfer" ${applyDisabled ? 'disabled' : ''}>
|
||||
${transfer.applying ? 'Applying...' : transfer.undoing ? 'Undoing...' : 'Apply transfer'}
|
||||
<button type="button" class="mr-btn mr-btn-primary mr-btn-sm" data-image-inspector-action="apply-transfer" ${applyDisabled ? 'disabled' : ''} aria-busy="${transfer.applying ? 'true' : 'false'}">
|
||||
${transfer.applying
|
||||
? '<span class="mr-image-transfer-action-spinner" aria-hidden="true"></span><span>Applying...</span>'
|
||||
: transfer.undoing ? 'Undoing...' : 'Apply transfer'}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user