🐛 fix: Ctrl+A selects correct panel (queue vs recent files)
Ctrl+A now properly respects which panel the user last clicked: - Click in queue table → Ctrl+A selects all queue jobs - Click in recent files panel → Ctrl+A selects all recent files - Clicking one panel clears the other panel's selection Previously, if any recent file was ever selected, Ctrl+A would always select recent files even when the user was working in the queue. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f6afdad5ba
commit
68fc064999
@ -957,6 +957,8 @@ function getStatusText(job) {
|
||||
// --- Queue interactions ---
|
||||
function handleRowClick(e, row) {
|
||||
const jobId = row.dataset.jobId;
|
||||
// Clear recent panel selection when clicking in queue
|
||||
if (selectedRecentIds.size > 0) { selectedRecentIds.clear(); renderRecentUploadsPanel(); }
|
||||
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
if (selectedJobIds.has(jobId)) selectedJobIds.delete(jobId);
|
||||
@ -1161,8 +1163,8 @@ document.addEventListener('keydown', (e) => {
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
||||
if (activeView && activeView.id === 'upload-view') {
|
||||
e.preventDefault();
|
||||
// If recent files panel is focused / has selection, select all recent files
|
||||
if (selectedRecentIds.size > 0 || document.activeElement?.closest('.recent-files-panel')) {
|
||||
// Select recent files only if user's last interaction was in the recent panel
|
||||
if (selectedRecentIds.size > 0 && selectedJobIds.size === 0) {
|
||||
sessionFilesData.forEach(r => selectedRecentIds.add(r.order));
|
||||
renderRecentUploadsPanel();
|
||||
} else if (queueJobs.length > 0) {
|
||||
@ -2892,6 +2894,8 @@ function renderRecentUploadsPanel() {
|
||||
tbody.addEventListener('click', (e) => {
|
||||
const tr = e.target.closest('.recent-file-row');
|
||||
if (!tr) return;
|
||||
// Clear queue selection when clicking in recent panel
|
||||
if (selectedJobIds.size > 0) { selectedJobIds.clear(); renderQueueTable(); updateQueueActionButtons(); }
|
||||
const id = parseInt(tr.dataset.order, 10);
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
if (selectedRecentIds.has(id)) selectedRecentIds.delete(id);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user