fix: return All magazines to library
Some checks are pending
Test and SonarQube / quality (push) Waiting to run
Some checks are pending
Test and SonarQube / quality (push) Waiting to run
This commit is contained in:
parent
272d4872bd
commit
c1d86ec13d
12
CHANGELOG.md
12
CHANGELOG.md
@ -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
|
## [1.26.4] — 2026-09-09
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@ -142,10 +142,12 @@ function renderLibrary() {
|
|||||||
: ing.status === 'running' ? '<span class="mag-pill warn">ingesting…</span>'
|
: ing.status === 'running' ? '<span class="mag-pill warn">ingesting…</span>'
|
||||||
: ing.status === 'failed' ? '<span class="mag-pill bad">failed</span>'
|
: ing.status === 'failed' ? '<span class="mag-pill bad">failed</span>'
|
||||||
: '<span class="mag-pill">not ingested</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 + '\')">' +
|
return '<button type="button" class="mag-card" onclick="magOpen(\'' + d.id + '\')">' +
|
||||||
'<span class="mag-card-title">' + esc(d.title || 'Untitled') + '</span>' +
|
thumbnail + '<span class="mag-card-title">' + esc(d.title || 'Untitled') + '</span>' +
|
||||||
'<span class="mag-card-sub">' + esc(d.issue || '') + '</span>' +
|
'<span class="mag-card-sub">' + esc(d.issue || '') + '</span>' + badge + '</button>';
|
||||||
badge + '</button>';
|
|
||||||
}).join('');
|
}).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1469,6 +1471,21 @@ function magBackToContents() {
|
|||||||
magRefreshArticles();
|
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 ──────────────────────────────────────────────────────────
|
// ── Driving mode ──────────────────────────────────────────────────────────
|
||||||
// Large, minimal-interaction controls for listening without looking at the
|
// Large, minimal-interaction controls for listening without looking at the
|
||||||
// screen (see Manual.md's planned driving-mode behaviour). Reuses whatever
|
// screen (see Manual.md's planned driving-mode behaviour). Reuses whatever
|
||||||
@ -1553,6 +1570,7 @@ root.magSetPane = magSetPane;
|
|||||||
root.magPeekPage = magPeekPage;
|
root.magPeekPage = magPeekPage;
|
||||||
root.magShow = magShow;
|
root.magShow = magShow;
|
||||||
root.magBackToContents = magBackToContents;
|
root.magBackToContents = magBackToContents;
|
||||||
|
root.magBackToLibrary = magBackToLibrary;
|
||||||
root.magGeneratePodcast = magGeneratePodcast;
|
root.magGeneratePodcast = magGeneratePodcast;
|
||||||
root.magPlayPodcast = magPlayPodcast;
|
root.magPlayPodcast = magPlayPodcast;
|
||||||
root.magPlayAll = magPlayAll;
|
root.magPlayAll = magPlayAll;
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
<!-- ── Contents ─────────────────────────────────────────────────────── -->
|
<!-- ── Contents ─────────────────────────────────────────────────────── -->
|
||||||
<div id="mag-view-contents" hidden>
|
<div id="mag-view-contents" hidden>
|
||||||
<div class="mag-bar">
|
<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
|
<span class="mdi mdi-arrow-left"></span> All magazines
|
||||||
</button>
|
</button>
|
||||||
<h3 id="mag-doc-title">Magazine</h3>
|
<h3 id="mag-doc-title">Magazine</h3>
|
||||||
|
|||||||
@ -4782,6 +4782,8 @@ input[list="lang-codes"] {
|
|||||||
background: var(--surface); color: var(--text); cursor: pointer; }
|
background: var(--surface); color: var(--text); cursor: pointer; }
|
||||||
.mag-card:hover { border-color: var(--accent); }
|
.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: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-title { font-weight: 600; }
|
||||||
.mag-card-sub { color: var(--subtext); font-size: 13px; }
|
.mag-card-sub { color: var(--subtext); font-size: 13px; }
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user