fix(studio): keep project directory checks behind core services
Test / Tests and coverage
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

This commit is contained in:
2026-11-21 15:38:49 +00:00
parent 675ffe5f2a
commit 2e2af7be7e
5 changed files with 39 additions and 2 deletions
@@ -18,7 +18,6 @@ import p.studio.ui.javafx2.components.*;
import p.studio.ui.javafx2.play.PlaybackViewport;
import p.studio.ui.javafx2.shell.MinimalShell;
import java.nio.file.Path;
import java.nio.file.Files;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
@@ -141,7 +140,7 @@ public final class StudioWindowCoordinator2 implements AutoCloseable {
}
private void reloadProjects(Path selection){
chooser.busy(true);
background(()->{var root=catalog.projectsRoot();return new ProjectList(known.listKnownProjects(),Files.isDirectory(root)?root:null);},(result,failure)->{
background(()->new ProjectList(known.listKnownProjects(),catalog.existingProjectsRoot().orElse(null)),(result,failure)->{
if(project!=null)return;
chooser.busy(busy||opening.busy());if(failure!=null){error(failure);return;}
initialDirectory=result.root();chooser.projects(result.projects(),selection);
@@ -39,6 +39,7 @@ class ProjectOpeningTest {
Fixture(){
ProjectCatalog catalog=new ProjectCatalog(){
public Path projectsRoot(){return ROOT;}
public Optional<Path> existingProjectsRoot(){return Optional.of(ROOT);}
public List<ProjectReference> listProjects(){return List.of(REF);}
public ProjectReference openProject(Path path){fail("catalog");return REF;}
public ProjectReference openProjectManifest(Path path){return openProject(path);}