Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/renderer/src/components/HomeView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
loadCategories,
setProblemBlocked,
setProblemStarred,
isLoading,
filterUIState,
initFilterUIState,
setFilterUIState,
Expand Down Expand Up @@ -201,9 +202,16 @@
)

const progressPercentage = $derived(
$stats ? Math.round(($stats.practiced / $stats.total) * 100) : 0
$stats && $stats.total > 0 ? Math.round(($stats.practiced / $stats.total) * 100) : 0
)

const emptyListMessage = $derived.by(() => {
if ($isLoading) return 'Loading...'
if (hasActiveFilters) return 'No problems match your filters'
if ($currentProblemSet === 'starred') return 'No problems starred'
return 'No problems found'
})

// Current session quota = min(daily review preference, total due today)
const sessionQuota = $derived(
Math.min($dailyReviewCount, $todayReviewsCount + $completedInSession)
Expand Down Expand Up @@ -570,7 +578,7 @@
</div>
{:else}
<div class="p-4 text-center text-gray-500 dark:text-gray-400 text-sm">
{hasActiveFilters ? 'No problems match your filters' : 'Loading...'}
{emptyListMessage}
</div>
{/each}
</div>
Expand Down
Loading