Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions apps/webapp/app/components/billing/BillingAlertsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,18 @@ export function BillingAlertsSection({
);
const maxAlerts = isPercentageMode ? MAX_PERCENTAGE_ALERTS : MAX_ABSOLUTE_ALERTS;

/* oxlint-disable react/react-compiler -- Stable derived thresholds prevent the synchronization effect from resetting local edits. */
const savedThresholds = useMemo(
() => storedAlertsToThresholds(alerts, billingLimitMode, effectiveLimitCents, planLimitCents),
[alerts, billingLimitMode, effectiveLimitCents, planLimitCents]
);
/* oxlint-enable react/react-compiler */
const savedEmails = useMemo(() => alerts.emails, [alerts.emails]);
const hasLegacySpikes = useMemo(
() => hasLegacySpikeAlertLevels(alerts, billingLimitMode, effectiveLimitCents, planLimitCents),
[alerts, billingLimitMode, effectiveLimitCents, planLimitCents]
const hasLegacySpikes = hasLegacySpikeAlertLevels(
alerts,
billingLimitMode,
effectiveLimitCents,
planLimitCents
);

const nextThresholdIdRef = useRef(savedThresholds.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ export function DashboardAgentPanel({
}, []);

const dismissWatchCard = () => dispatchWatchCard({ type: "dismissed" });
const activeChatId = active?.chatId;

const submitWatch = useCallback(async () => {
const draft = watchCard.draft;
Expand All @@ -429,7 +430,7 @@ export function DashboardAgentPanel({
body.set("draft", JSON.stringify(draft));
body.set("clientRequestId", clientRequestId);
// A watch is chat-bound: with no chat open the server creates one.
if (active?.chatId) body.set("chatId", active.chatId);
if (activeChatId) body.set("chatId", activeChatId);

const res = await fetch(actionPath, { method: "POST", body });
const data = (await res.json()) as {
Expand All @@ -446,7 +447,7 @@ export function DashboardAgentPanel({
}

const messages = data.messages;
if (active?.chatId === data.chatId) {
if (activeChatId === data.chatId) {
setAppendedMessages((current) => ({
chatId: data.chatId!,
messages,
Expand Down Expand Up @@ -474,7 +475,7 @@ export function DashboardAgentPanel({
}, [
watchCard.draft,
watchCard.requestId,
active?.chatId,
activeChatId,
actionPath,
organization.id,
claimChatSlot,
Expand Down
2 changes: 2 additions & 0 deletions apps/webapp/app/hooks/useDashboardEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export function useDashboardEditor({
// Sync queue processor - ensures only one sync runs at a time
// -------------------------------------------------------------------------

/* oxlint-disable react/react-compiler -- The recursive callback drains a serialized sync queue. */
const processNextSync = useCallback(async () => {
// If already syncing or queue is empty, do nothing
if (isSyncingRef.current || syncQueueRef.current.length === 0) {
Expand Down Expand Up @@ -309,6 +310,7 @@ export function useDashboardEditor({
processNextSync();
}
}, [widgetActionUrl, layoutActionUrl, onSyncError]);
/* oxlint-enable react/react-compiler */

// -------------------------------------------------------------------------
// Queue helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1430,10 +1430,7 @@ function QueueEnvMetricChart({
[tile.id, tile.label, lineColor]
);

const { tickFormatter, tooltipLabelFormatter } = useMemo(
() => buildActivityTimeAxis(data),
[data]
);
const { tickFormatter, tooltipLabelFormatter } = buildActivityTimeAxis(data);
const hasData = data.length > 0 && data.some((p) => Number(p[tile.id] ?? 0) > 0);

// Peak readout lives in the card title (ChartCard has no dedicated value slot). A zero/empty
Expand Down