q6 commited on
Commit
2d727b9
·
1 Parent(s): 3624a91

Fix reclass summary and panel sizing

Browse files
Files changed (2) hide show
  1. frontend/app.js +24 -14
  2. frontend/style.css +20 -4
frontend/app.js CHANGED
@@ -498,8 +498,6 @@ async function refreshReclassDetail(id) {
498
 
499
  function renderReclassDetail(data) {
500
  const grid = $("#results-grid")
501
- const refreshing = grid.classList.contains("log-grid")
502
- const scrollTop = grid.scrollTop
503
  $("#exif-filters").innerHTML = ""
504
  $("#pager").innerHTML = ""
505
  const filters = (data.summary.filters || data.filters.map(code => CATEGORY_NAMES[code] || code)).join(", ")
@@ -513,18 +511,30 @@ function renderReclassDetail(data) {
513
  </div>`).join("")
514
  : `<div class="empty-log">No classification changes</div>`
515
  grid.classList.add("log-grid")
516
- grid.innerHTML = `<div class="reclass-panel">
517
- <h2>Summary</h2>
518
- <div class="summary-grid">
519
- <span>Total</span><strong>${data.total}</strong>
520
- <span>Scanned</span><strong>${data.scanned}</strong>
521
- <span>Changed</span><strong>${data.changed}</strong>
522
- </div>
523
- <h2>Detailed log</h2>
524
- <div class="log-head"><span>Post ID</span><span>From</span><span>To</span></div>
525
- <div class="log-list">${log}</div>
526
- </div>`
527
- if (refreshing) grid.scrollTop = scrollTop
 
 
 
 
 
 
 
 
 
 
 
 
528
  if (data.active) {
529
  clearTimeout(reclassDetailTimer)
530
  reclassDetailTimer = setTimeout(() => refreshReclassDetail(data.id), 2500)
 
498
 
499
  function renderReclassDetail(data) {
500
  const grid = $("#results-grid")
 
 
501
  $("#exif-filters").innerHTML = ""
502
  $("#pager").innerHTML = ""
503
  const filters = (data.summary.filters || data.filters.map(code => CATEGORY_NAMES[code] || code)).join(", ")
 
511
  </div>`).join("")
512
  : `<div class="empty-log">No classification changes</div>`
513
  grid.classList.add("log-grid")
514
+ const panel = grid.querySelector(".reclass-panel")
515
+ if (panel && panel.querySelector("[data-count]")) {
516
+ panel.querySelector('[data-count="total"]').textContent = data.total
517
+ panel.querySelector('[data-count="scanned"]').textContent = data.scanned
518
+ panel.querySelector('[data-count="changed"]').textContent = data.changed
519
+ const list = panel.querySelector(".log-list")
520
+ if (list.innerHTML !== log) {
521
+ const scrollTop = list.scrollTop
522
+ list.innerHTML = log
523
+ list.scrollTop = scrollTop
524
+ }
525
+ } else {
526
+ grid.innerHTML = `<div class="reclass-panel">
527
+ <h2>Summary</h2>
528
+ <div class="summary-grid">
529
+ <div class="summary-item"><span>Total</span><strong data-count="total">${data.total}</strong></div>
530
+ <div class="summary-item"><span>Scanned</span><strong data-count="scanned">${data.scanned}</strong></div>
531
+ <div class="summary-item"><span>Changed</span><strong data-count="changed">${data.changed}</strong></div>
532
+ </div>
533
+ <h2>Detailed log</h2>
534
+ <div class="log-head"><span>Post ID</span><span>From</span><span>To</span></div>
535
+ <div class="log-list">${log}</div>
536
+ </div>`
537
+ }
538
  if (data.active) {
539
  clearTimeout(reclassDetailTimer)
540
  reclassDetailTimer = setTimeout(() => refreshReclassDetail(data.id), 2500)
frontend/style.css CHANGED
@@ -329,10 +329,14 @@ input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a
329
  height: calc(100vh - 190px);
330
  min-height: 18rem;
331
  max-height: 46rem;
 
332
  }
333
  .reclass-panel {
334
  display: grid;
 
335
  gap: .75rem;
 
 
336
  padding: .9rem;
337
  background: var(--panel);
338
  border: 1px solid var(--line);
@@ -343,20 +347,30 @@ input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a
343
  color: var(--text);
344
  font-size: .95rem;
345
  }
346
- .summary-grid, .log-head, .log-row {
347
  display: grid;
348
  grid-template-columns: 1fr 1fr 1fr;
349
  gap: .5rem;
350
  align-items: center;
351
  }
352
  .summary-grid {
353
- grid-template-columns: repeat(3, auto minmax(2rem, 1fr));
 
 
354
  max-width: 34rem;
355
  color: var(--muted);
356
  }
 
 
 
 
 
357
  .summary-grid strong {
358
  color: var(--accent);
 
 
359
  }
 
360
  .log-head, .log-row {
361
  min-height: 34px;
362
  padding: 0 .55rem;
@@ -520,6 +534,8 @@ input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a
520
  .detail-header { grid-template-columns: 1fr; }
521
  .exif-filters { justify-content: start; max-width: none; }
522
  #results-grid, #post-search-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: none; }
523
- #results-grid.log-grid { height: auto; min-height: 0; }
524
- .summary-grid { grid-template-columns: auto 1fr; }
 
 
525
  }
 
329
  height: calc(100vh - 190px);
330
  min-height: 18rem;
331
  max-height: 46rem;
332
+ overflow: hidden;
333
  }
334
  .reclass-panel {
335
  display: grid;
336
+ grid-template-rows: auto auto auto auto minmax(0, 1fr);
337
  gap: .75rem;
338
+ height: 100%;
339
+ overflow: hidden;
340
  padding: .9rem;
341
  background: var(--panel);
342
  border: 1px solid var(--line);
 
347
  color: var(--text);
348
  font-size: .95rem;
349
  }
350
+ .log-head, .log-row {
351
  display: grid;
352
  grid-template-columns: 1fr 1fr 1fr;
353
  gap: .5rem;
354
  align-items: center;
355
  }
356
  .summary-grid {
357
+ display: grid;
358
+ grid-template-columns: repeat(3, minmax(0, 1fr));
359
+ gap: .75rem;
360
  max-width: 34rem;
361
  color: var(--muted);
362
  }
363
+ .summary-item {
364
+ display: grid;
365
+ grid-template-columns: auto minmax(2rem, 1fr);
366
+ gap: .5rem;
367
+ }
368
  .summary-grid strong {
369
  color: var(--accent);
370
+ font-variant-numeric: tabular-nums;
371
+ text-align: end;
372
  }
373
+ .log-list { min-height: 0; overflow-y: auto; }
374
  .log-head, .log-row {
375
  min-height: 34px;
376
  padding: 0 .55rem;
 
534
  .detail-header { grid-template-columns: 1fr; }
535
  .exif-filters { justify-content: start; max-width: none; }
536
  #results-grid, #post-search-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: none; }
537
+ #results-grid.log-grid { height: auto; min-height: 0; overflow: visible; }
538
+ .reclass-panel { height: auto; overflow: visible; }
539
+ .log-list { overflow: visible; }
540
+ .summary-grid { grid-template-columns: 1fr; }
541
  }