refactor(frontend): sleep/schedule/wake actions on actors#5092
Conversation
PR Review: refactor(frontend): sleep/schedule/wake actions on actorsOverviewThis PR refactors the actor action buttons: moves the Destroy button out of the "Danger Zone" section into the main header bar alongside Sleep and Reschedule, upgrades Sleep and Reschedule from icon-only tooltip buttons to labeled buttons with icons, and introduces an Correctness
Rising-edge suppression clear is correct. Using Issues
// auto-wake-suppression.ts
return useSyncExternalStore(
(onChange) => { // new arrow fn every render
listeners.add(onChange);
return () => listeners.delete(onChange);
},
() => suppressed.get(actorId),
);React compares function subscribe(onChange: () => void) {
listeners.add(onChange);
return () => listeners.delete(onChange);
}
export function useAutoWakeSuppression(actorId: ActorId) {
return useSyncExternalStore(subscribe, () => suppressed.get(actorId));
}
Suppression entry is never cleaned up after actor destruction. If a user sleeps or reschedules an actor and it is then destroyed (before transitioning to Minor Observations
SummarySolid refactor. The auto-wake suppression design is correct, the DangerZone guards are preserved inside |
cf0ba28 to
ebd825f
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: