fix(web): lecteur PDF — pages blanches après rendu et base minimale stable

Le canvas PDF restait vide après rendu (blank-detected): la détection d'encre
reposait sur un seuil de blanc trop sensible et un fond de canvas non maîtrisé.
Le rendu passe à un fond sentinel explicite avec classification
rendered-ok/blank-detected et un seuil de pixels visibles.

Le lecteur est par ailleurs ramené à une base minimale stable: layout plein
viewport (app-main-reader), suppression des modes de lecture et des préférences
par livre, helpers de pagination/viewport extraits dans readerLayout.ts. Shell,
lecteurs CBZ/EPUB et styles alignés sur cette base.

Refs #31

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Git Agent
2026-08-24 12:52:49 +02:00
parent 7cc44871d9
commit 50a0b392e1
10 changed files with 662 additions and 714 deletions

View File

@ -68,6 +68,13 @@ main {
padding: 28px;
}
main.app-main-reader {
height: 100vh;
min-height: 0;
padding: 0;
overflow: hidden;
}
.page-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
@ -856,87 +863,82 @@ select {
.reader-page {
display: grid;
grid-template-rows: auto auto minmax(0, 1fr) auto;
gap: 10px;
grid-template-rows: auto auto minmax(0, 1fr);
gap: 8px;
height: 100vh;
min-height: 100vh;
padding: 14px;
padding: 10px;
overflow: hidden;
background: #120e0b;
}
.reader-page:fullscreen {
width: 100vw;
height: 100vh;
main.app-main-reader .reader-page {
height: 100%;
min-height: 0;
}
.reader-topbar {
position: relative;
z-index: 5;
justify-content: space-between;
padding: 10px;
grid-row: 1;
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
min-height: 42px;
padding: 6px 8px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: rgba(38, 26, 18, 0.84);
}
.reader-topbar div {
display: grid;
justify-items: center;
}
.reader-topbar span {
color: var(--ink-muted);
font-size: 0.82rem;
}
.reader-toolbar {
display: flex;
align-items: center;
gap: 8px;
}
.reader-toolbar .icon-only {
width: 40px;
padding: 0;
}
.reader-toolbar .reader-mode-button {
gap: 7px;
padding-inline: 10px;
.reader-title {
flex: 1 1 auto;
overflow: hidden;
min-width: 0;
max-width: none;
text-overflow: ellipsis;
white-space: nowrap;
}
.reader-toolbar .active {
border-color: rgba(213, 168, 77, 0.72);
color: var(--brass);
background: rgba(213, 168, 77, 0.14);
.reader-position {
flex: 0 0 auto;
min-width: 92px;
color: var(--ink-muted);
text-align: center;
}
.reader-topbar .ghost-button {
flex: 0 0 auto;
min-height: 32px;
white-space: nowrap;
}
.reader-status {
position: relative;
z-index: 4;
grid-row: 2;
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.reader-stage {
grid-row: 3;
position: relative;
display: grid;
place-items: stretch;
place-items: center;
min-height: 0;
min-width: 0;
padding: 0;
overflow: hidden;
}
.reader-mode-vertical .reader-stage {
overflow-y: auto;
overscroll-behavior: contain;
}
.reader-content {
display: grid;
place-items: center;
min-height: 0;
min-width: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.pdf-reader,
@ -950,19 +952,19 @@ select {
height: 100%;
}
.pdf-reader-vertical,
.cbz-reader-vertical {
place-items: start center;
height: auto;
}
.epub-host {
display: grid;
width: min(100%, 980px);
width: 100%;
height: 100%;
min-height: 0;
}
.epub-reader {
place-items: stretch;
overflow: auto;
padding: 14px;
}
.epub-view {
width: 100%;
height: 100%;
@ -982,56 +984,23 @@ select {
margin: 0;
}
.pdf-page-frame canvas {
.pdf-page-frame canvas,
.cbz-reader img {
display: block;
max-width: min(100%, 980px);
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
box-sizing: border-box;
border: 1px solid var(--line);
border-radius: var(--radius);
background: #f7f0df;
object-fit: contain;
}
.cbz-reader img {
display: block;
box-sizing: border-box;
max-width: min(100%, 980px);
max-width: 100%;
max-height: 100%;
border: 1px solid var(--line);
border-radius: var(--radius);
background: #f7f0df;
object-fit: contain;
}
.reader-mode-vertical .pdf-reader,
.reader-mode-vertical .cbz-reader {
align-content: start;
padding-bottom: 20px;
}
.pdf-strip,
.comic-strip {
display: grid;
justify-items: center;
gap: 18px;
width: 100%;
padding: 0 0 24px;
}
.reader-mode-vertical .pdf-page-frame canvas,
.reader-mode-vertical .cbz-reader img {
width: min(100%, 980px);
height: auto;
max-height: none;
object-fit: contain;
}
.reader-mode-horizontal .pdf-page-frame canvas,
.reader-mode-horizontal .cbz-reader img {
width: auto;
height: auto;
max-height: 100%;
object-fit: contain;
}
.reader-fallback {
@ -1044,71 +1013,6 @@ select {
color: var(--ink-muted);
}
.reader-stepper {
position: relative;
z-index: 5;
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
min-height: 46px;
padding: 6px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: rgba(38, 26, 18, 0.84);
}
.reader-stepper span {
min-width: 92px;
color: var(--ink-muted);
text-align: center;
}
.reader-side-button,
.reader-tap-zone {
position: absolute;
top: 0;
bottom: 0;
z-index: 3;
border: 0;
background: transparent;
}
.reader-side-button {
display: grid;
place-items: center;
width: 58px;
color: var(--ink);
opacity: 0.66;
}
.reader-side-button:hover {
opacity: 1;
background: rgba(255, 255, 255, 0.04);
}
.reader-side-button:disabled,
.reader-tap-zone:disabled {
pointer-events: none;
opacity: 0;
}
.reader-side-left,
.reader-tap-left {
left: 0;
}
.reader-side-right,
.reader-tap-right {
right: 0;
}
.reader-tap-zone {
display: none;
width: 34%;
opacity: 0;
}
.reader-error {
display: grid;
gap: 14px;
@ -1186,6 +1090,12 @@ select {
padding: 16px 16px 86px;
}
main.app-main-reader {
height: calc(100vh - 58px);
padding: 0 0 58px;
overflow: hidden;
}
.page-grid {
grid-template-columns: 1fr;
}
@ -1251,71 +1161,7 @@ select {
gap: 8px;
}
.reader-topbar div {
min-width: 0;
}
.reader-topbar strong {
overflow: hidden;
max-width: 38vw;
text-overflow: ellipsis;
white-space: nowrap;
}
.reader-toolbar {
gap: 5px;
}
.reader-side-button {
display: none;
}
.reader-tap-zone {
display: block;
}
.reader-controls-hidden .reader-topbar,
.reader-controls-hidden .reader-status,
.reader-controls-hidden .reader-stepper {
opacity: 0;
pointer-events: none;
}
.reader-controls-hidden {
grid-template-rows: 0 0 minmax(0, 1fr) 0;
gap: 0;
}
.reader-controls-hidden .reader-topbar,
.reader-controls-hidden .reader-status,
.reader-controls-hidden .reader-stepper {
overflow: hidden;
min-height: 0;
padding-top: 0;
padding-bottom: 0;
}
.reader-topbar,
.reader-status,
.reader-stepper {
transition: opacity 0.16s ease;
}
.reader-stepper {
gap: 8px;
}
.reader-stepper .ghost-button {
flex: 1 1 0;
min-width: 0;
}
.epub-host {
width: 100%;
}
.reader-mode-vertical .pdf-reader canvas,
.reader-mode-vertical .cbz-reader img {
width: 100%;
}
}