From 54a5af96c739f7b21c1c58e516909217e0fc0d4d Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 7 Apr 2026 07:00:06 +0300 Subject: [PATCH] Tab-autokorjaus: korjattu ohitettu autocorrect Tab-handlerissa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tab-painallus meni suoraan dropdown-getCandidatesiin eikä kutsunut autocorrectiä. Nyt Tab yrittää ensin korjata typon, sitten täydentää. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 08e21f3..8fd1f9a 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2645,7 +2645,14 @@ Files: ${Object.keys(generatedFiles).join(', ')}`; } } else if (e.key === 'Tab') { e.preventDefault(); - // Näytä dropdown tai täydennä jos vain yksi vaihtoehto + // 1. Autokorjaus ensin + const corrected = autocorrect(termInput.value.trim()); + if (corrected && corrected !== termInput.value.trim()) { + termInput.value = corrected; + hideDropdown(); + return; + } + // 2. Dropdown / täydennys const { items, prefix } = getCandidates(termInput.value); if (items.length === 1) { termInput.value = prefix + items[0] + (items[0].startsWith('"') ? '' : ' ');