From 3737672fb272d282711623621b5f1add18096e41 Mon Sep 17 00:00:00 2001 From: logikonline Date: Sun, 18 Jan 2026 15:28:13 -0500 Subject: [PATCH] refactor: update branding and improve name input UI in demo - Update context menu labels from "My Addon" to "MyFirst Addon" for consistency - Replace prompt dialog with inline text input field for better UX - Add input validation with focus feedback when name is empty --- addon.json | 4 ++-- main/index.js | 4 ++-- views/demo.html | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/addon.json b/addon.json index 49d4808..167630f 100644 --- a/addon.json +++ b/addon.json @@ -193,7 +193,7 @@ { "id": "file-context-action", "context": "file-list", - "label": "Process with My Addon", + "label": "Process with MyFirst Addon", "onClick": { "action": "invoke-method", "method": "processFiles" @@ -202,7 +202,7 @@ { "id": "commit-context-action", "context": "commit-list", - "label": "Analyze Commit", + "label": "Analyze with MyFirst Addon", "onClick": { "action": "invoke-method", "method": "analyzeCommit" diff --git a/main/index.js b/main/index.js index 6bd6177..7f7471d 100644 --- a/main/index.js +++ b/main/index.js @@ -371,7 +371,7 @@ class MyFirstAddon { const fileList = files.map(f => f.path).join(', '); this.context?.ipc.send('show-notification', { - title: 'Process with My Addon', + title: 'Process with MyFirst Addon', body: `Processing ${fileCount} file(s): ${fileList}`, }); @@ -397,7 +397,7 @@ class MyFirstAddon { // Show notification to demonstrate the context menu is working this.context?.ipc.send('show-notification', { - title: 'Analyze Commit', + title: 'Analyze with MyFirst Addon', body: `Analyzing commit: ${commit?.sha?.substring(0, 7) || 'unknown'}\n${commit?.summary || ''}`, }); diff --git a/views/demo.html b/views/demo.html index d651dfa..15dc36f 100644 --- a/views/demo.html +++ b/views/demo.html @@ -437,6 +437,12 @@ + +
+ @@ -772,8 +778,13 @@ } async function callHelloWorldWithName() { - const name = prompt('Enter your name:', 'World'); - if (!name) return; + const nameInput = document.getElementById('name-input'); + const name = nameInput.value.trim(); + if (!name) { + log('warn', 'Please enter a name in the input field'); + nameInput.focus(); + return; + } const resultEl = document.getElementById('host-result'); resultEl.innerHTML = ' Calling host...';