From 8e75a0bf5601ee914cd64a8a802d0198857e60eb Mon Sep 17 00:00:00 2001 From: AgentScrubbles Date: Thu, 23 Jul 2026 14:38:04 -0700 Subject: [PATCH] Autofill launch name on version import (#373) (#447) Co-authored-by: Robert Clabough --- server/components/ImportVersionLaunchRow.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/components/ImportVersionLaunchRow.vue b/server/components/ImportVersionLaunchRow.vue index a4a366aa..a59a6663 100644 --- a/server/components/ImportVersionLaunchRow.vue +++ b/server/components/ImportVersionLaunchRow.vue @@ -292,6 +292,18 @@ const launchFilteredVersionGuesses = computed(() => function updateLaunchCommand(command: string) { launchConfiguration.value.launch = command; + + // Auto-fill name from filename if user hasn't set one (#373) + if (!launchConfiguration.value.name) { + const guess = props.versionGuesses?.find((v) => v.filename === command); + if (guess?.type === "emulator") { + launchConfiguration.value.name = guess.launchName; + } else { + const basename = command.split("/").pop() ?? command; + launchConfiguration.value.name = basename.replace(/\.[^.]+$/, ""); + } + } + if (launchConfiguration.value.platform === undefined) { const autosetGuess = props.versionGuesses?.find( (v) => v.filename == command,