From 814e8d817bf2cccb1b8a4a4ac2e9cf52b115a539 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 22 Oct 2023 11:14:05 -0700
Subject: feat(tools): use string query parameters

---
 src/routes/tools/+page.svelte | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

(limited to 'src/routes/tools/+page.svelte')

diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte
index 3976aeba..75bf5a40 100644
--- a/src/routes/tools/+page.svelte
+++ b/src/routes/tools/+page.svelte
@@ -6,25 +6,27 @@
 
 	export let data;
 
-	let tool = browser ? Number(new URLSearchParams(window.location.search).get('tool')) || 0 : 0;
+	let tool = browser
+		? String(new URLSearchParams(window.location.search).get('tool')) || 'default'
+		: 'default';
 </script>
 
 <p>
 	<select bind:value={tool}>
-		<option value={0}>Tools</option>
-		<option value={1}>Today's Character Birthdays</option>
-		<option value={2}>Activity History Hole Risks</option>
-		<option value={3}>Wrapped (Beta)</option>
+		<option value="default">Tools</option>
+		<option value="todays_character_birthdays">Today's Character Birthdays</option>
+		<option value="activity_history_hole_risks">Activity History Hole Risks</option>
+		<option value="wrapped">Wrapped (Beta)</option>
 	</select>
 </p>
 
-{#if tool === 0}
+{#if tool === 'default'}
 	Select a tool to continue.
-{:else if tool === 2}
+{:else if tool === 'activity_history_hole_risks'}
 	<ActivityHistory user={data.user} />
-{:else if tool === 3}
+{:else if tool === 'wrapped'}
 	<div id="wrapped"><Wrapped user={data.user} /></div>
-{:else if tool === 1}
+{:else if tool === 'todays_character_birthdays'}
 	<ul>
 		{#await todaysCharacterBirthdays()}
 			<li>Loading ...</li>
-- 
cgit v1.2.3


From 3214a2ed1c81a2ef39a5b6123c713a31b11c3222 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 22 Oct 2023 13:00:12 -0700
Subject: feat(tools): default selection query

---
 src/routes/tools/+page.svelte | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'src/routes/tools/+page.svelte')

diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte
index 75bf5a40..8ddc0aac 100644
--- a/src/routes/tools/+page.svelte
+++ b/src/routes/tools/+page.svelte
@@ -6,14 +6,13 @@
 
 	export let data;
 
-	let tool = browser
-		? String(new URLSearchParams(window.location.search).get('tool')) || 'default'
-		: 'default';
+	const urlParameters = browser ? new URLSearchParams(window.location.search) : null;
+	let tool = browser && urlParameters?.size !== 0 ? urlParameters?.get('tool') : 'default';
 </script>
 
 <p>
 	<select bind:value={tool}>
-		<option value="default">Tools</option>
+		<option value="default" selected disabled hidden>Tool</option>
 		<option value="todays_character_birthdays">Today's Character Birthdays</option>
 		<option value="activity_history_hole_risks">Activity History Hole Risks</option>
 		<option value="wrapped">Wrapped (Beta)</option>
-- 
cgit v1.2.3


From 0c6fbd9b1afe8e5967a127bffa68570ee88bfe92 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 22 Oct 2023 14:03:08 -0700
Subject: feat(tools): episode discussion collector

---
 src/routes/tools/+page.svelte | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/routes/tools/+page.svelte')

diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte
index 8ddc0aac..5a12fb0f 100644
--- a/src/routes/tools/+page.svelte
+++ b/src/routes/tools/+page.svelte
@@ -3,6 +3,7 @@
 	import { todaysCharacterBirthdays } from '$lib/AniList/character';
 	import Wrapped from '$lib/Tools/Wrapped.svelte';
 	import { browser } from '$app/environment';
+	import EpisodeDiscussionCollector from '$lib/Tools/EpisodeDiscussionCollector.svelte';
 
 	export let data;
 
@@ -16,6 +17,7 @@
 		<option value="todays_character_birthdays">Today's Character Birthdays</option>
 		<option value="activity_history_hole_risks">Activity History Hole Risks</option>
 		<option value="wrapped">Wrapped (Beta)</option>
+		<option value="episode_discussion_collector">Episode Discussion Collector (Beta)</option>
 	</select>
 </p>
 
@@ -25,6 +27,8 @@
 	<ActivityHistory user={data.user} />
 {:else if tool === 'wrapped'}
 	<div id="wrapped"><Wrapped user={data.user} /></div>
+{:else if tool === 'episode_discussion_collector'}
+	<EpisodeDiscussionCollector />
 {:else if tool === 'todays_character_birthdays'}
 	<ul>
 		{#await todaysCharacterBirthdays()}
-- 
cgit v1.2.3

