Fix L67/L86: Onboarding Skip button; clear hidden selections on filter change
L67: Onboarding now has a 'Skip' button alongside 'Get started', both in a
right-aligned flex row. Both call update({hasCompletedOnboarding:true})
so the behavior is the same — Skip just reads as optional for users who
want to get started immediately without reading the tips.
L86: HistoryView now clears any selected IDs that are no longer visible when
the filter (query or kind) changes. A useEffect on `filtered` intersects
the current selection with the new visible set and calls setSelected only
if the size actually changed (avoids re-renders when the filter doesn't
affect the selection).
typecheck + 242 tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import {
|
||||
Text,
|
||||
Caption1,
|
||||
@@ -173,6 +173,16 @@ export function HistoryView(): React.JSX.Element {
|
||||
})
|
||||
}, [entries, query, kindFilter])
|
||||
|
||||
// Clear selections that are no longer visible after a filter change (L86).
|
||||
useEffect(() => {
|
||||
if (selected.size === 0) return
|
||||
const visible = new Set(filtered.map((h) => h.id))
|
||||
setSelected((prev) => {
|
||||
const next = new Set([...prev].filter((id) => visible.has(id)))
|
||||
return next.size === prev.size ? prev : next
|
||||
})
|
||||
}, [filtered])
|
||||
|
||||
function redownload(h: HistoryEntry): void {
|
||||
// Strip compound format labels ("720p · mp4 · 184 MB" → "720p") when there is
|
||||
// no stored formatId, so videoFormat() can still match the preset (H5).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {
|
||||
import {
|
||||
Card,
|
||||
Title2,
|
||||
Body1,
|
||||
@@ -72,6 +72,11 @@ const useStyles = makeStyles({
|
||||
flexShrink: 0,
|
||||
marginTop: '2px',
|
||||
color: tokens.colorCompoundBrandForeground1
|
||||
},
|
||||
btnRow: {
|
||||
display: 'flex',
|
||||
justifyContent: 'flex-end',
|
||||
gap: '8px'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -126,13 +131,21 @@ export function Onboarding(): React.JSX.Element {
|
||||
))}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
appearance="primary"
|
||||
icon={<RocketRegular />}
|
||||
onClick={() => update({ hasCompletedOnboarding: true })}
|
||||
>
|
||||
Get started
|
||||
</Button>
|
||||
<div className={styles.btnRow}>
|
||||
<Button
|
||||
appearance="subtle"
|
||||
onClick={() => update({ hasCompletedOnboarding: true })}
|
||||
>
|
||||
Skip
|
||||
</Button>
|
||||
<Button
|
||||
appearance="primary"
|
||||
icon={<RocketRegular />}
|
||||
onClick={() => update({ hasCompletedOnboarding: true })}
|
||||
>
|
||||
Get started
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user