@wendongfly/myhi 1.3.17 → 1.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/chat.html CHANGED
@@ -482,14 +482,17 @@
482
482
  <!-- Git 安装视图 -->
483
483
  <div id="skill-import-view" style="display:none;flex:1;overflow-y:auto;scrollbar-width:thin;padding:0.3rem 0.2rem">
484
484
  <div style="display:flex;flex-direction:column;gap:0.4rem">
485
- <input id="skill-git-url" class="slash-inp" placeholder="Git 仓库地址 (https:// 或 git@...)" autocomplete="off">
485
+ <div style="display:flex;gap:0.4rem">
486
+ <input id="skill-git-url" class="slash-inp" placeholder="Git 仓库地址 (https:// 或 git@...)" autocomplete="off" style="flex:1">
487
+ <button onclick="scanGitSkills()" style="background:#7c3aed;color:#fff;border:none;border-radius:8px;padding:0.5rem 0.8rem;font-size:0.82rem;cursor:pointer;white-space:nowrap">扫描</button>
488
+ </div>
486
489
  <select id="skill-import-scope" class="slash-inp" style="background:#0d1117;color:#c9d1d9;border:1px solid #30363d;border-radius:8px;padding:0.5rem;font-size:0.82rem">
487
490
  <option value="user">安装到用户级 (~/.claude/commands/)</option>
488
491
  <option value="project">安装到项目级 (.claude/commands/)</option>
489
492
  </select>
490
493
  </div>
491
494
  <div id="skill-import-preview" style="display:none;margin-top:0.5rem;padding:0.5rem;background:#0d1117;border:1px solid #30363d;border-radius:8px;font-size:0.78rem;max-height:30vh;overflow-y:auto;scrollbar-width:thin"></div>
492
- <button id="skill-import-scan-btn" class="action-sheet-cancel" style="background:#7c3aed;color:#fff;font-weight:600;margin-top:0.5rem;margin-bottom:0.4rem" onclick="scanGitSkills()">扫描技能</button>
495
+ <div id="skill-import-scan-btn"></div>
493
496
  <button id="skill-import-install-btn" class="action-sheet-cancel" style="display:none;background:#3fb950;color:#000;font-weight:600;margin-bottom:0.4rem" onclick="installGitSkills()">安装选中的技能</button>
494
497
  <button class="action-sheet-cancel" onclick="backToSkillList()">返回列表</button>
495
498
  </div>
@@ -2115,17 +2118,23 @@
2115
2118
  document.getElementById('skill-sheet-title').textContent = '从 Git 安装技能';
2116
2119
  document.getElementById('skill-import-preview').style.display = 'none';
2117
2120
  document.getElementById('skill-import-install-btn').style.display = 'none';
2118
- document.getElementById('skill-import-scan-btn').style.display = '';
2121
+ document.getElementById('skill-import-scan-btn').innerHTML = '';
2119
2122
  document.getElementById('skill-git-url').value = '';
2120
2123
  _gitSkills = [];
2124
+ setTimeout(() => document.getElementById('skill-git-url').focus(), 100);
2121
2125
  };
2122
2126
 
2127
+ document.getElementById('skill-git-url')?.addEventListener('keydown', (e) => {
2128
+ if (e.key === 'Enter') { e.preventDefault(); scanGitSkills(); }
2129
+ });
2130
+
2123
2131
  window.scanGitSkills = async function() {
2124
2132
  const url = document.getElementById('skill-git-url').value.trim();
2125
2133
  if (!url) { addStatusMessage('请输入 Git 仓库地址'); return; }
2126
- const btn = document.getElementById('skill-import-scan-btn');
2127
- btn.textContent = '正在克隆并扫描...';
2128
- btn.disabled = true;
2134
+ const statusEl = document.getElementById('skill-import-scan-btn');
2135
+ statusEl.innerHTML = '<div style="text-align:center;color:#8b949e;padding:0.5rem 0">正在克隆并扫描...</div>';
2136
+ document.getElementById('skill-import-preview').style.display = 'none';
2137
+ document.getElementById('skill-import-install-btn').style.display = 'none';
2129
2138
  try {
2130
2139
  const resp = await fetch('/api/skills/scan-git', {
2131
2140
  method: 'POST',
@@ -2133,6 +2142,7 @@
2133
2142
  body: JSON.stringify({ url }),
2134
2143
  });
2135
2144
  const data = await resp.json();
2145
+ statusEl.innerHTML = '';
2136
2146
  if (data.error) { addStatusMessage(data.error); return; }
2137
2147
  _gitSkills = data.skills || [];
2138
2148
  if (!_gitSkills.length) {
@@ -2153,9 +2163,7 @@
2153
2163
  document.getElementById('skill-import-install-btn').style.display = '';
2154
2164
  } catch (e) {
2155
2165
  addStatusMessage('扫描失败: ' + e.message);
2156
- } finally {
2157
- btn.textContent = '扫描技能';
2158
- btn.disabled = false;
2166
+ statusEl.innerHTML = '';
2159
2167
  }
2160
2168
  };
2161
2169