Craft Anything: understand how any software works, and craft your own.
Rust
Offer "Work on my project" on New project: pick your project's folder and edit its files in place (#686)
Aek12b0c1e0ba03
diff --git a/crates/ui-egui/src/folders.rs b/crates/ui-egui/src/folders.rsindex b45f8bd5..9818db05 100644--- a/crates/ui-egui/src/folders.rs+++ b/crates/ui-egui/src/folders.rs@@ -65,14 +65,7 @@ fn clear(app: &mut CraftApp) {/// they are (or uses the answer from Settings).pub fn picked(app: &mut CraftApp, folder: PathBuf) {match workspace::folder_state(&folder) {- Ok(FolderState::Project) => match Workspace::open(&folder) {- Ok(ws) => {- app.toast(tr("That folder is already a project, so it's open now."), false);- app.open_workspace(ws);- app.remember_project(&folder);- }- Err(e) => app.toast(e.for_people(), true),- },+ Ok(FolderState::Project) => open_project(app, &folder),Ok(FolderState::Empty) => {clear(app);app.state.make.folder = Some(folder);@@ -91,6 +84,34 @@ pub fn picked(app: &mut CraftApp, folder: PathBuf) {}}+/// "Work on my project" picked a folder: its files are the app, edited in place (nothing asked).+/// An existing project opens; an empty folder has nothing to work on.+pub fn picked_own(app: &mut CraftApp, folder: PathBuf) {+ match workspace::folder_state(&folder) {+ Ok(FolderState::Project) => open_project(app, &folder),+ Ok(FolderState::Empty) => app.toast(tr("That folder is empty. Pick the folder your project's files are in."), true),+ Ok(FolderState::HasFiles { names, count }) => {+ clear(app);+ let d = &mut app.state.make;+ d.folder = Some(folder);+ d.folder_files = Some((names, count));+ choose(app, ExistingFiles::Edit);+ }+ Err(e) => app.toast(e.for_people(), true),+ }+}++fn open_project(app: &mut CraftApp, folder: &std::path::Path) {+ match Workspace::open(folder) {+ Ok(ws) => {+ app.toast(tr("That folder is already a project, so it's open now."), false);+ app.open_workspace(ws);+ app.remember_project(folder);+ }+ Err(e) => app.toast(e.for_people(), true),+ }+}+/// Use the picked folder's files this way, unless something there is named like Craft Anything's/// own files: then the folder isn't used (nothing of theirs is ever replaced).fn choose(app: &mut CraftApp, choice: ExistingFiles) {diff --git a/crates/ui-egui/src/fr.tsv b/crates/ui-egui/src/fr.tsvindex 99b98782..2c6815b7 100644--- a/crates/ui-egui/src/fr.tsv+++ b/crates/ui-egui/src/fr.tsv@@ -396,6 +396,15 @@ A simple snake game Un jeu du serpent simpleEnter a full web address, like example.com or https://example.com/page. Saisissez une adresse web complète, comme example.com ou https://example.com/page.Make my own version Créer ma propre versionJust look inside Juste regarder à l'intérieur+Work on my project Travailler sur mon projet+Work on a project you already have Travailler sur un projet que vous avez déjà+Pick its folder, say what you want, then press Start. Choisissez son dossier, dites ce que vous voulez, puis appuyez sur Démarrer.+Where is your project? Où est votre projet ?+Choose your project's folder… Choisir le dossier de votre projet…+For example: add a dark mode Par exemple : ajouter un mode sombre+Pick your project's folder first. Choisissez d'abord le dossier de votre projet.+Pick your project's folder Choisissez le dossier de votre projet+That folder is empty. Pick the folder your project's files are in. Ce dossier est vide. Choisissez le dossier où se trouvent les fichiers de votre projet.What do you want to make? Que voulez-vous créer ?Choose what to recreate, say what you want, then press Start. Choisissez quoi recréer, dites ce que vous voulez, puis appuyez sur Démarrer.What do you want to recreate? Que voulez-vous recréer ?diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsvindex 7790fd67..8b5f41ef 100644--- a/crates/ui-egui/src/i18n/cs.tsv+++ b/crates/ui-egui/src/i18n/cs.tsv@@ -584,6 +584,15 @@ Jobs ({n}) Úlohy ({n})Just a question: nothing was changed. Answered by Pouze otázka: nic se nezměnilo. Odpověď odJust ask Jen se zeptatJust look inside Jen nahlédnout dovnitř+Work on my project Pracovat na svém projektu+Work on a project you already have Pracovat na projektu, který už máte+Pick its folder, say what you want, then press Start. Vyberte jeho složku, popište své přání a stiskněte Spustit.+Where is your project? Kde je váš projekt?+Choose your project's folder… Vybrat složku vašeho projektu…+For example: add a dark mode Například: přidat tmavý režim+Pick your project's folder first. Nejprve vyberte složku projektu.+Pick your project's folder Vybrat složku projektu+That folder is empty. Pick the folder your project's files are in. Tato složka je prázdná. Vyberte složku, ve které jsou soubory vašeho projektu.Keep going without asking Pokračovat bez dotazůKeep it PonechatKeep it in the sidebar to open any time, whatever later builds change. Ponechat v postranním panelu, odkud jej lze kdykoli otevřít bez ohledu na změny v dalších sestaveních.diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsvindex 5e5b0ec7..e2340792 100644--- a/crates/ui-egui/src/i18n/de.tsv+++ b/crates/ui-egui/src/i18n/de.tsv@@ -584,6 +584,15 @@ Jobs ({n}) Aufgaben ({n})Just a question: nothing was changed. Answered by Nur eine Frage: Nichts wurde geändert. Beantwortet vonJust ask Einfach fragenJust look inside Einfach hineinsehen+Work on my project An meinem Projekt arbeiten+Work on a project you already have An einem Projekt arbeiten, das du schon hast+Pick its folder, say what you want, then press Start. Wähle seinen Ordner, sag, was du willst, und drücke dann Start.+Where is your project? Wo ist dein Projekt?+Choose your project's folder… Den Ordner deines Projekts wählen …+For example: add a dark mode Zum Beispiel: einen dunklen Modus hinzufügen+Pick your project's folder first. Wähle zuerst den Ordner deines Projekts.+Pick your project's folder Wähle den Ordner deines Projekts+That folder is empty. Pick the folder your project's files are in. Dieser Ordner ist leer. Wähle den Ordner, in dem die Dateien deines Projekts liegen.Keep going without asking Ohne Nachfragen weitermachenKeep it BehaltenKeep it in the sidebar to open any time, whatever later builds change. Behalte es in der Seitenleiste, um es jederzeit zu öffnen, egal was spätere Builds ändern.diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsvindex 13972f85..6d15100a 100644--- a/crates/ui-egui/src/i18n/ko.tsv+++ b/crates/ui-egui/src/i18n/ko.tsv@@ -584,6 +584,15 @@ Jobs ({n}) 작업 ({n})Just a question: nothing was changed. Answered by 질문에만 답했고 바뀐 것은 없습니다. 답변:Just ask 질문만 하기Just look inside 살펴보기만+Work on my project 내 프로젝트 작업하기+Work on a project you already have 이미 있는 프로젝트 작업하기+Pick its folder, say what you want, then press Start. 폴더를 고르고 원하는 내용을 적은 뒤 시작을 누릅니다.+Where is your project? 프로젝트는 어디에 있나요?+Choose your project's folder… 프로젝트 폴더 고르기…+For example: add a dark mode 예: 다크 모드 추가+Pick your project's folder first. 먼저 프로젝트 폴더를 고르세요.+Pick your project's folder 프로젝트 폴더 고르기+That folder is empty. Pick the folder your project's files are in. 그 폴더는 비어 있습니다. 프로젝트 파일이 있는 폴더를 고르세요.Keep going without asking 묻지 않고 계속하기Keep it 남겨 두기Keep it in the sidebar to open any time, whatever later builds change. 나중 빌드가 무엇을 바꾸든 사이드바에 두고 언제든 열 수 있습니다.diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsvindex ce534e28..03d15c5a 100644--- a/crates/ui-egui/src/i18n/ru.tsv+++ b/crates/ui-egui/src/i18n/ru.tsv@@ -572,6 +572,15 @@ Jobs ({n}) Задания ({n})Just a question: nothing was changed. Answered by Просто вопрос: ничего не изменилось. Отвечено:Just ask Просто спроситеJust look inside Просто загляните внутрь+Work on my project Работать над своим проектом+Work on a project you already have Работать над проектом, который у вас уже есть+Pick its folder, say what you want, then press Start. Выберите его папку, скажите, что хотите, затем нажмите «Старт».+Where is your project? Где ваш проект?+Choose your project's folder… Выберите папку вашего проекта…+For example: add a dark mode Например: добавить тёмную тему+Pick your project's folder first. Сначала выберите папку проекта.+Pick your project's folder Выберите папку проекта+That folder is empty. Pick the folder your project's files are in. Эта папка пуста. Выберите папку, в которой лежат файлы вашего проекта.Keep going without asking Продолжать без вопросовKeep it СохранитьKeep it in the sidebar to open any time, whatever later builds change. Оставить в боковой панели, чтобы открывать в любое время, несмотря на изменения в последующих сборках.diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsvindex 398c152f..7cf638f6 100644--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@ -584,6 +584,15 @@ Jobs ({n}) 任务({n})Just a question: nothing was changed. Answered by 仅回答问题,未作任何修改。回答者:Just ask 只提问Just look inside 只查看内部+Work on my project 继续做自己的项目+Work on a project you already have 继续做你已有的项目+Pick its folder, say what you want, then press Start. 选择它的文件夹,描述你的需求,然后点击开始。+Where is your project? 你的项目在哪里?+Choose your project's folder… 选择你的项目文件夹…+For example: add a dark mode 例如:加上深色模式+Pick your project's folder first. 请先选择你的项目文件夹。+Pick your project's folder 选择你的项目文件夹+That folder is empty. Pick the folder your project's files are in. 该文件夹是空的。请选择存放你项目文件的文件夹。Keep going without asking 继续执行,无须询问Keep it 保留Keep it in the sidebar to open any time, whatever later builds change. 将其保留在侧栏中,随时打开,不受后续构建改动的影响。diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsvindex 9b40dbea..21ed23b9 100644--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@ -584,6 +584,15 @@ Jobs ({n}) 工作({n})Just a question: nothing was changed. Answered by 僅回答問題,未作任何修改。回答者:Just ask 只提問Just look inside 只檢視內部+Work on my project 繼續做自己的專案+Work on a project you already have 繼續做你已有的專案+Pick its folder, say what you want, then press Start. 選擇它的資料夾,描述你的需求,然後點選開始。+Where is your project? 你的專案在哪裡?+Choose your project's folder… 選擇你的專案資料夾…+For example: add a dark mode 例如:加上深色模式+Pick your project's folder first. 請先選擇你的專案資料夾。+Pick your project's folder 選擇你的專案資料夾+That folder is empty. Pick the folder your project's files are in. 該資料夾是空的。請選擇存放你專案檔案的資料夾。Keep going without asking 繼續執行,無須詢問Keep it 保留Keep it in the sidebar to open any time, whatever later builds change. 將其保留在側邊欄中,隨時開啟,不受後續建置變更的影響。diff --git a/crates/ui-egui/src/ja.tsv b/crates/ui-egui/src/ja.tsvindex eb7715da..83435faa 100644--- a/crates/ui-egui/src/ja.tsv+++ b/crates/ui-egui/src/ja.tsv@@ -324,6 +324,15 @@ Jobs ({n_jobs}) ジョブ({n_jobs})Just a question: nothing was changed. Answered by 質問のみ: 何も変更されていません。回答者:Just ask 質問するだけJust look inside 中を覗くだけ+Work on my project 自分のプロジェクトで作業する+Work on a project you already have すでにあるプロジェクトで作業する+Pick its folder, say what you want, then press Start. フォルダを選び、欲しいものを伝えて開始を押してください。+Where is your project? プロジェクトはどこにありますか?+Choose your project's folder… プロジェクトのフォルダを選ぶ…+For example: add a dark mode 例: ダークモードを追加+Pick your project's folder first. まずプロジェクトのフォルダを選んでください。+Pick your project's folder プロジェクトのフォルダを選ぶ+That folder is empty. Pick the folder your project's files are in. そのフォルダは空です。プロジェクトのファイルがあるフォルダを選んでください。Keep going without asking 確認せずに続行Keep it 残すKeep it in the sidebar to open any time, whatever later builds change. サイドバーに残して、後のビルドが変わってもいつでも開けるようにします。diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rsindex 08e520ec..5d894e29 100644--- a/crates/ui-egui/src/lib.rs+++ b/crates/ui-egui/src/lib.rs@@ -278,6 +278,8 @@ pub enum Pick {ProjectsDir,/// The folder a new project starts in (it may already have the person's files).ProjectFolder,+ /// The folder of a project the person already has ("Work on my project").+ OwnProject,/// Another folder whose projects are listed (Settings).ExtraProjectsDir,/// Pictures of the original to match (several at once).@@ -1052,6 +1054,7 @@ impl CraftApp {Pick::TargetFolder => pollster::block_on(d.set_title(tr("Pick the app or game folder")).pick_folder()),Pick::ProjectsDir => pollster::block_on(d.set_title(tr("Where should new projects go?")).pick_folder()),Pick::ProjectFolder => pollster::block_on(d.set_title(tr("Pick the folder for this project")).pick_folder()),+ Pick::OwnProject => pollster::block_on(d.set_title(tr("Pick your project's folder")).pick_folder()),Pick::ExtraProjectsDir => pollster::block_on(d.set_title(tr("Pick a folder with projects in it")).pick_folder()),Pick::GameFolder => pollster::block_on(d.set_title(tr("Pick the game's folder")).pick_folder()),Pick::SavePicture => pollster::block_on(d.set_title(tr("Save the picture")).add_filter("PNG", &["png"]).set_file_name(&suggested).save_file()),@@ -1514,6 +1517,7 @@ impl CraftApp {self.refresh_projects();}Pick::ProjectFolder => folders::picked(self, path),+ Pick::OwnProject => folders::picked_own(self, path),Pick::ExtraProjectsDir => self.add_project_folder(path),Pick::GameFolder => game_files::folder_picked(self, path),Pick::SavePicture => game_files::save_to(self, path),diff --git a/crates/ui-egui/src/make.rs b/crates/ui-egui/src/make.rsindex 78763ef3..6f7fff2e 100644--- a/crates/ui-egui/src/make.rs+++ b/crates/ui-egui/src/make.rs@@ -6,7 +6,7 @@ use crate::i18n::tr;use crate::state::MakeDraft;use crate::theme::{self, Tokens};use crate::{CraftApp, Pick, icons, widgets};-use craft_anything_engine::workspace::{Status, TargetRef};+use craft_anything_engine::workspace::{ExistingFiles, Status, TargetRef};use egui::{Margin, RichText, Sense, Ui, Vec2};const SUGGESTIONS_WEB: &[&str] = &["Recreate this website", "Recreate it with darker colours"];@@ -62,17 +62,29 @@ pub fn is_game(kinds: &craft_anything_ai::rebuild::KindRegistry, d: &MakeDraft)|| kinds.choose(&d.request, &resolve_target(d), false).is_some_and(|(k, _)| k.id() == GameKind::ID)}-/// The front door: make your own version of something, or just look inside it.+/// The front door: make your own version of something, work on a project you already have, or+/// just look inside something.pub fn hero(app: &mut CraftApp, ui: &mut Ui, w: f32) {let t = Tokens::get(ui.ctx());- if let Some(i) = widgets::segmented_sized(ui, &["Make my own version", "Just look inside"], usize::from(app.state.make.look), 38.0, 12.5) {- app.state.make.look = i == 1;+ let d = &mut app.state.make;+ let door = if d.look { 2 } else { usize::from(d.mine) };+ if let Some(i) = widgets::segmented_sized(ui, &["Make my own version", "Work on my project", "Just look inside"], door, 38.0, 12.5) {+ (d.mine, d.look) = (i == 1, i == 2);+ if d.mine {+ // The person's own project: there's nothing to recreate.+ (d.target, d.editing_url, d.found, d.builder, d.game) = (TargetRef::None, false, None, None, false);+ d.url.clear();+ }}ui.add_space(18.0);if app.state.make.look {look(app, ui, w);return;}+ if app.state.make.mine {+ mine(app, ui, w);+ return;+ }ui.label(theme::heading(tr("What do you want to make?"), theme::TITLE));ui.add_space(6.0);ui.label(RichText::new(tr("Choose what to recreate, say what you want, then press Start.")).size(theme::LEAD).color(t.text_dim));@@ -103,46 +115,12 @@ pub fn hero(app: &mut CraftApp, ui: &mut Ui, w: f32) {};// Websites are photographed for the builder; anything else looks right from pictures.let website = matches!(resolve_target(d), TargetRef::Website { .. }) || d.editing_url;- let previews = app.previews(ui.ctx(), &app.state.make.pictures.clone());- let out = crate::prompt_box::show(- ui,- &mut app.state.make.request,- &app.state.make.pictures,- crate::prompt_box::PromptBox {- name: "Say what you want",- hint: tr(hint),- rows: (3, 10),- attach: (!website).then_some("Add pictures of the original (optional: screenshots help it look right)"),- previews: &previews,- stop_button: None,- stopping: false,- send: false,- recall: false,- history: None,- font_size: theme::LEAD,- },- );- if let Some(i) = out.remove {- app.state.make.pictures.remove(i);- }- if out.attach {- app.pick(Pick::Pictures);- }- if out.paste {- app.paste_pictures(false);- }- let submit = out.send;+ let submit = request_box(app, ui, hint, (!website).then_some("Add pictures of the original (optional: screenshots help it look right)"));if app.state.make.request.trim().is_empty() {ui.add_space(10.0);suggestions(app, ui);}- if is_game(&app.kinds, &app.state.make) {- ui.add_space(22.0);- crate::engine_ui::build_with(app, ui);- ui.add_space(14.0);- let on = app.state.make.generate_assets;- crate::engine_ui::assets_toggle(app, ui, on);- }+ engine_choices(app, ui);ui.add_space(16.0);ui.horizontal(|ui| {crate::builders::built_by(app, ui);@@ -161,6 +139,114 @@ pub fn hero(app: &mut CraftApp, ui: &mut Ui, w: f32) {});}+/// "Work on my project": the folder of a project the person already has, whose files the builder+/// edits in place, and what to change. There's no original to pick, so no Clean room / Deep choice.+fn mine(app: &mut CraftApp, ui: &mut Ui, w: f32) {+ let t = Tokens::get(ui.ctx());+ ui.label(theme::heading(tr("Work on a project you already have"), theme::TITLE));+ ui.add_space(6.0);+ ui.label(RichText::new(tr("Pick its folder, say what you want, then press Start.")).size(theme::LEAD).color(t.text_dim));+ ui.add_space(16.0);+ widgets::card(&t).inner_margin(Margin::same(20)).show(ui, |ui| {+ ui.set_width(w - 50.0);+ step_title(ui, 1, "Where is your project?");+ ui.add_space(12.0);+ // A folder picked on Make for another use isn't this project's.+ let d = &app.state.make;+ let folder = d.folder.clone().filter(|_| d.existing == Some(ExistingFiles::Edit));+ match &folder {+ None => {+ let size = Vec2::new(ui.available_width(), 60.0);+ if widgets::choice_tile(ui, size, "folder", "Choose your project's folder…", "", false).clicked() {+ app.pick(Pick::OwnProject);+ }+ }+ Some(f) => {+ let place = f.display().to_string();+ ui.horizontal(|ui| {+ icons::show(ui, "folder", 16.0, t.icon);+ ui.add(egui::Label::new(RichText::new(&place).font(theme::semibold(theme::BODY))).truncate()).on_hover_text(&place);+ });+ ui.horizontal_wrapped(|ui| {+ ui.add_space(24.0);+ ui.label(RichText::new(tr("your files there are the app, edited in place")).size(theme::SMALL).color(t.text_dim));+ ui.label(RichText::new("·").size(theme::SMALL).color(t.text_faint));+ if widgets::link(ui, "Pick another folder…").clicked() {+ app.pick(Pick::OwnProject);+ }+ });+ }+ }+ ui.add_space(20.0);+ step_title(ui, 2, "Say what you want");+ ui.add_space(12.0);+ let submit = request_box(app, ui, "For example: add a dark mode", Some("Attach pictures (or drop or paste them here)"));+ engine_choices(app, ui);+ ui.add_space(16.0);+ ui.horizontal(|ui| {+ crate::builders::built_by(app, ui);+ ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {+ let said = !app.state.make.request.trim().is_empty();+ let ready = folder.is_some() && said && app.creating.is_none();+ let start = widgets::primary_sized(ui, Some("sparkles"), "Start", ready, 50.0, 14.0);+ let start = if ready {+ start+ } else {+ start.on_disabled_hover_text(tr(if folder.is_none() { "Pick your project's folder first." } else { "Say what you want first." }))+ };+ if (start.clicked() || submit) && ready {+ app.start_make();+ }+ });+ });+ });+}++/// "Say what you want": the request, and the pictures that go with it (`attach` names the+/// paperclip; `None` takes none). True when it was sent from the keyboard.+fn request_box(app: &mut CraftApp, ui: &mut Ui, hint: &str, attach: Option<&str>) -> bool {+ let previews = app.previews(ui.ctx(), &app.state.make.pictures.clone());+ let out = crate::prompt_box::show(+ ui,+ &mut app.state.make.request,+ &app.state.make.pictures,+ crate::prompt_box::PromptBox {+ name: "Say what you want",+ hint: tr(hint),+ rows: (3, 10),+ attach,+ previews: &previews,+ stop_button: None,+ stopping: false,+ send: false,+ recall: false,+ history: None,+ font_size: theme::LEAD,+ },+ );+ if let Some(i) = out.remove {+ app.state.make.pictures.remove(i);+ }+ if out.attach {+ app.pick(Pick::Pictures);+ }+ if out.paste {+ app.paste_pictures(false);+ }+ out.send+}++/// For a game: the engine it's built with, and whether the builder may generate its assets.+fn engine_choices(app: &mut CraftApp, ui: &mut Ui) {+ if is_game(&app.kinds, &app.state.make) {+ ui.add_space(22.0);+ crate::engine_ui::build_with(app, ui);+ ui.add_space(14.0);+ let on = app.state.make.generate_assets;+ crate::engine_ui::assets_toggle(app, ui, on);+ }+}+/// "Just look inside": what to look at, each opening straight away. Nothing is built or run.fn look(app: &mut CraftApp, ui: &mut Ui, w: f32) {let t = Tokens::get(ui.ctx());diff --git a/crates/ui-egui/src/project.rs b/crates/ui-egui/src/project.rsindex 26c849fe..e6d15b8a 100644--- a/crates/ui-egui/src/project.rs+++ b/crates/ui-egui/src/project.rs@@ -73,7 +73,9 @@ impl CraftApp {if self.creating.is_some() {return;}- let name = suggest_name(&request, &target);+ // The person's own project keeps its folder's name; anything else is named for what's made.+ let own = draft.folder.as_deref().and_then(Path::file_name).filter(|_| draft.mine);+ let name = own.map_or_else(|| suggest_name(&request, &target), |n| n.to_string_lossy().into_owned());let (projects_dir, budget, generate) = (self.settings.projects_dir(), self.settings.assets.budget(), game && draft.generate_assets);// The folder, its records and copies of the pictures are written on a worker (a slow or// network drive must not freeze the window); `created` starts the build.diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rsindex 83a61c7a..a154abfd 100644--- a/crates/ui-egui/src/state.rs+++ b/crates/ui-egui/src/state.rs@@ -52,6 +52,9 @@ pub struct MakeDraft {/// The front door is on "Just look inside" rather than "Make my own version".#[serde(default)]pub look: bool,+ /// The front door is on "Work on my project": the person's own folder, edited in place.+ #[serde(default)]+ pub mine: bool,/// The folder the person picked for the project (else a new one in the projects folder).#[serde(default)]pub folder: Option<PathBuf>,@@ -86,6 +89,7 @@ impl Default for MakeDraft {generate_assets: false,skip_ghidra: false,look: false,+ mine: false,folder: None,folder_files: None,existing: None,diff --git a/crates/ui-egui/tests/headless_parity.rs b/crates/ui-egui/tests/headless_parity.rsindex 31d12d8f..feeb93bf 100644--- a/crates/ui-egui/tests/headless_parity.rs+++ b/crates/ui-egui/tests/headless_parity.rs@@ -45,6 +45,7 @@ const fn a(ui: &'static str, does: &'static str, headless: Headless) -> Action {const ACTIONS: &[Action] = &[// ---- Projects: making something --------------------------------------------------------a("start_make", "start a new project from the Home prompt", Cli("rebuild <target> <request> --build-with --backend --generate-assets")),+ a("New project › Work on my project", "edit a project the person already has, in place", Cli("rebuild <target> <request> --project-folder --existing")),a("set_backend_enabled", "turn an AI on or off", Cli("ai on <name> / ai off <name>")),a("remove_backend", "remove an AI and its key", Cli("ai remove <name>")),a("set_agent_program", "run an agent app from a program it isn't found as", Cli("ai program <name> <path>")),diff --git a/crates/ui-egui/tests/smoke.rs b/crates/ui-egui/tests/smoke.rsindex f8f63da2..0128657e 100644--- a/crates/ui-egui/tests/smoke.rs+++ b/crates/ui-egui/tests/smoke.rs@@ -1886,6 +1886,58 @@ fn a_new_project_can_start_in_a_folder_that_already_has_the_persons_files() {h.run_steps(2);}+/// "Work on my project": the person's own folder, its files edited in place without a question,+/// and the project named after it. An empty folder isn't taken; a folder that's a project opens.+#[test]+fn the_front_door_works_on_a_project_the_person_already_has() {+ use craft_anything_ai::rebuild::StandIns;+ use craft_anything_engine::workspace::{ExistingFiles, TargetRef, Workspace};+ let (d, mine, empty) = (tempfile::tempdir().unwrap(), tempfile::tempdir().unwrap(), tempfile::tempdir().unwrap());+ std::fs::write(mine.path().join("index.html"), "<p>hi</p>").unwrap();+ let runs = StandIns::new();+ let (dir, r) = (d.path().to_path_buf(), runs.clone());+ let mut h = harness(move || stand_in_app(dir, &r));+ h.run_steps(2);+ h.state_mut().state.make.target = TargetRef::Website { url: "https://example.com".into() };+ h.get_by_label("Work on my project").click();+ h.run_steps(3);+ assert!(h.state().state.make.mine && !h.state().state.make.look);+ assert_eq!(h.state().state.make.target, TargetRef::None, "nothing to recreate");+ h.get_by_label("Work on a project you already have");+ h.state_mut().state.make.request = "Add a contact form".into();+ h.run_steps(2);+ h.get_by_label("Start").click();+ h.run_steps(2);+ assert!(h.state().creating.is_none() && h.state().workspace.is_none(), "Start waits for a folder");++ craft_anything_ui_egui::folders::picked_own(h.state_mut(), empty.path().to_path_buf());+ h.run_steps(2);+ assert!(h.state().state.make.folder.is_none(), "an empty folder has nothing to work on");+ assert!(h.state().state.toasts.iter().any(|(text, err)| *err && text.contains("empty")));++ craft_anything_ui_egui::folders::picked_own(h.state_mut(), mine.path().to_path_buf());+ h.run_steps(3);+ assert!(h.state().state.modal.is_none(), "nothing asked: they're the app");+ assert_eq!(h.state().state.make.existing, Some(ExistingFiles::Edit));+ assert_eq!(h.state().settings.existing_files, None, "the answer in Settings is left alone");+ h.get_by_label("Pick another folder…");+ h.get_by_label("Start").click();+ assert!(wait(&mut h, |a| a.creating.is_none() && a.workspace.is_some()), "made on a worker");+ let ws = Workspace::open(mine.path()).expect("the project is the person's folder");+ assert!(ws.manifest.app_in_root && ws.app_dir() == mine.path());+ assert_eq!(ws.manifest.name, mine.path().file_name().unwrap().to_string_lossy(), "named after its folder");+ assert_eq!(std::fs::read_to_string(mine.path().join("index.html")).unwrap(), "<p>hi</p>");+ assert_eq!(runs.started(), [mine.path().to_path_buf()]);+ assert_eq!(std::fs::read_dir(d.path()).map(|r| r.count()).unwrap_or(0), 0, "nothing in the projects folder");++ craft_anything_ui_egui::folders::picked_own(h.state_mut(), mine.path().to_path_buf());+ h.run_steps(2);+ assert!(h.state().state.toasts.iter().any(|(text, err)| !*err && text.contains("already a project")));+ h.state_mut().pause();+ assert!(runs.finish(mine.path()));+ h.run_steps(2);+}+#[test]fn settings_list_projects_from_more_folders_and_remove_them_from_the_list_only() {use craft_anything_engine::workspace::{TargetRef, Workspace};diff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdindex d00443bb..f779231a 100644--- a/docs/ROADMAP.md+++ b/docs/ROADMAP.md@@ -523,6 +523,12 @@ Owner: open · Status: in progress- [x] The website check's missing-site note names every place `site_dir` accepts (dist/, build/,out/, or a plain index.html with no package.json) and the app's real place, "app/" or "theproject folder" (#494)+- [ ] A project edited in place (Work on my project, or `rebuild --existing edit`) gets its stack+ from the request's words, as a new one does: a request that reads as a game asks for Unity+ unless it names another engine, even when the folder is a Godot project, and a run with no+ stack picks the kind's default (`kinds.choose`); `stacks::used_in` reads only package.json,+ after the first turn. Read the stack from the folder's own files first (`project.godot`,+ `Cargo.toml`, `pyproject.toml`, `package.json`…)### R2.8 Clean room means clean roomOwner: maintainers · Status: in progress@@ -580,6 +586,12 @@ Gaps found while using the app for real projects.— claimed: Nghiathan13, branch bugfix/r2.9-linux-gpu-choice- [ ] Linux GPU choice on a desktop with monitors on two GPUs, and on an Intel + NVIDIA laptop:covered by unit tests on fake `/sys/class/drm` folders, not run on such a machine yet (#571)+- [x] "Work on my project" on New project, beside "Make my own version" and "Just look inside":+ pick the folder of a project you already have, say what to change, and its files are edited+ in place, with nothing asked; the project takes the folder's name, an empty folder is+ refused and a folder that's already a project opens. Until now that was only reachable+ through "Choose a folder…" under Make's Start, on a screen that asks what to recreate+ — claimed: xerenon, branch feature/r2.9-work-on-my-project; PR #686### R2.10 Pinned buildsOwner: maintainers · Status: in progressdiff --git a/docs/STATUS.md b/docs/STATUS.mdindex 29a1304d..ba7b39e4 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -43,7 +43,7 @@ workspace clippy, layers, fmt and the secret scan of all history were clean. Chi| WebAssembly tag interfaces | `formats_wasm_compare` resolves retained imported and defined tag exports to their declared parameter types. Identical unresolved or invalid diagnostics may still count as unchanged; those counts do not establish interface compatibility, and invalid/partial limitations remain present | Synthetic core modules with tag changes and re-exports, mixed index spaces, import/tag limits, and missing or non-function type references; formats and engine tests. No real module corpus or WebAssembly execution was used for this correction || Questions and approvals | A file inbox per project; `core_person_ask`, `core_action_approve` and MCP consent requests become cards in the app | Cross-handle round-trip tests, a full approval round trip through the engine || Runtime assets in pinned builds | Frozen and light pins, size estimates and project copies keep runtime files in `obj` folders. An `obj` directory beside a regular C#, F# or Visual Basic project file is still recognised as compiler output; ambiguous folders are retained. New pins record the direct-launch program relative to the copy so a newer helper cannot replace it; older pins retain discovery behavior | Synthetic filesystem tests cover both pin modes, model bytes, compiler-output controls and project duplication. A Linux tool-level regression starts temporary scripts through `project_pin_open`, with a newer `Build/obj/helper`, and verifies the originally selected program and its output; a missing recorded program is refused. No real pinned application was launched for this correction |-| Desktop app | Simple mode: sidebar with New project and the project history (kept across restarts); New project either makes something or just looks inside an app or file, a website or a game's files; a Game files screen (a game's archives; pictures from Unreal paks, Unity .assets files and Unity bundles saved as PNG after the person confirms they may unpack the game; uncompressed textures and the block formats DXT1, DXT5 and BC4–BC7), make prompt with picture attachments (picked, dropped, or pasted with Ctrl+V, shown as picture tiles) and, for anything recreated, a Clean room / Deep choice (also in the title bar; in Clean room, Just look inside, Game files, opening a file and the workbench ask for Deep mode instead), project screen (steps with the time spent and the AI cost and tokens of every build, saved in the project's usage.json by the run (a coding agent's figure is shown as an estimate at API prices, not the bill), what the build is on now and its activity as it arrives (kept in `build-activity.log`), pinned builder checklist, feed, question and approval cards, a Continue card when a build was paused or stopped part-way (the app or computer closed; the project shows Interrupted) that carries on the builder's own session instead of starting over, and "It's done" beside Continue or Try again to keep the build as it is (`project_build_finish`), checks with screenshots and the requirements not met yet, the builder's open questions, preview, play, folder, follow-ups while it builds, which Claude Code takes at its next step; Up in the prompt box takes back the last note still waiting). Projects can start in a folder the person picks, whose files are either the app, edited in place, or material to start from (asked, or the answer remembered in Settings), and are listed from any number of folders (`project_folders`, `project_list`, `rebuild --project-folder`). Make says which AI builds ("Built by": automatic, or any AI that can build, by name); a pick stays with the project and builds its later changes. With nothing to build with, Start offers the coding agents found on the computer. Settings → AI turns an AI off or removes it, and sets how hard the Claude API or Claude Code thinks (every Claude level, low to max; also `ai effort` in the CLI). In the prompt box, Up at the very start and Down at the very end go through earlier prompts when no note is waiting. Questions about a build ("Just ask" under the prompt box, or a message starting with `/btw`, the first slash command; `rebuild_question_ask`) are answered in the conversation, where each folds away and is kept in the project, without a build or a round and changing nothing: Claude Code answers from a read-only copy of the builder's own session. Under each project's prompt box, "Builder's questions: Ask me / Decide yourself" chooses whether the builder's questions come to the person as cards or are decided by the builder, which says what it chose (`project_questions_set`; the default is in Settings and follows Auto mode until picked). Projects can be renamed, duplicated and deleted (right-click in the sidebar, or the project's page; a delete keeps the person's own files). A build can be pinned (Pin this build on its page, or `project_pin_*` from the CLI and MCP): a frozen copy in the project's pinned/ folder (the default) or a light one that shares dependencies and media with the project through hard links (each one's size shown first), opened from the sidebar's collapsible Pinned section (icons with a running dot when folded); a pin or Play runs once per folder unless another copy is asked for, and a start that quits at once says so with its last output. Typed drafts survive a restart. In a narrow window the sidebar folds to icons and the project's details move above its feed; messages float over the screen and errors stay until dismissed. Advanced mode: workbench with every panel wired to real tools, as a screen beside the projects (builds and their questions stay a click away) | UI unit and smoke tests (egui_kittest), offscreen snapshots of every screen |+| Desktop app | Simple mode: sidebar with New project and the project history (kept across restarts); New project makes something, works on a project the person already has (Work on my project: its folder's files are the app, edited in place without a question, and the project takes the folder's name), or just looks inside an app or file, a website or a game's files; a Game files screen (a game's archives; pictures from Unreal paks, Unity .assets files and Unity bundles saved as PNG after the person confirms they may unpack the game; uncompressed textures and the block formats DXT1, DXT5 and BC4–BC7), make prompt with picture attachments (picked, dropped, or pasted with Ctrl+V, shown as picture tiles) and, for anything recreated, a Clean room / Deep choice (also in the title bar; in Clean room, Just look inside, Game files, opening a file and the workbench ask for Deep mode instead), project screen (steps with the time spent and the AI cost and tokens of every build, saved in the project's usage.json by the run (a coding agent's figure is shown as an estimate at API prices, not the bill), what the build is on now and its activity as it arrives (kept in `build-activity.log`), pinned builder checklist, feed, question and approval cards, a Continue card when a build was paused or stopped part-way (the app or computer closed; the project shows Interrupted) that carries on the builder's own session instead of starting over, and "It's done" beside Continue or Try again to keep the build as it is (`project_build_finish`), checks with screenshots and the requirements not met yet, the builder's open questions, preview, play, folder, follow-ups while it builds, which Claude Code takes at its next step; Up in the prompt box takes back the last note still waiting). Projects can start in a folder the person picks, whose files are either the app, edited in place, or material to start from (asked, or the answer remembered in Settings), and are listed from any number of folders (`project_folders`, `project_list`, `rebuild --project-folder`). Make says which AI builds ("Built by": automatic, or any AI that can build, by name); a pick stays with the project and builds its later changes. With nothing to build with, Start offers the coding agents found on the computer. Settings → AI turns an AI off or removes it, and sets how hard the Claude API or Claude Code thinks (every Claude level, low to max; also `ai effort` in the CLI). In the prompt box, Up at the very start and Down at the very end go through earlier prompts when no note is waiting. Questions about a build ("Just ask" under the prompt box, or a message starting with `/btw`, the first slash command; `rebuild_question_ask`) are answered in the conversation, where each folds away and is kept in the project, without a build or a round and changing nothing: Claude Code answers from a read-only copy of the builder's own session. Under each project's prompt box, "Builder's questions: Ask me / Decide yourself" chooses whether the builder's questions come to the person as cards or are decided by the builder, which says what it chose (`project_questions_set`; the default is in Settings and follows Auto mode until picked). Projects can be renamed, duplicated and deleted (right-click in the sidebar, or the project's page; a delete keeps the person's own files). A build can be pinned (Pin this build on its page, or `project_pin_*` from the CLI and MCP): a frozen copy in the project's pinned/ folder (the default) or a light one that shares dependencies and media with the project through hard links (each one's size shown first), opened from the sidebar's collapsible Pinned section (icons with a running dot when folded); a pin or Play runs once per folder unless another copy is asked for, and a start that quits at once says so with its last output. Typed drafts survive a restart. In a narrow window the sidebar folds to icons and the project's details move above its feed; messages float over the screen and errors stay until dismissed. Advanced mode: workbench with every panel wired to real tools, as a screen beside the projects (builds and their questions stay a click away) | UI unit and smoke tests (egui_kittest), offscreen snapshots of every screen || CLI | Every tool, `--deep` or `--clean-room` for one run (never saved), `rebuild` (including `--continue-in`, and `--resume` to carry on a stopped build), `mcp --inbox`, `ai`, `setup`, `doctor`, `report` | CLI integration tests || SQLite database files (`db_sqlite_show`) | A rowid alias column (`INTEGER PRIMARY KEY`, including the table-constraint form) shows the rowid; `DESC`, non-`INTEGER` and composite keys keep their stored values | Hand-built fixtures; generated files compared with the official SQLite library || SQLite WITHOUT ROWID tables | Read from the index b-tree, interior records and overflow included; rows in primary-key order, values in declaration order, `rowid` null | Hand-built fixtures; generated files compared with the official SQLite library |