transitions-refine 0.3.1 → 0.3.2

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 (2) hide show
  1. package/demo.html +11 -4
  2. package/package.json +1 -1
package/demo.html CHANGED
@@ -2466,8 +2466,10 @@
2466
2466
  setGroupScanState("scanning");
2467
2467
  // wait for the flat DOM scan to settle (count stable twice) so the agent
2468
2468
  // sees every transition, not a partial set discovered progressively.
2469
- let prev=-1,stable=0;
2470
- while(scanTokenRef.current===token){
2469
+ // Capped (~12s) so a page with no resolvable flat entries can never hang
2470
+ // the panel on "Grouping…" — it falls through to the empty-flat check below.
2471
+ let prev=-1,stable=0,iters=0;
2472
+ while(scanTokenRef.current===token&&iters++<40){
2471
2473
  const n=registry.getAll().filter(e=>e.kind!=="phase").length;
2472
2474
  if(n>0&&n===prev){if(++stable>=2)break;}else stable=0;
2473
2475
  prev=n;
@@ -2503,11 +2505,16 @@
2503
2505
  setGroupScanState("error");
2504
2506
  }catch(e){ setGroupScanState("error"); /* relay down → stay flat, retry next open */ }
2505
2507
  },[registry,GROUP_STORE_KEY,flatSig,readGroupCache]);
2506
- // manual "Rescan transitions" — drop the cache and force a fresh agent scan
2508
+ // manual "Rescan transitions" — drop the cache AND clear the in-memory
2509
+ // groups first. Once groups claim every DOM transition the snapshot has no
2510
+ // "flat" entries left, so the settle loop above would otherwise spin forever
2511
+ // waiting for a flat count that never arrives. Clearing groups re-surfaces
2512
+ // the flat entries the agent needs to re-group.
2507
2513
  const rescanTransitions=useCallback(()=>{
2508
2514
  try{localStorage.removeItem(GROUP_STORE_KEY);}catch{}
2515
+ registry.clearGroups();
2509
2516
  runGroupScan();
2510
- },[runGroupScan,GROUP_STORE_KEY]);
2517
+ },[runGroupScan,GROUP_STORE_KEY,registry]);
2511
2518
  // On mount, run the group resolver once. It waits for the flat scan to
2512
2519
  // settle, then either re-applies cached groups (when the content signature
2513
2520
  // matches — a pure cache read, no agent) or kicks off a fresh agent scan
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transitions-refine",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Live, agent-driven Refine panel for CSS/Motion transitions — injects a timeline + Refine UI and runs transitions.dev suggestions via your coding agent.",
5
5
  "type": "module",
6
6
  "bin": {