feat(timeline): add pulse animation for in-flight drag mutations
Allocation bars that have active optimistic overrides (post-drag, awaiting server confirmation) now pulse subtly via animate-pulse. The pending set is derived from the existing optimisticAllocations map keys, requiring no additional state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* It is the denominator for chargeability calculations.
|
||||
*/
|
||||
|
||||
import { toIsoDate } from "@capakraken/shared";
|
||||
import type { SpainScheduleRule } from "@capakraken/shared";
|
||||
|
||||
// ─── Types ──────────────────────────────────────────────────────────────────
|
||||
@@ -47,11 +48,6 @@ export interface SAHResult {
|
||||
|
||||
// ─── Helpers ────────────────────────────────────────────────────────────────
|
||||
|
||||
function toISODate(d: Date | string): string {
|
||||
if (typeof d === "string") return d.slice(0, 10);
|
||||
return d.toISOString().slice(0, 10);
|
||||
}
|
||||
|
||||
function isWeekend(date: Date): boolean {
|
||||
const day = date.getUTCDay();
|
||||
return day === 0 || day === 6;
|
||||
@@ -93,8 +89,8 @@ export function getDailyHours(
|
||||
export function calculateSAH(input: SAHInput): SAHResult {
|
||||
const { dailyWorkingHours, scheduleRules, fte, periodStart, periodEnd, publicHolidays, absenceDays } = input;
|
||||
|
||||
const holidaySet = new Set(publicHolidays.map(toISODate));
|
||||
const absenceSet = new Set(absenceDays.map(toISODate));
|
||||
const holidaySet = new Set(publicHolidays.map(toIsoDate));
|
||||
const absenceSet = new Set(absenceDays.map(toIsoDate));
|
||||
|
||||
let calendarDays = 0;
|
||||
let weekendDays = 0;
|
||||
|
||||
Reference in New Issue
Block a user