@xulongzhe/clawbench-desktop-linux-x64-payload 0.104.0 → 0.105.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xulongzhe/clawbench-desktop-linux-x64-payload",
3
- "version": "0.104.0",
3
+ "version": "0.105.0",
4
4
  "description": "ClawBench desktop client — Linux x64 incremental-upgrade payload (app files only, no Electron runtime)",
5
5
  "files": [
6
6
  "payload.json",
Binary file
@@ -36,7 +36,8 @@
36
36
  splash_loading: 'Loading page…',
37
37
  splash_rendering: 'Rendering…',
38
38
  splash_initializing: 'Initializing app…',
39
- splash_cancel: 'Cancel connection'
39
+ splash_cancel: 'Cancel connection',
40
+ window_close: 'Close'
40
41
  },
41
42
  zh: {
42
43
  slogan: '从终端到桌面',
@@ -67,7 +68,8 @@
67
68
  splash_loading: '正在加载页面…',
68
69
  splash_rendering: '正在渲染…',
69
70
  splash_initializing: '正在初始化应用…',
70
- splash_cancel: '取消连接'
71
+ splash_cancel: '取消连接',
72
+ window_close: '关闭'
71
73
  }
72
74
  };
73
75
  var LANG = 'en';
@@ -715,6 +717,76 @@
715
717
  position: relative;
716
718
  overflow: hidden;
717
719
  -webkit-tap-highlight-color: transparent;
720
+ /* This page IS the window on first run and whenever the server is
721
+ unreachable, and the window is frameless on Windows/Linux — so without a
722
+ drag region the login window could not be moved at all. The whole page is
723
+ the handle (there is no title bar), which is why every interactive
724
+ element below has to opt back out. Ignored on macOS/Android/browser. */
725
+ -webkit-app-region: drag;
726
+ -webkit-user-select: none;
727
+ user-select: none;
728
+ }
729
+
730
+ /* Opt out of the page-wide drag handle. Without this the inputs and buttons
731
+ would be undraggable-but-unclickable — a click would start a window move.
732
+ `.dlg-box` is included because the confirmation dialog's message text
733
+ should be selectable, and `.server-item` because its rows are clickable. */
734
+ input,
735
+ button,
736
+ select,
737
+ a,
738
+ .form-card,
739
+ .server-list,
740
+ .field-group,
741
+ .server-item,
742
+ .dlg-box,
743
+ .dlg-actions {
744
+ -webkit-app-region: no-drag;
745
+ }
746
+
747
+ /* Text the user may want to select (server URLs, error messages) opts out of
748
+ both the drag region and the inherited user-select:none. */
749
+ input,
750
+ .server-url,
751
+ .error-message,
752
+ .splash-stage {
753
+ -webkit-user-select: text;
754
+ user-select: text;
755
+ }
756
+
757
+ /* Window close, for the frameless Windows/Linux shell. Pinned to the window's
758
+ top-right — the same corner the native controls occupy on those platforms. */
759
+ .window-close {
760
+ position: fixed;
761
+ top: 0;
762
+ right: 0;
763
+ width: 46px;
764
+ height: 32px;
765
+ display: flex;
766
+ align-items: center;
767
+ justify-content: center;
768
+ padding: 0;
769
+ border: none;
770
+ border-radius: 0 0 0 6px;
771
+ background: transparent;
772
+ color: var(--text-hint);
773
+ cursor: pointer;
774
+ z-index: 200;
775
+ transition: background 150ms ease, color 150ms ease;
776
+ }
777
+
778
+ .window-close svg {
779
+ width: 15px;
780
+ height: 15px;
781
+ }
782
+
783
+ .window-close:hover {
784
+ background: var(--color-red, #ef4444);
785
+ color: #fff;
786
+ }
787
+
788
+ .window-close[hidden] {
789
+ display: none;
718
790
  }
719
791
 
720
792
  /* Decorative background — matches LoginView.vue */
@@ -1405,6 +1477,19 @@
1405
1477
  <div class="bg-gradient"></div>
1406
1478
  <div class="bg-grid"></div>
1407
1479
 
1480
+ <!-- Window close, for the frameless Windows/Linux shell.
1481
+ This document has no AppHeader, so it is the ONLY way to close the window
1482
+ on first run or when the server is unreachable — without it the window
1483
+ would have no close affordance at all. Hidden unless the host reports
1484
+ app-drawn controls (macOS keeps its traffic lights, and Android is not a
1485
+ window), so it never duplicates a native button. -->
1486
+ <button type="button" class="window-close" id="windowClose" data-i18n-aria-label="window_close" data-i18n-title="window_close" aria-label="Close" title="Close" hidden>
1487
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
1488
+ <line x1="6" y1="6" x2="18" y2="18"/>
1489
+ <line x1="18" y1="6" x2="6" y2="18"/>
1490
+ </svg>
1491
+ </button>
1492
+
1408
1493
  <div class="content">
1409
1494
  <!-- Brand -->
1410
1495
  <div class="brand">
@@ -1545,6 +1630,15 @@
1545
1630
  document.querySelectorAll('[data-i18n-placeholder]').forEach(function(el) {
1546
1631
  el.placeholder = t(el.getAttribute('data-i18n-placeholder'));
1547
1632
  });
1633
+ // Attribute-valued strings (tooltips, accessible names). The icon-only
1634
+ // close button has no text to translate, so without these it would keep its
1635
+ // hard-coded English label in every language.
1636
+ document.querySelectorAll('[data-i18n-title]').forEach(function(el) {
1637
+ el.title = t(el.getAttribute('data-i18n-title'));
1638
+ });
1639
+ document.querySelectorAll('[data-i18n-aria-label]').forEach(function(el) {
1640
+ el.setAttribute('aria-label', t(el.getAttribute('data-i18n-aria-label')));
1641
+ });
1548
1642
  }
1549
1643
 
1550
1644
  // ── Splash overlay (?splash=1) ──────────────────────────────────────────
@@ -1589,6 +1683,25 @@
1589
1683
  document.body.classList.add('splash-mode');
1590
1684
  }
1591
1685
 
1686
+ /**
1687
+ * Reveal and wire the window close button when the host draws its own
1688
+ * controls (frameless Windows/Linux). `hasCustomWindowControls` is absent on
1689
+ * older hosts, macOS and Android — the button stays hidden there, so it never
1690
+ * duplicates a native close button. Runs before DOMContentLoaded so the
1691
+ * button is usable even while the splash overlay is up.
1692
+ */
1693
+ (function initWindowClose() {
1694
+ var btn = document.getElementById('windowClose');
1695
+ if (!btn) return;
1696
+ var supported = false;
1697
+ try { supported = ClawBenchNative.hasCustomWindowControls && ClawBenchNative.hasCustomWindowControls() === true; } catch(e) {}
1698
+ if (!supported) return;
1699
+ btn.hidden = false;
1700
+ btn.addEventListener('click', function() {
1701
+ try { ClawBenchNative.windowClose(); } catch(e) {}
1702
+ });
1703
+ })();
1704
+
1592
1705
  window.addEventListener('DOMContentLoaded', function() {
1593
1706
  // Apply i18n to all elements with data-i18n / data-i18n-placeholder
1594
1707
  applyI18n();