mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
fix(frontend): skeleton replacement ordering and col-check alignment
- Await the entry list refresh before removing the skeleton so the real row arrives before the placeholder disappears. handleCaptured now returns its Promise.all; startPolling awaits it before calling onJobSettled on the success path. - Add col-check as the first child of SkeletonEntryRow to match EntryRow's DOM structure; without it, columns misalign on touch devices where col-check becomes display:flex.
This commit is contained in:
parent
3bd61e944e
commit
e8ee0f5de9
3 changed files with 3 additions and 2 deletions
|
|
@ -436,7 +436,7 @@ export default function App() {
|
||||||
|
|
||||||
const handleCaptured = useCallback(() => {
|
const handleCaptured = useCallback(() => {
|
||||||
if (!archiveId) return
|
if (!archiveId) return
|
||||||
Promise.all([
|
return Promise.all([
|
||||||
loadEntries(archiveId, searchQuery, tagFilter),
|
loadEntries(archiveId, searchQuery, tagFilter),
|
||||||
fetchRuns(archiveId).then(setRuns),
|
fetchRuns(archiveId).then(setRuns),
|
||||||
])
|
])
|
||||||
|
|
|
||||||
|
|
@ -206,8 +206,8 @@ export default function CaptureDialog({ open, archiveId, onClose, onCaptured, on
|
||||||
if (updated.status === 'completed') {
|
if (updated.status === 'completed') {
|
||||||
clearInterval(pollIntervals.current.get(jobUid))
|
clearInterval(pollIntervals.current.get(jobUid))
|
||||||
pollIntervals.current.delete(jobUid)
|
pollIntervals.current.delete(jobUid)
|
||||||
|
await Promise.resolve(onCapturedRef.current?.())
|
||||||
onJobSettledRef.current?.(bgJobId)
|
onJobSettledRef.current?.(bgJobId)
|
||||||
onCapturedRef.current()
|
|
||||||
try {
|
try {
|
||||||
const notes = updated.notes_json ? JSON.parse(updated.notes_json) : null
|
const notes = updated.notes_json ? JSON.parse(updated.notes_json) : null
|
||||||
if (notes?.ublock_skipped || notes?.cookie_ext_skipped) {
|
if (notes?.ublock_skipped || notes?.cookie_ext_skipped) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
export default function SkeletonEntryRow() {
|
export default function SkeletonEntryRow() {
|
||||||
return (
|
return (
|
||||||
<div className="skeleton-row">
|
<div className="skeleton-row">
|
||||||
|
<div className="col-check" aria-hidden="true" />
|
||||||
<div className="col-added">
|
<div className="col-added">
|
||||||
<span className="skeleton-cell" style={{ width: 108, height: 13 }} />
|
<span className="skeleton-cell" style={{ width: 108, height: 13 }} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue