aicodeman 1.50.0 → 1.50.1
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/README.md +7 -2
- package/dist/config-backup.js +1 -1
- package/dist/config-backup.js.map +1 -1
- package/dist/local-model/install-job.d.ts.map +1 -1
- package/dist/local-model/install-job.js +10 -2
- package/dist/local-model/install-job.js.map +1 -1
- package/dist/types/common.d.ts +5 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/web/case-state-sync.d.ts +28 -0
- package/dist/web/case-state-sync.d.ts.map +1 -0
- package/dist/web/case-state-sync.js +41 -0
- package/dist/web/case-state-sync.js.map +1 -0
- package/dist/web/public/admin-ui.js.gz +0 -0
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/{app.8719143d.js → app.07398d90.js} +1 -1
- package/dist/web/public/app.07398d90.js.br +0 -0
- package/dist/web/public/app.07398d90.js.gz +0 -0
- package/dist/web/public/approvals-ui.js.gz +0 -0
- package/dist/web/public/constants.782170e1.js.gz +0 -0
- package/dist/web/public/cron-ui.js.gz +0 -0
- package/dist/web/public/edit-history-ui.js.gz +0 -0
- package/dist/web/public/entrance-animations.js.gz +0 -0
- package/dist/web/public/foreign-sessions.js.gz +0 -0
- package/dist/web/public/git-status-ui.js.gz +0 -0
- package/dist/web/public/header-divider.eb2d2463.js.gz +0 -0
- package/dist/web/public/home-sessions.js +38 -18
- package/dist/web/public/home-sessions.js.br +0 -0
- package/dist/web/public/home-sessions.js.gz +0 -0
- package/dist/web/public/host-wake-ui.js.gz +0 -0
- package/dist/web/public/{i18n.1e96a258.js → i18n.519d025e.js} +2 -2
- package/dist/web/public/i18n.519d025e.js.br +0 -0
- package/dist/web/public/{i18n.1e96a258.js.gz → i18n.519d025e.js.gz} +0 -0
- package/dist/web/public/image-input.a5d0f8f3.js.gz +0 -0
- package/dist/web/public/index.html +30 -9
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.8bc46081.js.gz +0 -0
- package/dist/web/public/{keyboard-accessory.b941676c.js → keyboard-accessory.0800fc44.js} +160 -2
- package/dist/web/public/keyboard-accessory.0800fc44.js.br +0 -0
- package/dist/web/public/keyboard-accessory.0800fc44.js.gz +0 -0
- package/dist/web/public/local-model-ui.js.gz +0 -0
- package/dist/web/public/mobile-handlers.f7c3f692.js.gz +0 -0
- package/dist/web/public/mobile-ime-preview.2dbaf262.js.gz +0 -0
- package/dist/web/public/mobile-overview.js +30 -14
- package/dist/web/public/mobile-overview.js.br +0 -0
- package/dist/web/public/mobile-overview.js.gz +0 -0
- package/dist/web/public/mobile.4dfd5c55.css.gz +0 -0
- package/dist/web/public/notification-manager.feb82c04.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/{panels-ui.d3f4f1c4.js → panels-ui.9ba2683e.js} +99 -97
- package/dist/web/public/panels-ui.9ba2683e.js.br +0 -0
- package/dist/web/public/panels-ui.9ba2683e.js.gz +0 -0
- package/dist/web/public/ralph-panel.b350e2ef.js.gz +0 -0
- package/dist/web/public/ralph-wizard.b6c0dd19.js.gz +0 -0
- package/dist/web/public/readmymind-ui.js.gz +0 -0
- package/dist/web/public/reboot-restore-ui.js.gz +0 -0
- package/dist/web/public/respawn-ui.304ba0d4.js.gz +0 -0
- package/dist/web/public/sanitize-html.e7147e76.js.gz +0 -0
- package/dist/web/public/session-lineage.js.gz +0 -0
- package/dist/web/public/{session-ui.a7c8c095.js → session-ui.8f300b14.js} +21 -21
- package/dist/web/public/session-ui.8f300b14.js.br +0 -0
- package/dist/web/public/session-ui.8f300b14.js.gz +0 -0
- package/dist/web/public/{settings-ui.11da6f15.js → settings-ui.8b37cf07.js} +14 -14
- package/dist/web/public/settings-ui.8b37cf07.js.br +0 -0
- package/dist/web/public/settings-ui.8b37cf07.js.gz +0 -0
- package/dist/web/public/spreadsheet-preview-worker.js.gz +0 -0
- package/dist/web/public/spreadsheet-preview.75c751de.js.gz +0 -0
- package/dist/web/public/spreadsheet-xlsx-core.js.gz +0 -0
- package/dist/web/public/{styles.63382d6e.css → styles.21b93520.css} +1 -1
- package/dist/web/public/styles.21b93520.css.br +0 -0
- package/dist/web/public/{styles.63382d6e.css.gz → styles.21b93520.css.gz} +0 -0
- package/dist/web/public/subagent-windows.07277a58.js.gz +0 -0
- package/dist/web/public/sw.js +2 -2
- package/dist/web/public/sw.js.br +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/tab-layout-browser.2d6189f7.js.gz +0 -0
- package/dist/web/public/tab-rail-resize.b5cdceaf.js.gz +0 -0
- package/dist/web/public/terminal-keycode229-recovery.98843069.js.gz +0 -0
- package/dist/web/public/terminal-split.js.gz +0 -0
- package/dist/web/public/terminal-tile.js.gz +0 -0
- package/dist/web/public/terminal-ui.f92eae28.js.gz +0 -0
- package/dist/web/public/tile-grid.js.gz +0 -0
- package/dist/web/public/ultracode-panel.js.gz +0 -0
- package/dist/web/public/ultracode-windows.js.gz +0 -0
- package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
- package/dist/web/public/vendor/exceljs.min.js.gz +0 -0
- package/dist/web/public/vendor/fflate.min.js.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-predictive-echo.276b11d9.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.1be42307.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/{voice-input.2342c37b.js → voice-input.d0580528.js} +232 -137
- package/dist/web/public/voice-input.d0580528.js.br +0 -0
- package/dist/web/public/voice-input.d0580528.js.gz +0 -0
- package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
- package/dist/web/public/webview-tabs.js.gz +0 -0
- package/dist/web/public/whats-new.json +9 -9
- package/dist/web/routes/case-routes.d.ts.map +1 -1
- package/dist/web/routes/case-routes.js +31 -5
- package/dist/web/routes/case-routes.js.map +1 -1
- package/dist/web/routes/file-routes.d.ts +4 -2
- package/dist/web/routes/file-routes.d.ts.map +1 -1
- package/dist/web/routes/file-routes.js +92 -2
- package/dist/web/routes/file-routes.js.map +1 -1
- package/dist/web/routes/system-routes.d.ts +2 -2
- package/dist/web/routes/system-routes.d.ts.map +1 -1
- package/dist/web/routes/system-routes.js +23 -4
- package/dist/web/routes/system-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +7 -0
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +14 -0
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/voice-stream.d.ts +4 -3
- package/dist/web/voice-stream.d.ts.map +1 -1
- package/dist/web/voice-stream.js +5 -4
- package/dist/web/voice-stream.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/app.8719143d.js.br +0 -0
- package/dist/web/public/app.8719143d.js.gz +0 -0
- package/dist/web/public/i18n.1e96a258.js.br +0 -0
- package/dist/web/public/keyboard-accessory.b941676c.js.br +0 -0
- package/dist/web/public/keyboard-accessory.b941676c.js.gz +0 -0
- package/dist/web/public/panels-ui.d3f4f1c4.js.br +0 -0
- package/dist/web/public/panels-ui.d3f4f1c4.js.gz +0 -0
- package/dist/web/public/session-ui.a7c8c095.js.br +0 -0
- package/dist/web/public/session-ui.a7c8c095.js.gz +0 -0
- package/dist/web/public/settings-ui.11da6f15.js.br +0 -0
- package/dist/web/public/settings-ui.11da6f15.js.gz +0 -0
- package/dist/web/public/styles.63382d6e.css.br +0 -0
- package/dist/web/public/voice-input.2342c37b.js.br +0 -0
- package/dist/web/public/voice-input.2342c37b.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<link rel="manifest" href="manifest.json">
|
|
17
17
|
<title>Codeman</title>
|
|
18
18
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%2360a5fa'/%3E%3Cstop offset='100%25' stop-color='%233b82f6'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='32' height='32' rx='6' fill='%230a0a0a'/%3E%3Cpath d='M18 4L8 18h6l-2 10 10-14h-6z' fill='url(%23g)'/%3E%3C/svg%3E">
|
|
19
|
-
<link rel="stylesheet" href="styles.
|
|
19
|
+
<link rel="stylesheet" href="styles.21b93520.css">
|
|
20
20
|
<link rel="stylesheet" href="mobile.4dfd5c55.css" media="(max-width: 1023px)">
|
|
21
21
|
<!-- xterm.css loaded async — terminal won't display until xterm.js runs anyway -->
|
|
22
22
|
<link rel="preload" href="vendor/xterm.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
leaves tofu in xterm's glyph atlas until something forces a re-render. -->
|
|
29
29
|
<link rel="preload" href="fonts/symbols-nerd-font-mono.woff2" as="font" type="font/woff2" crossorigin>
|
|
30
30
|
<link rel="preload" href="constants.782170e1.js" as="script">
|
|
31
|
-
<link rel="preload" href="app.
|
|
31
|
+
<link rel="preload" href="app.07398d90.js" as="script">
|
|
32
32
|
<!-- Self-hosted xterm.js — eliminates CDN DNS/TLS latency (~100ms).
|
|
33
33
|
'defer' preserves execution order (xterm loads before fit addon). -->
|
|
34
34
|
<script defer src="vendor/xterm.min.js"></script>
|
|
@@ -3456,6 +3456,20 @@
|
|
|
3456
3456
|
<option value="compose">Compose dialog</option>
|
|
3457
3457
|
</select>
|
|
3458
3458
|
</div>
|
|
3459
|
+
<div class="set-row has-field" data-search="voice silence pause timeout manual stop recording">
|
|
3460
|
+
<div class="set-row-text">
|
|
3461
|
+
<label class="set-row-label" for="voiceSilenceTimeout">Stop after silence</label>
|
|
3462
|
+
<span class="set-row-desc">Allow time to think between phrases. Manual keeps listening until you tap the mic again.</span>
|
|
3463
|
+
</div>
|
|
3464
|
+
<select id="voiceSilenceTimeout" class="set-select">
|
|
3465
|
+
<option value="default">Provider default</option>
|
|
3466
|
+
<option value="3">3 seconds</option>
|
|
3467
|
+
<option value="6">6 seconds</option>
|
|
3468
|
+
<option value="15">15 seconds</option>
|
|
3469
|
+
<option value="30">30 seconds</option>
|
|
3470
|
+
<option value="0">Manual</option>
|
|
3471
|
+
</select>
|
|
3472
|
+
</div>
|
|
3459
3473
|
<div class="set-row has-field" data-search="voice language">
|
|
3460
3474
|
<div class="set-row-text">
|
|
3461
3475
|
<span class="set-row-label">Language</span>
|
|
@@ -3572,6 +3586,13 @@
|
|
|
3572
3586
|
</div>
|
|
3573
3587
|
<input type="text" id="appSettingsDefaultDir" class="set-input" placeholder="~/projects">
|
|
3574
3588
|
</div>
|
|
3589
|
+
<div class="set-row" data-search="sync cases across devices selected case agent teams opus 1m">
|
|
3590
|
+
<div class="set-row-text">
|
|
3591
|
+
<span class="set-row-label">Sync cases across devices</span>
|
|
3592
|
+
<span class="set-row-desc">Keeps each case's Agent Teams and Opus 1M options on the server and switches this device to the case you last chose on another one when you return to the tab. Off by default: each browser keeps its own. The case names are stored in the shared settings file.</span>
|
|
3593
|
+
</div>
|
|
3594
|
+
<label class="switch switch-sm"><input type="checkbox" id="appSettingsSyncCaseState" aria-label="Sync cases across devices"><span class="slider"></span></label>
|
|
3595
|
+
</div>
|
|
3575
3596
|
</div>
|
|
3576
3597
|
</div>
|
|
3577
3598
|
|
|
@@ -4698,11 +4719,11 @@
|
|
|
4698
4719
|
</div>
|
|
4699
4720
|
|
|
4700
4721
|
<script defer src="constants.782170e1.js"></script>
|
|
4701
|
-
<script defer src="i18n.
|
|
4722
|
+
<script defer src="i18n.519d025e.js"></script>
|
|
4702
4723
|
<script defer src="mobile-handlers.f7c3f692.js"></script>
|
|
4703
|
-
<script defer src="voice-input.
|
|
4724
|
+
<script defer src="voice-input.d0580528.js"></script>
|
|
4704
4725
|
<script defer src="notification-manager.feb82c04.js"></script>
|
|
4705
|
-
<script defer src="keyboard-accessory.
|
|
4726
|
+
<script defer src="keyboard-accessory.0800fc44.js"></script>
|
|
4706
4727
|
<script defer src="input-cjk.8bc46081.js"></script>
|
|
4707
4728
|
<!-- Shows iOS Safari IME composition text inside the terminal. Must precede terminal-ui.js. -->
|
|
4708
4729
|
<script defer src="mobile-ime-preview.2dbaf262.js"></script>
|
|
@@ -4712,7 +4733,7 @@
|
|
|
4712
4733
|
<script defer src="sanitize-html.e7147e76.js"></script>
|
|
4713
4734
|
<!-- Owner tab layout projection (grouped vertical rail); pure, read by app.js. -->
|
|
4714
4735
|
<script defer src="tab-layout-browser.2d6189f7.js"></script>
|
|
4715
|
-
<script defer src="app.
|
|
4736
|
+
<script defer src="app.07398d90.js"></script>
|
|
4716
4737
|
<script defer src="tab-rail-resize.b5cdceaf.js"></script>
|
|
4717
4738
|
<script defer src="header-divider.eb2d2463.js"></script>
|
|
4718
4739
|
<script defer src="terminal-ui.f92eae28.js"></script>
|
|
@@ -4723,14 +4744,14 @@
|
|
|
4723
4744
|
<script defer src="ralph-panel.b350e2ef.js"></script>
|
|
4724
4745
|
<script defer src="orchestrator-panel.js"></script>
|
|
4725
4746
|
<script defer src="cron-ui.js"></script>
|
|
4726
|
-
<script defer src="settings-ui.
|
|
4727
|
-
<script defer src="panels-ui.
|
|
4747
|
+
<script defer src="settings-ui.8b37cf07.js"></script>
|
|
4748
|
+
<script defer src="panels-ui.9ba2683e.js"></script>
|
|
4728
4749
|
<script defer src="readmymind-ui.js"></script>
|
|
4729
4750
|
<script defer src="ultracode-panel.js"></script>
|
|
4730
4751
|
<script defer src="approvals-ui.js"></script>
|
|
4731
4752
|
<script defer src="reboot-restore-ui.js"></script>
|
|
4732
4753
|
<script defer src="admin-ui.js"></script>
|
|
4733
|
-
<script defer src="session-ui.
|
|
4754
|
+
<script defer src="session-ui.8f300b14.js"></script>
|
|
4734
4755
|
<script defer src="host-wake-ui.js"></script>
|
|
4735
4756
|
<script defer src="webview-tabs.js"></script>
|
|
4736
4757
|
<script defer src="mobile-overview.js"></script>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -74,6 +74,8 @@ const PathPicker = {
|
|
|
74
74
|
_previewOverlay: null,
|
|
75
75
|
_previewRequestSequence: 0,
|
|
76
76
|
_previewPreviousFocus: null,
|
|
77
|
+
_previewImageCleanup: null,
|
|
78
|
+
_previewImageZoom: null,
|
|
77
79
|
_showHidden: false,
|
|
78
80
|
_sortMode: PATH_PICKER_DEFAULT_SORT,
|
|
79
81
|
|
|
@@ -563,6 +565,11 @@ const PathPicker = {
|
|
|
563
565
|
<strong class="path-preview-title"></strong>
|
|
564
566
|
<span class="path-preview-path"></span>
|
|
565
567
|
</div>
|
|
568
|
+
<div class="path-preview-zoom" hidden aria-label="Image zoom controls">
|
|
569
|
+
<button type="button" data-zoom="out" aria-label="Zoom out">−</button>
|
|
570
|
+
<button type="button" data-zoom="fit" aria-label="Fit image">Fit</button>
|
|
571
|
+
<button type="button" data-zoom="in" aria-label="Zoom in">+</button>
|
|
572
|
+
</div>
|
|
566
573
|
<a class="path-preview-open" target="_blank" rel="noopener noreferrer">Open</a>
|
|
567
574
|
<button type="button" class="path-preview-close" aria-label="Close preview">×</button>
|
|
568
575
|
</div>
|
|
@@ -580,13 +587,30 @@ const PathPicker = {
|
|
|
580
587
|
|
|
581
588
|
const body = overlay.querySelector('.path-preview-body');
|
|
582
589
|
if (entry.previewKind === 'image') {
|
|
590
|
+
const zoomControls = overlay.querySelector('.path-preview-zoom');
|
|
591
|
+
body.classList.add('path-preview-image-viewport');
|
|
583
592
|
const image = document.createElement('img');
|
|
584
593
|
image.className = 'path-preview-image';
|
|
585
594
|
image.alt = entry.name;
|
|
586
|
-
image.
|
|
587
|
-
|
|
595
|
+
image.draggable = false;
|
|
596
|
+
// Both handlers check the sequence like the text branch: an image whose preview was already
|
|
597
|
+
// replaced can still finish loading, and `this._previewOverlay` and the zoom state are then
|
|
598
|
+
// the newer preview's. The controls show only once there is an image to zoom.
|
|
599
|
+
image.addEventListener('load', () => {
|
|
600
|
+
if (requestSequence !== this._previewRequestSequence) return;
|
|
601
|
+
body.querySelector('.path-preview-loading')?.remove();
|
|
602
|
+
zoomControls.hidden = false;
|
|
603
|
+
this._setPreviewImageZoom(1);
|
|
604
|
+
});
|
|
605
|
+
image.addEventListener('error', () => {
|
|
606
|
+
if (requestSequence !== this._previewRequestSequence) return;
|
|
607
|
+
zoomControls.hidden = true;
|
|
608
|
+
this._previewImageCleanup?.();
|
|
609
|
+
this.showPreviewError('Image preview failed to load');
|
|
610
|
+
});
|
|
588
611
|
image.src = previewUrl;
|
|
589
612
|
body.appendChild(image);
|
|
613
|
+
this._bindPreviewImageGestures(image, body, zoomControls);
|
|
590
614
|
} else if (entry.previewKind === 'text') {
|
|
591
615
|
fetch(previewUrl)
|
|
592
616
|
.then(async (response) => {
|
|
@@ -630,8 +654,142 @@ const PathPicker = {
|
|
|
630
654
|
body.replaceChildren(error);
|
|
631
655
|
},
|
|
632
656
|
|
|
657
|
+
_setPreviewImageZoom(scale, focalPoint) {
|
|
658
|
+
const state = this._previewImageZoom;
|
|
659
|
+
if (!state) return;
|
|
660
|
+
const nextScale = Math.max(1, Math.min(6, scale));
|
|
661
|
+
if (focalPoint) {
|
|
662
|
+
const rect = state.body.getBoundingClientRect();
|
|
663
|
+
const qx = focalPoint.x - (rect.left + rect.width / 2);
|
|
664
|
+
const qy = focalPoint.y - (rect.top + rect.height / 2);
|
|
665
|
+
const ratio = nextScale / state.scale;
|
|
666
|
+
state.x = qx + (state.x - qx) * ratio;
|
|
667
|
+
state.y = qy + (state.y - qy) * ratio;
|
|
668
|
+
}
|
|
669
|
+
state.scale = nextScale;
|
|
670
|
+
this._clampPreviewImagePan();
|
|
671
|
+
state.image.style.transform = `translate(${state.x}px, ${state.y}px) scale(${state.scale})`;
|
|
672
|
+
const fitButton = state.controls.querySelector('[data-zoom="fit"]');
|
|
673
|
+
if (fitButton) fitButton.textContent = `${Math.round(state.scale * 100)}%`;
|
|
674
|
+
state.image.classList.toggle('is-zoomed', state.scale > 1);
|
|
675
|
+
},
|
|
676
|
+
|
|
677
|
+
/** Size the image is drawn at before zoom: `object-fit: scale-down` in the viewport box, so never
|
|
678
|
+
* larger than its natural size. The box until the image has loaded (no natural size yet). */
|
|
679
|
+
_previewImageFitSize(state, rect) {
|
|
680
|
+
const naturalWidth = state.image.naturalWidth;
|
|
681
|
+
const naturalHeight = state.image.naturalHeight;
|
|
682
|
+
if (!naturalWidth || !naturalHeight) return { width: rect.width, height: rect.height };
|
|
683
|
+
const fit = Math.min(1, rect.width / naturalWidth, rect.height / naturalHeight);
|
|
684
|
+
return { width: naturalWidth * fit, height: naturalHeight * fit };
|
|
685
|
+
},
|
|
686
|
+
|
|
687
|
+
/** Keep the zoomed image covering the viewport: it may move until its edge reaches the viewport's
|
|
688
|
+
* edge, never further, and an axis on which it is still smaller than the viewport stays centred.
|
|
689
|
+
* Clamping to the image box instead let a small or letterboxed image be panned out of view. */
|
|
690
|
+
_clampPreviewImagePan() {
|
|
691
|
+
const state = this._previewImageZoom;
|
|
692
|
+
if (!state) return;
|
|
693
|
+
const rect = state.body.getBoundingClientRect();
|
|
694
|
+
const fitted = this._previewImageFitSize(state, rect);
|
|
695
|
+
const maxX = Math.max(0, (fitted.width * state.scale - rect.width) / 2);
|
|
696
|
+
const maxY = Math.max(0, (fitted.height * state.scale - rect.height) / 2);
|
|
697
|
+
state.x = Math.max(-maxX, Math.min(maxX, state.x));
|
|
698
|
+
state.y = Math.max(-maxY, Math.min(maxY, state.y));
|
|
699
|
+
},
|
|
700
|
+
|
|
701
|
+
/** Zoom factor for one wheel event, proportional to `deltaY` (d3-zoom's scale: about 15% per
|
|
702
|
+
* 100px mouse notch, ten times that for ctrl+wheel, which is how Chrome and Firefox deliver a
|
|
703
|
+
* trackpad pinch), so a trackpad's stream of small deltas zooms smoothly instead of 20% per
|
|
704
|
+
* event. Clamped per event so one large delta cannot jump to the maximum; no vertical delta
|
|
705
|
+
* (a sideways scroll) zooms nothing. */
|
|
706
|
+
_previewWheelZoomFactor(event) {
|
|
707
|
+
const deltaY = Number(event?.deltaY) || 0;
|
|
708
|
+
if (!deltaY) return 1;
|
|
709
|
+
const perUnit = event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002;
|
|
710
|
+
const exponent = -deltaY * perUnit * (event.ctrlKey ? 10 : 1);
|
|
711
|
+
return 2 ** Math.max(-0.5, Math.min(0.5, exponent));
|
|
712
|
+
},
|
|
713
|
+
|
|
714
|
+
_bindPreviewImageGestures(image, body, controls) {
|
|
715
|
+
this._previewImageZoom = { image, body, controls, scale: 1, x: 0, y: 0, pointers: new Map(), gesture: null };
|
|
716
|
+
const state = this._previewImageZoom;
|
|
717
|
+
const cleanups = [];
|
|
718
|
+
const listen = (target, name, handler, options) => {
|
|
719
|
+
target.addEventListener(name, handler, options);
|
|
720
|
+
cleanups.push(() => target.removeEventListener(name, handler, options));
|
|
721
|
+
};
|
|
722
|
+
const pointer = (event) => ({ x: event.clientX, y: event.clientY });
|
|
723
|
+
const midpoint = (a, b) => ({ x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 });
|
|
724
|
+
const distance = (a, b) => Math.hypot(a.x - b.x, a.y - b.y);
|
|
725
|
+
const startGesture = () => {
|
|
726
|
+
const points = Array.from(state.pointers.values());
|
|
727
|
+
if (points.length > 1) {
|
|
728
|
+
state.gesture = {
|
|
729
|
+
kind: 'pinch',
|
|
730
|
+
scale: state.scale,
|
|
731
|
+
distance: Math.max(1, distance(points[0], points[1])),
|
|
732
|
+
midpoint: midpoint(points[0], points[1]),
|
|
733
|
+
};
|
|
734
|
+
} else if (points.length === 1) {
|
|
735
|
+
state.gesture = { kind: 'pan', point: points[0], x: state.x, y: state.y };
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
listen(image, 'pointerdown', (event) => {
|
|
739
|
+
event.preventDefault();
|
|
740
|
+
image.setPointerCapture?.(event.pointerId);
|
|
741
|
+
state.pointers.set(event.pointerId, pointer(event));
|
|
742
|
+
startGesture();
|
|
743
|
+
});
|
|
744
|
+
listen(image, 'pointermove', (event) => {
|
|
745
|
+
if (!state.pointers.has(event.pointerId) || !state.gesture) return;
|
|
746
|
+
event.preventDefault();
|
|
747
|
+
state.pointers.set(event.pointerId, pointer(event));
|
|
748
|
+
if (state.pointers.size > 1) {
|
|
749
|
+
const points = Array.from(state.pointers.values());
|
|
750
|
+
this._setPreviewImageZoom(
|
|
751
|
+
state.gesture.scale * distance(points[0], points[1]) / state.gesture.distance,
|
|
752
|
+
state.gesture.midpoint
|
|
753
|
+
);
|
|
754
|
+
} else if (state.gesture.kind === 'pan' && state.scale > 1) {
|
|
755
|
+
const point = state.pointers.values().next().value;
|
|
756
|
+
state.x = state.gesture.x + point.x - state.gesture.point.x;
|
|
757
|
+
state.y = state.gesture.y + point.y - state.gesture.point.y;
|
|
758
|
+
this._setPreviewImageZoom(state.scale);
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
const endPointer = (event) => {
|
|
762
|
+
state.pointers.delete(event.pointerId);
|
|
763
|
+
startGesture();
|
|
764
|
+
};
|
|
765
|
+
listen(image, 'pointerup', endPointer);
|
|
766
|
+
listen(image, 'pointercancel', endPointer);
|
|
767
|
+
listen(image, 'lostpointercapture', endPointer);
|
|
768
|
+
listen(image, 'dblclick', (event) => {
|
|
769
|
+
event.preventDefault();
|
|
770
|
+
this._setPreviewImageZoom(state.scale > 1 ? 1 : 2, pointer(event));
|
|
771
|
+
});
|
|
772
|
+
listen(body, 'wheel', (event) => {
|
|
773
|
+
event.preventDefault();
|
|
774
|
+
const factor = this._previewWheelZoomFactor(event);
|
|
775
|
+
if (factor !== 1) this._setPreviewImageZoom(state.scale * factor, pointer(event));
|
|
776
|
+
}, { passive: false });
|
|
777
|
+
listen(controls, 'click', (event) => {
|
|
778
|
+
const button = event.target.closest('[data-zoom]');
|
|
779
|
+
if (!button) return;
|
|
780
|
+
if (button.dataset.zoom === 'fit') this._setPreviewImageZoom(1);
|
|
781
|
+
else this._setPreviewImageZoom(state.scale * (button.dataset.zoom === 'in' ? 1.5 : 1 / 1.5));
|
|
782
|
+
});
|
|
783
|
+
this._previewImageCleanup = () => {
|
|
784
|
+
cleanups.forEach((cleanup) => cleanup());
|
|
785
|
+
this._previewImageZoom = null;
|
|
786
|
+
this._previewImageCleanup = null;
|
|
787
|
+
};
|
|
788
|
+
},
|
|
789
|
+
|
|
633
790
|
closePreview(restoreFocus = true) {
|
|
634
791
|
this._previewRequestSequence += 1;
|
|
792
|
+
this._previewImageCleanup?.();
|
|
635
793
|
this._previewOverlay?.remove();
|
|
636
794
|
this._previewOverlay = null;
|
|
637
795
|
const previousFocus = this._previewPreviousFocus;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -385,13 +385,13 @@ Object.assign(CodemanApp.prototype, {
|
|
|
385
385
|
},
|
|
386
386
|
|
|
387
387
|
/**
|
|
388
|
-
* One delegated click listener for every row
|
|
389
|
-
*
|
|
390
|
-
* instead of stranding a phone layout on a tablet-width viewport.
|
|
388
|
+
* One delegated click listener for every row. The breakpoint listener lives
|
|
389
|
+
* in `_wireMobileOverviewBreakpoint()`, installed at startup.
|
|
391
390
|
*/
|
|
392
391
|
_wireMobileOverview(el) {
|
|
393
392
|
if (this._mobileOverviewWired) return;
|
|
394
393
|
this._mobileOverviewWired = true;
|
|
394
|
+
this._wireMobileOverviewBreakpoint();
|
|
395
395
|
|
|
396
396
|
el.addEventListener('click', (event) => {
|
|
397
397
|
const target = event.target && event.target.closest && event.target.closest('[data-mo-action]');
|
|
@@ -426,18 +426,34 @@ Object.assign(CodemanApp.prototype, {
|
|
|
426
426
|
this.showWebviewModal();
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
|
+
},
|
|
429
430
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
431
|
+
/**
|
|
432
|
+
* Swap the home surface when the width crosses the phone breakpoint (rotate,
|
|
433
|
+
* fold, unfold), so a phone layout is never stranded on a tablet-width
|
|
434
|
+
* viewport and the welcome screen never on a phone-width one.
|
|
435
|
+
*
|
|
436
|
+
* Installed ONCE at startup (`init()` in app.js), not on the first show: a
|
|
437
|
+
* page that loads wide never shows the phone overview, so a listener wired
|
|
438
|
+
* from there was missing on exactly the fold that needed it (#702). Idempotent,
|
|
439
|
+
* so the call from `_wireMobileOverview()` adds nothing after startup.
|
|
440
|
+
*/
|
|
441
|
+
_wireMobileOverviewBreakpoint() {
|
|
442
|
+
if (this._mobileOverviewBreakpointWired || !window.matchMedia) return;
|
|
443
|
+
this._mobileOverviewBreakpointWired = true;
|
|
444
|
+
const mq = window.matchMedia(MOBILE_OVERVIEW_PHONE_QUERY);
|
|
445
|
+
const onChange = () => {
|
|
446
|
+
// Only relevant while a home surface is up; entering a session re-decides
|
|
447
|
+
// through hideWelcome()/showWelcome() anyway, and before the first
|
|
448
|
+
// showWelcome() there is nothing on screen to swap.
|
|
449
|
+
if (this.activeSessionId) return;
|
|
450
|
+
const overlay = document.getElementById('welcomeOverlay');
|
|
451
|
+
const welcomeUp = !!overlay && overlay.classList.contains('visible');
|
|
452
|
+
if (!welcomeUp && !this.isMobileOverviewVisible()) return;
|
|
453
|
+
if (typeof this.showWelcome === 'function') this.showWelcome();
|
|
454
|
+
};
|
|
455
|
+
if (mq.addEventListener) mq.addEventListener('change', onChange);
|
|
456
|
+
else if (mq.addListener) mq.addListener(onChange);
|
|
441
457
|
},
|
|
442
458
|
|
|
443
459
|
_toggleMobileOverviewRunMenu() {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|