appWorkspaceDir

fun appWorkspaceDir(activeWorkspace: Path, analysisName: String, modelName: String): Path(source)

Resolve the single-app's workspace directory for a given (analysisName, modelName) pair. Three-tier fallback:

  1. When analysisName is non-blank AND not the UNTITLED sentinel, returns <activeWorkspace>/<analysisFolder(analysisName)>/.

  2. Else when modelName is non-empty, returns <activeWorkspace>/<modelName>/. The caller is responsible for modelName already being a filesystem-safe segment — KSL's Model(simulationName) constructor replaces spaces with underscores, so models built through it satisfy this contract automatically.

  3. Else returns activeWorkspace itself. This branch fires when the host's model probe failed and the controller has no name to derive a folder from; file dialogs still get a valid starting point.

The directory is not created by this helper.