@1agh/maude 0.55.0 → 0.56.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.
Files changed (47) hide show
  1. package/apps/studio/bin/_smart-frames.mjs +187 -20
  2. package/apps/studio/bin/_smart-frames.test.mjs +59 -4
  3. package/apps/studio/bin/_transcribe.mjs +40 -3
  4. package/apps/studio/bin/smoke.sh +7 -1
  5. package/apps/studio/client/app.jsx +31 -3
  6. package/apps/studio/client/panels/CloudBar.jsx +44 -5
  7. package/apps/studio/client/panels/GitPanel.jsx +38 -25
  8. package/apps/studio/client/panels/SettingsPanel.jsx +239 -27
  9. package/apps/studio/client/styles/4-components.css +72 -0
  10. package/apps/studio/cloud/endpoints.ts +56 -3
  11. package/apps/studio/collab/persistence.ts +29 -2
  12. package/apps/studio/config.schema.json +3 -3
  13. package/apps/studio/context.ts +41 -0
  14. package/apps/studio/dist/client.bundle.js +1464 -1464
  15. package/apps/studio/dist/comment-mount.js +2 -2
  16. package/apps/studio/dist/styles.css +1 -1
  17. package/apps/studio/generation/gemma-models.ts +312 -14
  18. package/apps/studio/generation/prefs.ts +7 -2
  19. package/apps/studio/generation/runtime-probe.ts +50 -0
  20. package/apps/studio/generation/whisper-models.ts +124 -0
  21. package/apps/studio/hmr-broadcast.ts +67 -0
  22. package/apps/studio/http.ts +196 -109
  23. package/apps/studio/input-router.tsx +55 -2
  24. package/apps/studio/server.ts +11 -9
  25. package/apps/studio/sync/autocommit.ts +61 -2
  26. package/apps/studio/sync/cell-pairing.ts +174 -0
  27. package/apps/studio/sync/codec.ts +11 -5
  28. package/apps/studio/sync/index.ts +239 -26
  29. package/apps/studio/sync/limits.ts +49 -0
  30. package/apps/studio/sync/loopback.ts +21 -0
  31. package/apps/studio/sync/projection.ts +47 -12
  32. package/apps/studio/sync/supervisor.ts +178 -0
  33. package/apps/studio/test/cloud-endpoints.test.ts +95 -0
  34. package/apps/studio/test/csrf-write-guard.test.ts +19 -2
  35. package/apps/studio/test/gemma-models.test.ts +245 -0
  36. package/apps/studio/test/hmr-broadcast.test.ts +57 -1
  37. package/apps/studio/test/input-router.test.ts +95 -0
  38. package/apps/studio/test/shared-doc-cell-pairing.test.ts +639 -0
  39. package/apps/studio/test/sync-autocommit.test.ts +47 -0
  40. package/apps/studio/test/sync-supervisor.test.ts +212 -0
  41. package/apps/studio/test/trusted-request-host.test.ts +66 -0
  42. package/apps/studio/test/whisper-setup.test.ts +97 -0
  43. package/apps/studio/whats-new.json +27 -0
  44. package/apps/studio/ws.ts +9 -1
  45. package/cli/commands/kg.mjs +9 -2
  46. package/package.json +8 -8
  47. package/plugins/design/dependencies.json +21 -3
@@ -7,8 +7,10 @@ import {
7
7
  classify,
8
8
  crossedDragThreshold,
9
9
  DRAG_THRESHOLD_PX,
10
+ isArtboardDragChrome,
10
11
  isEditableTarget,
11
12
  type Tool,
13
+ yieldsToArtboardDrag,
12
14
  } from '../input-router.tsx';
13
15
 
14
16
  const base = (over: Partial<ClassifyInput>): ClassifyInput => ({
@@ -457,6 +459,99 @@ describe('input-router / isEditableTarget', () => {
457
459
  });
458
460
  });
459
461
 
462
+ // issue-71 — a bare (no-modifier) pointerdown/mousedown on an artboard's own
463
+ // drag chrome (the label strip + border, OUTSIDE `.dc-artboard-body`) must
464
+ // still be identified so useInputRouter can skip stopImmediatePropagation and
465
+ // let use-artboard-drag.tsx's own bubble-phase onPointerDown arm its
466
+ // pending→dragging state machine — otherwise no artboard could ever be
467
+ // repositioned by dragging its header (the router's capture-phase claim
468
+ // killed the event before it reached that listener).
469
+ describe('input-router / isArtboardDragChrome', () => {
470
+ // `closest(sel)` here mimics Element.closest: return a truthy stub for any
471
+ // selector this fake node "matches" (is, or is a descendant of), null else.
472
+ const fakeTarget = (memberOf: string[]): EventTarget =>
473
+ ({
474
+ closest: (sel: string) => (memberOf.includes(sel) ? {} : null),
475
+ }) as unknown as EventTarget;
476
+
477
+ test('null target → false', () => {
478
+ expect(isArtboardDragChrome(null)).toBe(false);
479
+ });
480
+
481
+ test('target with no closest() (non-Element) → false', () => {
482
+ expect(isArtboardDragChrome({} as EventTarget)).toBe(false);
483
+ });
484
+
485
+ test('outside any artboard → false', () => {
486
+ expect(isArtboardDragChrome(fakeTarget([]))).toBe(false);
487
+ });
488
+
489
+ test('the label strip / border chrome (inside an artboard, not its body) → true', () => {
490
+ expect(isArtboardDragChrome(fakeTarget(['[data-dc-screen]']))).toBe(true);
491
+ });
492
+
493
+ test('inside .dc-artboard-body (the canvas content, not chrome) → false', () => {
494
+ expect(isArtboardDragChrome(fakeTarget(['[data-dc-screen]', '.dc-artboard-body']))).toBe(false);
495
+ });
496
+ });
497
+
498
+ // issue-71 — the actual regression: before this fix, useInputRouter's
499
+ // pointerdown/mousedown handlers called `stopImmediatePropagation()` on EVERY
500
+ // claimed action, including a bare click on an artboard's own drag chrome —
501
+ // which killed the event before use-artboard-drag.tsx's bubble-phase
502
+ // onPointerDown (bound to that same artboard) ever saw it, so dragging an
503
+ // artboard by its header did nothing in either the Move or the (former)
504
+ // always-select tool state. `yieldsToArtboardDrag` is the exact decision the
505
+ // handlers now gate `stopImmediatePropagation` on.
506
+ describe('input-router / yieldsToArtboardDrag', () => {
507
+ const chrome = (): EventTarget =>
508
+ ({
509
+ closest: (sel: string) => (sel === '[data-dc-screen]' ? {} : null),
510
+ }) as unknown as EventTarget;
511
+ const body = (): EventTarget => ({ closest: () => ({}) }) as unknown as EventTarget; // matches every selector, incl. .dc-artboard-body
512
+
513
+ test('bare click on artboard chrome (the reported bug) → true (let the drag hook see it)', () => {
514
+ const action = classify({ type: 'pointerdown', activeTool: 'move', button: 0 });
515
+ expect(yieldsToArtboardDrag(action, chrome(), { metaKey: false, ctrlKey: false })).toBe(true);
516
+ });
517
+
518
+ test('shift+click on artboard chrome (multi-select-and-drag) → true', () => {
519
+ const action = classify({
520
+ type: 'pointerdown',
521
+ activeTool: 'move',
522
+ button: 0,
523
+ shiftKey: true,
524
+ });
525
+ expect(yieldsToArtboardDrag(action, chrome(), { metaKey: false, ctrlKey: false })).toBe(true);
526
+ });
527
+
528
+ test('cmd+click on artboard chrome (deep-select, not a drag) → false', () => {
529
+ const action = classify({
530
+ type: 'pointerdown',
531
+ activeTool: 'move',
532
+ button: 0,
533
+ metaKey: true,
534
+ });
535
+ expect(yieldsToArtboardDrag(action, chrome(), { metaKey: true, ctrlKey: false })).toBe(false);
536
+ });
537
+
538
+ test('bare click on .dc-artboard-body content (not chrome) → false', () => {
539
+ const action = classify({ type: 'pointerdown', activeTool: 'move', button: 0 });
540
+ expect(yieldsToArtboardDrag(action, body(), { metaKey: false, ctrlKey: false })).toBe(false);
541
+ });
542
+
543
+ test('bare click outside any artboard → false (nothing to yield to)', () => {
544
+ const action = classify({ type: 'pointerdown', activeTool: 'move', button: 0 });
545
+ const outside = { closest: () => null } as unknown as EventTarget;
546
+ expect(yieldsToArtboardDrag(action, outside, { metaKey: false, ctrlKey: false })).toBe(false);
547
+ });
548
+
549
+ test('right-click (context-menu) on chrome → false — not a select at all', () => {
550
+ const action = classify({ type: 'pointerdown', activeTool: 'move', button: 2 });
551
+ expect(yieldsToArtboardDrag(action, chrome(), { metaKey: false, ctrlKey: false })).toBe(false);
552
+ });
553
+ });
554
+
460
555
  // T25 — Drag-vs-click threshold. Centralized here so every drag-class gesture
461
556
  // (artboard drag, artboard marquee, element marquee, annotation pen/rect/etc.)
462
557
  // reads the same value. Microsoft Win32 SM_CXDRAG default + d3-drag convention.