chore(frontend): tighten eslint/axe gates, remove reader waivers (B5 done, spec ② complete)
This commit is contained in:
@@ -122,6 +122,7 @@ function MdView({ book, initialLocator, initialPercent, chrome }: ReaderProps) {
|
||||
if (text == null) return <LoadState text="正文加载中…" />;
|
||||
return (
|
||||
<div className="rd-surface relative flex h-full flex-col" data-rd={rd}>
|
||||
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events -- 点正文唤出/收起工具栏的手势区;正文滚轮/拖选不涉及键盘操作 */}
|
||||
<div
|
||||
ref={boxRef}
|
||||
onScroll={onScroll}
|
||||
@@ -136,6 +137,8 @@ function MdView({ book, initialLocator, initialPercent, chrome }: ReaderProps) {
|
||||
</div>
|
||||
{chrome.on && (
|
||||
<ReaderSettings
|
||||
themeMode={pr.prefs.themeMode}
|
||||
onThemeMode={pr.setThemeMode}
|
||||
slider={{
|
||||
value: Math.round(frac * 1000),
|
||||
max: 1000,
|
||||
@@ -157,6 +160,7 @@ function MdView({ book, initialLocator, initialPercent, chrome }: ReaderProps) {
|
||||
}
|
||||
showFont
|
||||
onFont={pr.bumpText}
|
||||
fontIdx={pr.prefs.text.sizeIdx}
|
||||
extra={
|
||||
<>
|
||||
<LineHeightRow pr={pr} />
|
||||
@@ -247,7 +251,7 @@ function TxtView({ book, initialLocator, initialPercent, chrome }: ReaderProps)
|
||||
const rawCh = Number(initialLocator?.ch);
|
||||
if (Number.isFinite(rawCh) && rawCh >= 0 && rawCh < chapters.length) {
|
||||
targetCi.current = Math.floor(rawCh);
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- 首章渲染后按缓存 locator 落位阅读进度;ci 与下方滚动定位 effect/refs 协作,改渲染期重置属高风险重构,保守保留
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- 首章渲染后按缓存 locator 落位阅读进度:ci 落位与下方滚动定位 effect/refs 协作,生命周期与恢复进度语义同源,保留带理由
|
||||
setCi(Math.floor(rawCh));
|
||||
if (hasF) restoreFrac.current = f;
|
||||
} else if (hasF) {
|
||||
@@ -311,6 +315,7 @@ function TxtView({ book, initialLocator, initialPercent, chrome }: ReaderProps)
|
||||
|
||||
return (
|
||||
<div className="rd-surface relative flex h-full flex-col" data-rd={rd}>
|
||||
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events -- 点正文唤出/收起工具栏的手势区;点按是唯一唤出途径,键盘用户由常驻工具条提供全部控制 */}
|
||||
<div
|
||||
ref={boxRef}
|
||||
onScroll={onScroll}
|
||||
@@ -326,6 +331,8 @@ function TxtView({ book, initialLocator, initialPercent, chrome }: ReaderProps)
|
||||
</div>
|
||||
{chrome.on && (
|
||||
<ReaderSettings
|
||||
themeMode={pr.prefs.themeMode}
|
||||
onThemeMode={pr.setThemeMode}
|
||||
slider={{
|
||||
value: Math.round(total * 1000),
|
||||
max: 1000,
|
||||
@@ -367,6 +374,7 @@ function TxtView({ book, initialLocator, initialPercent, chrome }: ReaderProps)
|
||||
}
|
||||
showFont
|
||||
onFont={pr.bumpText}
|
||||
fontIdx={pr.prefs.text.sizeIdx}
|
||||
extra={
|
||||
<>
|
||||
<LineHeightRow pr={pr} />
|
||||
|
||||
Reference in New Issue
Block a user