Skip to content

Commit 84a73ec

Browse files
committed
feat: unify scrolling behavior in DetailOverlay for improved user experience, enhancing visual flow between banner and content
1 parent 681091a commit 84a73ec

6 files changed

Lines changed: 37 additions & 13 deletions

File tree

marchen/.search/index.sqlite

4 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: detail-overlay-unified-scroll
2+
schema: lite
3+
createdAt: '2026-05-24T12:39:50.275Z'
4+
status: archived
5+
archivedAt: '2026-05-24T12:42:45.434Z'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## 背景
2+
3+
`DetailOverlay` 当前是「banner 固定 + body 独立滚动」双滚动区,poster 用 `margin-top:-120px` 上溢到 banner。滚动时 banner 不动、poster 跟 body 上移,导致 poster 上半被 banner 遮住下半露在内容区,视觉破碎。
4+
5+
改为「统一滚动容器」(Apple TV+ / Infuse 标准模式):banner 与 body 一起流式滚动,新增 `.library-dt-scroll` 包裹两者并接管滚动。close 按钮保持 absolute 不随滚动。
6+
7+
## 1. 改 DOM
8+
9+
- [x] 1.1 `DetailOverlay.tsx`:在 banner 和 body 外面套一个 `<div className="library-dt-scroll">`(close 按钮仍留在 `.library-dt` 下)
10+
11+
## 2. 改样式
12+
13+
- [x] 2.1 `library.css` `.library-dt`:去掉 `display: flex; flex-direction: column`(不再需要分割两块)
14+
- [x] 2.2 `library.css` 新增 `.library-dt-scroll``height: 100%; overflow-y: auto;` + 复用原 body 滚动条样式
15+
- [x] 2.3 `library.css` `.library-dt-banner`:去掉 `flex-shrink: 0`(不再是 flex 子项)
16+
- [x] 2.4 `library.css` `.library-dt-body`:去掉 `flex: 1; overflow-y: auto`,保留 `margin-top: -120px` 与 grid 布局
17+
- [x] 2.5 `library.css` 滚动条选择器从 `.library-dt-body` 改到 `.library-dt-scroll`

marchen/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@
2525
- 2026-05-24: [fix-episode-progress-priority](./archive/2026-05-24-fix-episode-progress-priority/) — 剧集进度列改为实时 pct 优先于 watched 标记,避免曾看完后回拖仍显示 ✓
2626
- 2026-05-24: [write-last-watched-on-load](./archive/2026-05-24-write-last-watched-on-load/) — 开始播放即写 lastWatchedEpisodeId/At,isWatching 放宽以让浅看作品进入继续观看 Rail
2727
- 2026-05-24: [fix-library-progress-display](./archive/2026-05-24-fix-library-progress-display/) — ctaLabel 走 lastWatched 指针、删 NEXT 徽章、Hero/Landscape 改用 lastWatched 集的单集进度
28+
- 2026-05-24: [detail-overlay-unified-scroll](./archive/2026-05-24-detail-overlay-unified-scroll/) — DetailOverlay 改为统一滚动容器,banner 与内容一起流式滚动消除 poster 半截被遮的视觉

src/renderer/src/page/library/DetailOverlay.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const DetailOverlay: FC<DetailOverlayProps> = memo(({ item, onClose, onPl
7272
<CrossGlyph />
7373
</button>
7474

75+
<div className="library-dt-scroll">
7576
<div className="library-dt-banner">
7677
{item.imageUrl && (
7778
<img
@@ -163,6 +164,7 @@ export const DetailOverlay: FC<DetailOverlayProps> = memo(({ item, onClose, onPl
163164
</div>
164165
</div>
165166
</div>
167+
</div>
166168
</div>
167169
</>
168170
)

src/renderer/src/styles/library.css

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -757,11 +757,21 @@
757757
background: var(--library-bg-2);
758758
border-radius: 14px;
759759
overflow: hidden;
760-
display: flex;
761-
flex-direction: column;
762760
box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--library-line-2);
763761
animation: library-dt-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
764762
}
763+
.library-dt-scroll {
764+
height: 100%;
765+
overflow-y: auto;
766+
scroll-behavior: smooth;
767+
}
768+
.library-dt-scroll::-webkit-scrollbar {
769+
width: 8px;
770+
}
771+
.library-dt-scroll::-webkit-scrollbar-thumb {
772+
background: var(--library-panel-2);
773+
border-radius: 4px;
774+
}
765775
@keyframes library-fade-in {
766776
from {
767777
opacity: 0;
@@ -806,7 +816,6 @@
806816
position: relative;
807817
height: 320px;
808818
overflow: hidden;
809-
flex-shrink: 0;
810819
background: var(--library-panel-2);
811820
}
812821
.library-dt-banner img {
@@ -826,24 +835,14 @@
826835
}
827836

828837
.library-dt-body {
829-
flex: 1;
830-
min-height: 0;
831838
display: grid;
832839
grid-template-columns: 220px 1fr;
833840
gap: 32px;
834841
padding: 0 40px 40px;
835-
overflow-y: auto;
836842
position: relative;
837843
margin-top: -120px;
838844
z-index: 2;
839845
}
840-
.library-dt-body::-webkit-scrollbar {
841-
width: 8px;
842-
}
843-
.library-dt-body::-webkit-scrollbar-thumb {
844-
background: var(--library-panel-2);
845-
border-radius: 4px;
846-
}
847846

848847
.library-dt-poster {
849848
width: 220px;

0 commit comments

Comments
 (0)