feat: pre-populate upload title with filename when no IGDB matches
Build & Deploy / build-and-deploy (push) Successful in 2m17s

When a game ZIP is selected and IGDB returns no matches, the search
box is now pre-filled with the filename (minus .zip extension) so
the user can edit it rather than typing from scratch.
This commit is contained in:
Hermes Agent
2026-06-01 12:41:24 +02:00
parent 677740aece
commit 4044ef3786
+3 -3
View File
@@ -130,7 +130,7 @@
const name = file.name.replace(/\.zip$/i, ""); const name = file.name.replace(/\.zip$/i, "");
pendingFile = file; pendingFile = file;
pendingFileName = name; pendingFileName = name;
pendingTitle = ""; pendingTitle = name;
igdbResults = null; igdbResults = null;
searching = true; searching = true;
searchError = ""; searchError = "";
@@ -369,12 +369,12 @@
{/if} {/if}
</div> </div>
{:else} {:else}
<p class="match-label">No matches found. Enter a title to search IGDB:</p> <p class="match-label">No matches found. Edit the title below and search IGDB:</p>
{/if} {/if}
<div class="upload-custom-row"> <div class="upload-custom-row">
<input <input
type="text" type="text"
placeholder="Search IGDB..." placeholder="Edit title..."
bind:value={pendingTitle} bind:value={pendingTitle}
disabled={uploading || searching} disabled={uploading || searching}
onkeydown={(e) => e.key === "Enter" && handleManualSearch()} onkeydown={(e) => e.key === "Enter" && handleManualSearch()}