Skip to content

Commit 0ddd04f

Browse files
authored
Merge pull request #248 from appergb/fix/overview-no-scroll-243
fix(ui): 概览页整屏不滚 + 其他页 scrollbar 变细 (#243)
2 parents f87e598 + fd0b2fd commit 0ddd04f

7 files changed

Lines changed: 33 additions & 9 deletions

File tree

openless-all/app/src/components/FloatingShell.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,14 @@ function FloatingShellBody({ os, initialTab, initialSettings }: { os: OS; initia
260260
两列内部各自的 overflow:auto 才能独立滚动 */}
261261
<div
262262
key={displayTab}
263+
// issue #243:所有 tab 都允许 overflow:auto,让窗口被压缩 / 文案
264+
// 变长时仍可触达底部内容(Codex P1:之前 overview 用 hidden
265+
// 会让缩窗后 Recent 卡彻底不可见)。
266+
// - Overview 借 Overview.tsx 内部 flex 把底部行 grow 到撑满,
267+
// 正常尺寸下内容刚好占满 → 浏览器自动不显示 scrollbar;
268+
// 真挤不下了才 fallback 出细滚动条。
269+
// - 其他 tab 同样走细滚动条。
270+
className="ol-thinscroll"
263271
style={{
264272
flex: 1, minHeight: 0,
265273
overflow: 'auto',

openless-all/app/src/components/SettingsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function SettingsModal({ os: _os, onClose, initialSettingsSection }: Sett
164164
</div>
165165
) : (
166166
// personalize / about 短内容:单一 scroll wrapper,超出时本块滚动。
167-
<div style={{ flex: 1, minHeight: 0, overflow: 'auto', padding: '10px 28px 28px' }}>
167+
<div className="ol-thinscroll" style={{ flex: 1, minHeight: 0, overflow: 'auto', padding: '10px 28px 28px' }}>
168168
{section === 'personalize' && <PersonalizeSection />}
169169
{section === 'about' && <AboutMini />}
170170
</div>

openless-all/app/src/pages/History.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function History() {
126126
))}
127127
</div>
128128
</div>
129-
<div style={{ flex: 1, overflow: 'auto', padding: 6 }}>
129+
<div className="ol-thinscroll" style={{ flex: 1, overflow: 'auto', padding: 6 }}>
130130
{loading && <div style={{ padding: 16, fontSize: 12, color: 'var(--ol-ink-4)' }}>{t('common.loading')}</div>}
131131
{!loading && filtered.length === 0 && (
132132
<div style={{ padding: 16, fontSize: 12, color: 'var(--ol-ink-4)' }}>
@@ -164,7 +164,7 @@ export function History() {
164164
</div>
165165
</Card>
166166

167-
<Card padding={20} style={{ overflow: 'auto' }}>
167+
<Card padding={20} className="ol-thinscroll" style={{ overflow: 'auto' }}>
168168
{item ? (
169169
<>
170170
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 14 }}>

openless-all/app/src/pages/Overview.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@ export function Overview({ onOpenHistory }: OverviewProps) {
9494
<Metric icon="bolt" label={t('overview.metricTotal')} value={String(history.length)} trend={t('overview.metricTotalTrend')} accent />
9595
</div>
9696

97-
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1.4fr', gap: 12 }}>
98-
<Card padding={18}>
97+
{/* 底部一行 = flex:1 撑满剩余高度(父 wrapper 是 display:flex/column)。
98+
只有「最近识别」内部允许滚动;其他卡片按内容自然高度,不破裂底部圆角。
99+
issue #243 follow-up:去掉外层 overflow 后底部圆角被裁的视觉问题。 */}
100+
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1.4fr', gap: 12, flex: 1, minHeight: 0 }}>
101+
<Card padding={18} style={{ display: 'flex', flexDirection: 'column', minHeight: 0 }}>
99102
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 14 }}>
100103
<span style={{ fontSize: 12, fontWeight: 600, color: 'var(--ol-ink-2)' }}>{t('overview.weekTitle')}</span>
101104
<span style={{ fontSize: 11, color: 'var(--ol-ink-4)' }}>{t('overview.weekUnit')}</span>
@@ -106,12 +109,12 @@ export function Overview({ onOpenHistory }: OverviewProps) {
106109
</div>
107110
</Card>
108111

109-
<Card padding={0}>
110-
<div style={{ padding: '14px 18px', borderBottom: '0.5px solid var(--ol-line)', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
112+
<Card padding={0} style={{ display: 'flex', flexDirection: 'column', minHeight: 0, overflow: 'hidden' }}>
113+
<div style={{ padding: '14px 18px', borderBottom: '0.5px solid var(--ol-line)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexShrink: 0 }}>
111114
<span style={{ fontSize: 12, fontWeight: 600, color: 'var(--ol-ink-2)' }}>{t('overview.recentTitle')}</span>
112115
<Btn size="sm" variant="ghost" onClick={onOpenHistory}>{t('overview.recentAll')}</Btn>
113116
</div>
114-
<div>
117+
<div className="ol-thinscroll" style={{ flex: 1, minHeight: 0, overflow: 'auto' }}>
115118
{history.length === 0 && (
116119
<div style={{ padding: 24, textAlign: 'center', fontSize: 12, color: 'var(--ol-ink-4)' }}>
117120
{t('overview.recentEmpty', { trigger: getHotkeyTriggerLabel(hotkey?.trigger) })}

openless-all/app/src/pages/Settings.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export function Settings({ embedded = false, initialSection = 'recording' }: Set
115115
))}
116116
</div>
117117
<div
118+
className={embedded ? 'ol-thinscroll' : undefined}
118119
style={{
119120
display: 'flex',
120121
flexDirection: 'column',

openless-all/app/src/pages/_atoms.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ interface CardProps {
3232
style?: CSSProperties;
3333
padding?: number;
3434
glassy?: boolean;
35+
className?: string;
3536
}
3637

37-
export function Card({ children, style, padding = 18, glassy = false }: CardProps) {
38+
export function Card({ children, style, padding = 18, glassy = false, className }: CardProps) {
3839
return (
3940
<div
41+
className={className}
4042
style={{
4143
background: glassy ? 'rgba(255,255,255,0.55)' : 'var(--ol-surface)',
4244
backdropFilter: glassy ? 'blur(20px) saturate(160%)' : undefined,

openless-all/app/src/styles/tokens.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ body {
7878
.ol-noscrollbar::-webkit-scrollbar { display: none; }
7979
.ol-noscrollbar { scrollbar-width: none; }
8080

81+
/* Thin scrollbar — 细而可见,保留"可以滚"的可见性,但不抢眼。issue #243 */
82+
.ol-thinscroll::-webkit-scrollbar { width: 6px; height: 6px; }
83+
.ol-thinscroll::-webkit-scrollbar-track { background: transparent; }
84+
.ol-thinscroll::-webkit-scrollbar-thumb {
85+
background: rgba(0, 0, 0, 0.18);
86+
border-radius: 3px;
87+
}
88+
.ol-thinscroll::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }
89+
.ol-thinscroll { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.18) transparent; }
90+
8191
/* Glass surface */
8292
.ol-glass {
8393
background: var(--ol-glass-bg);

0 commit comments

Comments
 (0)