fix: return All magazines to library
Some checks are pending
Test and SonarQube / quality (push) Waiting to run

This commit is contained in:
mARTin-B78 2026-09-09 17:14:27 +02:00
parent 272d4872bd
commit c1d86ec13d
5 changed files with 37 additions and 5 deletions

View File

@ -9,6 +9,18 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
---
## [1.26.5] — 2026-09-09
### Fixed
- **“All magazines” Returned to the Wrong Place.** The contents-page button now clears the remembered active issue,
refreshes the actual magazine library, and reliably returns to it instead of only switching an internal view.
### Added
- **Magazine First-Page Thumbnails.** Each magazine card now displays page 1 of its source PDF as a lazy-loaded,
aspect-ratio-preserving thumbnail.
---
## [1.26.4] — 2026-09-09
### Added

View File

@ -1 +1 @@
1.26.4
1.26.5

View File

@ -142,10 +142,12 @@ function renderLibrary() {
: ing.status === 'running' ? '<span class="mag-pill warn">ingesting…</span>'
: ing.status === 'failed' ? '<span class="mag-pill bad">failed</span>'
: '<span class="mag-pill">not ingested</span>';
const thumbnail = '<img class="mag-card-thumb" src="/api/magazine/' + encodeURIComponent(d.id) +
'/pages/1" alt="First page of ' + esc(d.title || 'magazine') +
'" loading="lazy" onerror="this.hidden=true">';
return '<button type="button" class="mag-card" onclick="magOpen(\'' + d.id + '\')">' +
'<span class="mag-card-title">' + esc(d.title || 'Untitled') + '</span>' +
'<span class="mag-card-sub">' + esc(d.issue || '') + '</span>' +
badge + '</button>';
thumbnail + '<span class="mag-card-title">' + esc(d.title || 'Untitled') + '</span>' +
'<span class="mag-card-sub">' + esc(d.issue || '') + '</span>' + badge + '</button>';
}).join('');
}
@ -1469,6 +1471,21 @@ function magBackToContents() {
magRefreshArticles();
}
async function magBackToLibrary() {
// This button was previously labeled "All magazines" but only switched the
// current view; after a reload magInit could immediately reopen the saved
// document. Clear that remembered document and refresh the actual library.
magPause();
magStopQueue();
state.driving = false;
magForgetLastDoc();
state.doc = null;
state.article = null;
magShow('library');
try { await magLoadLibrary(); }
catch (e) { say('Could not refresh magazines: ' + e.message, 'err'); }
}
// ── Driving mode ──────────────────────────────────────────────────────────
// Large, minimal-interaction controls for listening without looking at the
// screen (see Manual.md's planned driving-mode behaviour). Reuses whatever
@ -1553,6 +1570,7 @@ root.magSetPane = magSetPane;
root.magPeekPage = magPeekPage;
root.magShow = magShow;
root.magBackToContents = magBackToContents;
root.magBackToLibrary = magBackToLibrary;
root.magGeneratePodcast = magGeneratePodcast;
root.magPlayPodcast = magPlayPodcast;
root.magPlayAll = magPlayAll;

View File

@ -41,7 +41,7 @@
<!-- ── Contents ─────────────────────────────────────────────────────── -->
<div id="mag-view-contents" hidden>
<div class="mag-bar">
<button type="button" class="btn-sm" onclick="magForgetLastDoc();magShow('library')">
<button type="button" class="btn-sm" onclick="magBackToLibrary()">
<span class="mdi mdi-arrow-left"></span> All magazines
</button>
<h3 id="mag-doc-title">Magazine</h3>

View File

@ -4782,6 +4782,8 @@ input[list="lang-codes"] {
background: var(--surface); color: var(--text); cursor: pointer; }
.mag-card:hover { border-color: var(--accent); }
.mag-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.mag-card-thumb { display: block; width: 100%; height: 190px; object-fit: contain; object-position: center;
background: var(--panel); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); }
.mag-card-title { font-weight: 600; }
.mag-card-sub { color: var(--subtext); font-size: 13px; }