Storage Capacity Gates for Asset Generation
Summary
Implement a non-blocking notification gate for Moderators before they trigger actions that produce stored assets (Start Recording, Export Whiteboard PDF, Meeting Notes PDF). The severity and wording of the notification depend on whether the storage is "near limit" (≥ 95%) or "full" (≥ 100%).
Wording:
-
canUpgrade === true: show two-button notification with "Upgrade" (opens account management in new tab) + "Storage" (opens account management / storage section in new tab) -
canUpgrade === false: show one-button notification with "Storage" only
Implementation details
- New
app/src/utils/storageWarning.ts:
interface StorageWarningOptions {
isFull: boolean;
isNearLimit: boolean;
canUpgrade: boolean;
accountManagementUrl?: string;
}
export const showStorageNearLimitWarning = ({ isNearLimit, canUpgrade, accountManagementUrl }: StorageWarningOptions) => {
if (!isFull && !isNearLimit) return;
const severity = isFull ? 'error' : 'warning';
const messageKey = isFull
? 'conference-storage-full-warning'
: 'conference-storage-near-limit-warning';
const handleOpenAccount = () => window.open(accountManagementUrl, '_blank');
if (canUpgrade) {
notifications.binaryAction(i18n.t(messageKey), {
primaryBtnText: i18n.t('global-upgrade'),
secondaryBtnText: i18n.t('dashboard-settings-storage'),
onPrimary: handleOpenAccount,
onSecondary: handleOpenAccount,
});
} else {
notifications.warning(i18n.t(messageKey), {
action: (
<Button onClick={handleOpenAccount}>
{i18n.t('dashboard-settings-storage')}
</Button>
),
});
}
};
- In
MoreMenu.tsxrecording start branch:
const { isFull, isNearLimit, canUpgrade } = useStorageStatus();
const isModerator = useAppSelector(selectIsModerator);
const accountManagementUrl = useAppSelector(selectAccountManagementUrl);
// ...
action: () => {
if (isModerator) {
showStorageCapacityWarning({ isFull, isNearLimit, canUpgrade, accountManagementUrl });
}
dispatch(sendStartStreamSignal.action({ targetIds: [recording.targetId] }));
onClose();
},
- Same pattern in
WhiteboardTab.tsx(beforedispatch(generateWhiteboardPdf.action())) andMeetingNotesTab.tsx(beforedispatch(uploadPdf.action()))
Translations
95% usage (Warning):
- EN: "Your storage is almost full. This asset might not be saved if the limit is reached."
- DE: "Dein Speicher ist fast voll. Diese Datei kann eventuell nicht gespeichert werden, falls das Limit erreicht wird."
100% usage (Error):
- EN: "Storage limit reached. You can still start this action, but it will likely fail to save."
- DE: "Speicherlimit erreicht. Du kannst die Aktion starten, aber sie wird wahrscheinlich nicht gespeichert werden können."
Acceptance criteria
- notification fires before Start Recording, Export Whiteboard PDF and Meeting Notes upload
- added notifications only appear for Role.Moderator
- severity 100%: If storage ≥ 100%, notification uses notification.error styling
- severity 95%: If storage is between 95% and 99%, notification uses warning styling
- the underlying action (recording/export) executes after the notification is triggered
- if canUpgrade is true: Show "Upgrade" and "Storage" buttons / if canUpgrade is false: Show only "Storage" button
- no notification appears if storage is below 95% or unlimited
Edited by Maximilian Fuß