diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index fb75d6c..3fe77b4 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,7 +1,428 @@ -

Language Learning App

+ + + + + + +
+ + + + +
+

A language learning application

+ +

+ Read French.
Learn naturally. +

+ +

+ Immerse yourself in curated and AI-generated French articles. Tap any word for a definition, + save vocabulary as you read, and review with spaced repetition — no gamification, just the + language. +

+ +
+ {#if data.isLoggedIn} + + Go to app + + {:else} + + Get started + + Log in + {/if} +
+ +
+ +
+
+ Exposure +

+ Read articles written for your level. Bespoke content generated from topics you choose, or + browse an evergreen library. +

+
+
+ Vocabulary +

+ Save words as you encounter them. Import packs around themes — cuisine, travel, culture. + Build a deck that reflects your reading. +

+
+
+ Review +

+ Typed-recall flashcards powered by spaced repetition. No multiple choice, no confetti — + just the words, when they're due. +

+
+
+
+ + + +
+ + diff --git a/frontend/src/routes/app/+page.svelte b/frontend/src/routes/app/+page.svelte index d61697e..d6987b7 100644 --- a/frontend/src/routes/app/+page.svelte +++ b/frontend/src/routes/app/+page.svelte @@ -1,172 +1,348 @@
-
-

Dashboard

-

{greeting}.

-

What will you learn today?

-
+ + - -
History
-

Jobs

-

Review the status of your generation jobs and access completed content.

- -
-
+ +
+

Your reading library

+ +

+ Articles & reading +

+ +

+ Browse your library of French articles and generated readings. Tap any word for a definition + and save vocabulary as you go. +

+ +
+ + Open library + + or generate a new article below +
+ +
+ +
+ + Create + New article + + + + Browse + Word packs + + + + History + Jobs + + +
+
+ + + diff --git a/frontend/src/routes/app/admin/dictionary-search/dictionarySearch.remote.ts b/frontend/src/routes/app/admin/dictionary-search/dictionarySearch.remote.ts index 6ed22e3..16714b0 100644 --- a/frontend/src/routes/app/admin/dictionary-search/dictionarySearch.remote.ts +++ b/frontend/src/routes/app/admin/dictionary-search/dictionarySearch.remote.ts @@ -1,6 +1,9 @@ import { query, getRequestEvent } from '$app/server'; import * as v from 'valibot'; -import { searchWordformsApiDictionaryWordformsGet } from '../../../../client'; +import { + searchWordformsApiDictionarySearchGet, + searchWordformsApiDictionaryWordformsGet +} from '../../../../client'; import { COOKIE_NAME_AUTH_TOKEN } from '$lib/auth'; export const dictionarySearch = query( @@ -10,11 +13,26 @@ export const dictionarySearch = query( }), async ({ langCode, text }) => { const { cookies } = getRequestEvent(); - const { data } = await searchWordformsApiDictionaryWordformsGet({ - headers: { Authorization: `Bearer ${cookies.get(COOKIE_NAME_AUTH_TOKEN)}` }, - query: { lang_code: langCode, text } - }); + const trimmed = text.trim(); - return data; + if (trimmed.length === 0) { + return []; + } + + if (trimmed.length < 5) { + const { data } = await searchWordformsApiDictionaryWordformsGet({ + headers: { Authorization: `Bearer ${cookies.get(COOKIE_NAME_AUTH_TOKEN)}` }, + query: { lang_code: langCode, text } + }); + + return data; + } else { + const { data } = await searchWordformsApiDictionarySearchGet({ + headers: { Authorization: `Bearer ${cookies.get(COOKIE_NAME_AUTH_TOKEN)}` }, + query: { lang_code: langCode, text } + }); + + return data; + } } );