From 2d3a4d0e574171f3f6603bdfc27f71aace0f5ad5 Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Mon, 20 Apr 2026 23:43:57 -0500 Subject: [PATCH] Feat: History Page Revamp --- .../discover/components/Search.svelte | 2 +- src/features/home/components/HeroStage.svelte | 28 +- src/features/home/components/Home.svelte | 55 +- src/shared/chrome/RecentActivity.svelte | 502 ++++++++++++++---- 4 files changed, 443 insertions(+), 144 deletions(-) diff --git a/src/features/discover/components/Search.svelte b/src/features/discover/components/Search.svelte index 5d5066e..9e284e0 100644 --- a/src/features/discover/components/Search.svelte +++ b/src/features/discover/components/Search.svelte @@ -321,7 +321,7 @@ .root { display: flex; flex-direction: column; height: 100%; overflow: hidden; } .header { position: relative; z-index: 100; display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-6); flex-shrink: 0; border-bottom: 1px solid var(--border-dim); } .heading { font-family: var(--font-ui); font-size: var(--text-xs); color: var(--text-faint); letter-spacing: var(--tracking-wider); text-transform: uppercase; flex-shrink: 0; } - .tabs { display: flex; gap: 2px; background: var(--bg-raised); border: 1px solid var(--border-dim); border-radius: var(--radius-md); padding: 2px; position: relative; } + .tabs { margin-left: auto; display: flex; gap: 2px; background: var(--bg-raised); border: 1px solid var(--border-dim); border-radius: var(--radius-md); padding: 2px; position: relative; } .tab-slide-indicator { position: absolute; top: 2px; bottom: 2px; border-radius: var(--radius-sm); background: var(--accent-muted); border: 1px solid var(--accent-dim); pointer-events: none; z-index: 0; transition: left 0.22s cubic-bezier(0.16,1,0.3,1), width 0.22s cubic-bezier(0.16,1,0.3,1); } .tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 5px; font-family: var(--font-ui); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-sm); color: var(--text-faint); white-space: nowrap; transition: background var(--t-base), color var(--t-base); cursor: pointer; border: 1px solid transparent; } .tab:hover { color: var(--text-muted); } diff --git a/src/features/home/components/HeroStage.svelte b/src/features/home/components/HeroStage.svelte index 9f0cd1f..2c83e58 100644 --- a/src/features/home/components/HeroStage.svelte +++ b/src/features/home/components/HeroStage.svelte @@ -57,11 +57,13 @@
- {#if heroThumb} -
- {:else} -
- {/if} + {#key heroThumb} + {#if heroThumb} +
+ {:else} +
+ {/if} + {/key}
{/if} + + + {#if search} + + {/if}
{#if store.history.length > 0} - {/if} @@ -107,61 +108,72 @@ {#if store.readingStats.totalChaptersRead > 0} -
-
- - {store.readingStats.currentStreakDays} - day streak +
+
+
+ +
+
+ {store.readingStats.currentStreakDays} + day streak +
-
-
- - {store.readingStats.totalChaptersRead} - chapters +
+
+ +
+
+ {store.readingStats.totalChaptersRead} + chapters +
-
-
- - {formatReadTime(store.readingStats.totalMinutesRead)} - read time +
+
+ +
+
+ {formatReadTime(store.readingStats.totalMinutesRead)} + read time +
-
-
- - {store.readingStats.totalMangaRead} - series +
+
+ +
+
+ {store.readingStats.totalMangaRead} + series +
-
-
- {store.readingStats.longestStreakDays}d - best streak -
- Stats are preserved when you clear the feed
{/if} {#if store.history.length === 0}
- +
+ +

No reading history yet

Chapters you read will appear here

{:else if sessions.length === 0}
- +
+ +

No results for "{search}"

{:else}
{#each groups as { label, items }}
-
+
{label} -
+
{#each items as session (session.latestChapterId)} - {/each}
@@ -197,63 +204,356 @@
+ .session-row:hover { background: var(--bg-raised); } + .session-row:active { background: var(--bg-elevated); } + + .thumb-wrap { + position: relative; + flex-shrink: 0; + } + + :global(.thumb) { + width: 38px; + height: 54px; + object-fit: cover; + display: block; + border-radius: var(--radius-sm); + border: 1px solid var(--border-dim); + } + + .session-count { + position: absolute; + bottom: -4px; + right: -6px; + background: var(--accent-muted); + border: 1px solid var(--accent-dim); + color: var(--accent-fg); + font-family: var(--font-ui); + font-size: 8px; + font-weight: 700; + padding: 1px 3px; + border-radius: var(--radius-sm); + line-height: 1.3; + pointer-events: none; + letter-spacing: 0.02em; + } + + .session-info { + flex: 1; + display: flex; + flex-direction: column; + gap: 4px; + overflow: hidden; + min-width: 0; + } + + .session-title { + font-size: var(--text-sm); + font-weight: var(--weight-medium); + color: var(--text-primary); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + line-height: 1.2; + } + + .session-chapter { + display: flex; + align-items: center; + gap: 4px; + font-family: var(--font-ui); + font-size: var(--text-2xs); + color: var(--text-faint); + letter-spacing: var(--tracking-wide); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; + } + + .ch-arrow { + color: var(--text-faint); + opacity: 0.35; + flex-shrink: 0; + } + + .ch-page { + color: var(--text-faint); + opacity: 0.5; + flex-shrink: 0; + } + + .session-time { + font-family: var(--font-ui); + font-size: var(--text-2xs); + color: var(--text-faint); + letter-spacing: var(--tracking-wide); + flex-shrink: 0; + white-space: nowrap; + opacity: 0.45; + } + + .empty { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: var(--sp-2); + } + + .empty-icon-wrap { + width: 44px; + height: 44px; + border-radius: var(--radius-lg); + background: var(--bg-raised); + border: 1px solid var(--border-dim); + display: flex; + align-items: center; + justify-content: center; + color: var(--text-faint); + opacity: 0.5; + margin-bottom: var(--sp-1); + } + + .empty-text { + font-size: var(--text-sm); + font-weight: var(--weight-medium); + color: var(--text-muted); + } + + .empty-hint { + font-size: var(--text-xs); + color: var(--text-faint); + } + \ No newline at end of file