feat: reset all queue filters together
Add one contextual reset action that clears the upload sidebar, filename search, host filter, and status filter in a single render while restoring selection and scroll state consistently.
This commit is contained in:
@@ -116,6 +116,7 @@ test('rare account, backup, update, and confirmation states translate in both di
|
||||
['Ein Update wird bereits vorbereitet', 'An update is already being prepared'],
|
||||
['Die Anwendung ist noch nicht bereit, das Update sicher zu installieren', 'The application is not yet ready to install the update safely'],
|
||||
['Update abgebrochen', 'Update canceled'],
|
||||
['Filter zurücksetzen', 'Reset filters'],
|
||||
['Download abbrechen', 'Cancel download'],
|
||||
['Abbrechen…', 'Cancelling…'],
|
||||
['Download abgebrochen', 'Download canceled'],
|
||||
|
||||
@@ -177,6 +177,7 @@ test('header occupies its final geometry before asynchronous initialization', ()
|
||||
assert.match(css, /\.update-dialog\s*\{[^}]*width:\s*min\(576px,\s*100%\);/su);
|
||||
assert.match(css, /\.update-release-notes\s*\{[^}]*height:\s*min\(264px,\s*48vh\);/su);
|
||||
assert.match(html, /class="update-progress-footer"[\s\S]*id="updateProgressDetails"[\s\S]*id="updateProgressSize"[\s\S]*id="updateProgressSpeed"[\s\S]*id="updateProgressEta"[\s\S]*id="updateProgressText"/u);
|
||||
assert.match(html, /id="queueFilterResetBtn"[^>]*hidden[^>]*>Filter zurücksetzen</u);
|
||||
assert.match(css, /#updateProgressDetails\s*\{[^}]*display:\s*grid;[^}]*grid-template-columns:\s*19ch 2ch 11ch 2ch 10ch;[^}]*column-gap:\s*0;[^}]*font-variant-numeric:\s*tabular-nums;/su);
|
||||
assert.match(css, /\.update-progress-separator\s*\{[^}]*display:\s*grid;[^}]*place-items:\s*center;/su);
|
||||
assert.match(css, /#updateProgressSpeed\s*\{[^}]*text-align:\s*right;/su);
|
||||
|
||||
@@ -723,6 +723,39 @@ setTimeout(async () => {
|
||||
check('Status changes drop selections that leave the upload filter', uploadSelectionScope.statusChangeSelected.length === 0 && uploadSelectionScope.statusChangeVisible.join('|') === 'scope-active-z');
|
||||
check('Selected upload actions ignore hidden stale selections', uploadSelectionScope.hiddenAction.selected.length === 0 && uploadSelectionScope.hiddenAction.retryDisabled && uploadSelectionScope.hiddenAction.moveDisabled);
|
||||
|
||||
const queueFilterReset = await wc.executeJavaScript(\`(() => {
|
||||
queueJobs = [
|
||||
{ id: 'filter-a', file: 'C:/ui/filter-a.bin', fileName: 'alpha.bin', hoster: 'byse.sx', status: 'uploading', bytesUploaded: 10, bytesTotal: 100, progress: .1 },
|
||||
{ id: 'filter-b', file: 'C:/ui/filter-b.bin', fileName: 'beta.bin', hoster: 'doodstream.com', status: 'error', bytesUploaded: 0, bytesTotal: 100, progress: 0 }
|
||||
];
|
||||
selectedJobIds.clear();
|
||||
rebuildJobIndex();
|
||||
renderQueueTable();
|
||||
setUploadSidebarFilter('active');
|
||||
document.getElementById('queueSearchInput').value = 'alpha';
|
||||
document.getElementById('queueHosterFilter').value = 'byse.sx';
|
||||
document.getElementById('queueStatusFilter').value = 'active';
|
||||
applyQueueDetailFilters();
|
||||
const button = document.getElementById('queueFilterResetBtn');
|
||||
const before = { hidden: button.hidden, disabled: button.disabled };
|
||||
button.click();
|
||||
const after = {
|
||||
hidden: button.hidden,
|
||||
disabled: button.disabled,
|
||||
sidebar: uploadSidebarFilter,
|
||||
search: document.getElementById('queueSearchInput').value,
|
||||
hoster: document.getElementById('queueHosterFilter').value,
|
||||
status: document.getElementById('queueStatusFilter').value,
|
||||
allPressed: document.querySelector('[data-upload-sidebar-target="all"]').getAttribute('aria-pressed'),
|
||||
visible: _sortedJobsCache.map(job => job.id).join('|')
|
||||
};
|
||||
queueJobs = [];
|
||||
rebuildJobIndex();
|
||||
renderQueueTable();
|
||||
return { before, after };
|
||||
})()\`);
|
||||
check('Queue filter reset clears sidebar, search, host, and status together', queueFilterReset.before.hidden === false && queueFilterReset.before.disabled === false && queueFilterReset.after.hidden === true && queueFilterReset.after.disabled === true && queueFilterReset.after.sidebar === 'all' && queueFilterReset.after.search === '' && queueFilterReset.after.hoster === '' && queueFilterReset.after.status === '' && queueFilterReset.after.allPressed === 'true' && queueFilterReset.after.visible === 'filter-a|filter-b');
|
||||
|
||||
const queueSelectionAnchor = await wc.executeJavaScript(\`(() => {
|
||||
queueJobs = ['a', 'b', 'c', 'd'].map(id => ({ id: 'anchor-' + id, file: 'C:/ui/anchor-' + id + '.bin', fileName: 'anchor-' + id + '.bin', hoster: 'byse.sx', status: 'queued', bytesUploaded: 0, bytesTotal: 100, progress: 0 }));
|
||||
selectedJobIds.clear();
|
||||
|
||||
Reference in New Issue
Block a user