From 6de7be1a3a2b5a9af85cc40d339ebe7de6b5db3a Mon Sep 17 00:00:00 2001 From: srfwb <264158739+srfwb@users.noreply.github.com> Date: Mon, 27 Apr 2026 13:26:27 +0200 Subject: [PATCH] feat(palette): wire real lessons into search and fix remaining French strings --- src/home/sections/BottomTip.tsx | 8 ++++---- src/home/sections/TemplatesSection.tsx | 2 +- src/palette/sources.ts | 27 ++++++++++++-------------- src/projects/templates.ts | 8 ++++---- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/home/sections/BottomTip.tsx b/src/home/sections/BottomTip.tsx index 8037fbf..1f3a235 100644 --- a/src/home/sections/BottomTip.tsx +++ b/src/home/sections/BottomTip.tsx @@ -11,16 +11,16 @@ export function BottomTip() {
- Astuce. Survole n'importe quel mot dans l'éditeur pour voir une explication - rapide — c'est comme ça que cet IDE enseigne. + Tip. Hover any keyword in the editor for a quick explanation — that's how + this IDE teaches.
); diff --git a/src/home/sections/TemplatesSection.tsx b/src/home/sections/TemplatesSection.tsx index 6c8c637..c792d12 100644 --- a/src/home/sections/TemplatesSection.tsx +++ b/src/home/sections/TemplatesSection.tsx @@ -5,7 +5,7 @@ export function TemplatesSection() { return (
-

Commence un nouveau projet

+

Start a new project

{TEMPLATES.map((t) => ( diff --git a/src/palette/sources.ts b/src/palette/sources.ts index 9456c2d..359447a 100644 --- a/src/palette/sources.ts +++ b/src/palette/sources.ts @@ -1,4 +1,5 @@ -import { toast } from "../ide/shell/toastStore"; +import { ALL_CONTENT } from "../lessons/data"; +import { useLessonStore } from "../lessons/lessonStore"; import { openProject } from "../projects/actions"; import { useProjectStore } from "../projects/projectStore"; import { useIdeStore } from "../state/ideStore"; @@ -85,22 +86,18 @@ export function buildCommandItems(): PaletteItem[] { })); } -// Single placeholder row so the Lessons section shows up even before the -// curriculum lands. Selecting it toasts "Coming soon". export function buildLessonItems(): PaletteItem[] { - return [ - { - id: "lesson:placeholder", - group: "lessons", - title: "Lesson path", - subtitle: "Coming soon", - pill: "lesson", - icon: { glyph: "L", tone: "lesson" }, - onSelect: () => { - toast.info("Coming soon"); - }, + return ALL_CONTENT.map((item) => ({ + id: `lesson:${item.id}`, + group: "lessons", + title: item.title, + subtitle: `${item.difficulty} · ~${item.estimatedMinutes} min`, + pill: item.type, + icon: { glyph: item.type === "lesson" ? "L" : "C", tone: "lesson" }, + onSelect: () => { + useLessonStore.getState().startLesson(item.id); }, - ]; + })); } // Orchestrator: assemble every group in the canonical order and drop those diff --git a/src/projects/templates.ts b/src/projects/templates.ts index 7a4aa7b..dd7cff9 100644 --- a/src/projects/templates.ts +++ b/src/projects/templates.ts @@ -14,8 +14,8 @@ export interface Template { const BLANK: Template = { id: "blank", - title: "Dossier vierge", - description: "Projet vide. Tu choisis les fichiers.", + title: "Blank project", + description: "Empty project. You choose the files.", kind: "blank", tags: [], files: {}, @@ -23,8 +23,8 @@ const BLANK: Template = { const HTML_CSS: Template = { id: "html-css", - title: "Démarrage HTML + CSS", - description: "Deux fichiers prêts à être stylés.", + title: "HTML + CSS Starter", + description: "Two files ready to be styled.", kind: "html", tags: ["html", "css"], files: DEFAULT_FILES,