Feat: Time until group and flag (#1708)

* refactor: split event data and state data

* refactor: calculate the start time insted of until

* cleanup

* send next flag expected start from server

* refactor: render

* fix test

* use same icon

* refactor: group duration

* Optimize (#1711)

* refactor: consolidate block, flag and end loading and expected times

* work on test

* cal end value

* lint

* fix test

* remove todo
This commit is contained in:
Alex Christoffer Rasmussen
2025-08-07 07:55:28 +12:00
committed by GitHub
parent e37d2ce50f
commit 35347e8d63
19 changed files with 567 additions and 539 deletions
@@ -715,14 +715,14 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
getForceUpdate(RuntimeService.previousRuntimeUpdate, state.clock)) &&
!deepEqual(RuntimeService.previousState?.runtime, state.runtime);
/**
* the currentBlock object has the potential to tick on expected end
* TODO: the value shows up one tick to late
*/
// TODO: the value shows up one tick to late
const shouldBlockUpdate =
!deepEqual(RuntimeService?.previousState.blockNow, state.blockNow) ||
RuntimeService?.previousState.blockNext !== state.blockNext;
// TODO: the value shows up one tick to late
const shouldNextFlagUpdate = !deepEqual(RuntimeService?.previousState?.nextFlag, state.nextFlag);
/**
* Many other values are calculated based on the clock
* so if any of them are updated we also need to send the clock
@@ -755,9 +755,9 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
RuntimeService.previousState.blockNext = state.blockNext;
}
if (RuntimeService.previousState?.nextFlag !== state.nextFlag) {
if (shouldNextFlagUpdate) {
batch.add('nextFlag', state.nextFlag);
RuntimeService.previousState.nextFlag = state.nextFlag;
RuntimeService.previousState.nextFlag = structuredClone(state.nextFlag);
}
if (hasImmediateChanges) {