@zhongqian97-code/ecode 0.5.63 → 0.5.64

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/index.js CHANGED
@@ -802,7 +802,7 @@ if (rawArgs[0] === "web") {
802
802
  webAutoApprove = true;
803
803
  }
804
804
  }
805
- const { buildServer, generateAccessToken } = await import("./web-JSKN3U25.js");
805
+ const { buildServer, generateAccessToken } = await import("./web-X3KX3RJL.js");
806
806
  const token = finalConfig.webToken ?? generateAccessToken();
807
807
  const manager = new SessionManager(finalConfig);
808
808
  const __webDirname = dirname(fileURLToPath(import.meta.url));
@@ -56,7 +56,10 @@ function generateAdminHtml(version) {
56
56
  font-family: "Courier New", Courier, monospace;
57
57
  background: #0d1117;
58
58
  color: #c9d1d9;
59
- height: 100vh;
59
+ /* zoom \u653E\u5927\u6574\u4F53 UI\uFF1Bcalc \u8865\u507F\u8BA9\u89C6\u53E3\u9501\u5B9A\uFF0C\u907F\u514D 100vh \u88AB\u653E\u5927\u540E\u6EA2\u51FA */
60
+ zoom: var(--zoom, 1);
61
+ width: calc(100vw / var(--zoom, 1));
62
+ height: calc(100vh / var(--zoom, 1));
60
63
  display: flex;
61
64
  flex-direction: column;
62
65
  overflow: hidden;
@@ -510,6 +513,8 @@ function generateAdminHtml(version) {
510
513
  <h1>\u26A1 ecode web admin</h1>
511
514
  <span class="version">v${version}</span>
512
515
  <span id="topbar-model" class="version" style="display:none"></span>
516
+ <button id="zoom-out-btn" class="btn" title="\u7F29\u5C0F (Ctrl/Cmd -)" aria-label="\u7F29\u5C0F\u5B57\u4F53">A\u2212</button>
517
+ <button id="zoom-in-btn" class="btn" title="\u653E\u5927 (Ctrl/Cmd +)" aria-label="\u653E\u5927\u5B57\u4F53">A+</button>
513
518
  <button id="config-btn" class="btn">\u914D\u7F6E</button>
514
519
  <button id="upgrade-btn" class="btn">\u5347\u7EA7</button>
515
520
  <button id="toggle-tools-btn" class="btn">\u5DE5\u5177 \u25BE</button>
@@ -607,6 +612,7 @@ function generateAdminHtml(version) {
607
612
  showTools: true,
608
613
  skills: [], // cached skills from /api/skills
609
614
  skillsLoaded: false,
615
+ zoom: 1, // \u5168\u5C40 UI \u7F29\u653E\u7CFB\u6570
610
616
  };
611
617
 
612
618
  // \u2500\u2500 Toast \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
@@ -1391,6 +1397,32 @@ function generateAdminHtml(version) {
1391
1397
  }
1392
1398
  }
1393
1399
 
1400
+ // \u2500\u2500 \u5168\u5C40 UI \u7F29\u653E \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1401
+ function clampZoom(z) {
1402
+ z = Math.round(z * 10) / 10;
1403
+ if (!(z > 0)) z = 1;
1404
+ return Math.min(2, Math.max(0.6, z));
1405
+ }
1406
+ function applyZoom(z) {
1407
+ state.zoom = clampZoom(z);
1408
+ document.documentElement.style.setProperty('--zoom', state.zoom);
1409
+ try { localStorage.setItem('ecode-zoom', String(state.zoom)); } catch {}
1410
+ }
1411
+ function initZoom() {
1412
+ let z = 1;
1413
+ try { z = parseFloat(localStorage.getItem('ecode-zoom')) || 1; } catch {}
1414
+ applyZoom(z);
1415
+ }
1416
+ document.getElementById('zoom-in-btn').addEventListener('click', () => applyZoom(state.zoom + 0.1));
1417
+ document.getElementById('zoom-out-btn').addEventListener('click', () => applyZoom(state.zoom - 0.1));
1418
+ document.addEventListener('keydown', function(e) {
1419
+ if (!(e.ctrlKey || e.metaKey)) return;
1420
+ if (e.key === '=' || e.key === '+') { e.preventDefault(); applyZoom(state.zoom + 0.1); }
1421
+ else if (e.key === '-' || e.key === '_') { e.preventDefault(); applyZoom(state.zoom - 0.1); }
1422
+ else if (e.key === '0') { e.preventDefault(); applyZoom(1); }
1423
+ });
1424
+
1425
+ initZoom();
1394
1426
  loadSessions();
1395
1427
  initModel();
1396
1428
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhongqian97-code/ecode",
3
- "version": "0.5.63",
3
+ "version": "0.5.64",
4
4
  "description": "A minimal Claude Code clone with REPL interface and bash tool calling",
5
5
  "type": "module",
6
6
  "author": "zhongqian97-code",