Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

chore(app): remove message scheduling and a dead descriptor (#2513)

Hampus1a5925f9cbb8
diff --git a/fluxer_app/src/features/app/components/dialogs/components/FeatureComparisonTable.tsx b/fluxer_app/src/features/app/components/dialogs/components/FeatureComparisonTable.tsx
index 13e67eca7..140ddb74b 100644
--- a/fluxer_app/src/features/app/components/dialogs/components/FeatureComparisonTable.tsx
+++ b/fluxer_app/src/features/app/components/dialogs/components/FeatureComparisonTable.tsx
@@ -28,10 +28,6 @@ const PER_COMMUNITY_PROFILES_DESCRIPTOR = msg({
message: 'Per-community profiles',
comment: 'Feature comparison table perk label. Shown as the row name comparing restricted vs stock limits.',
});
-const MESSAGE_SCHEDULING_DESCRIPTOR = msg({
- message: 'Message scheduling',
- comment: 'Feature comparison table perk label. Shown as the row name comparing restricted vs stock limits.',
-});
const PROFILE_BADGE_DESCRIPTOR = msg({
message: 'Profile badge',
comment: 'Feature comparison table perk label. Shown as the row name comparing restricted vs stock limits.',
@@ -96,7 +92,6 @@ export const FeatureComparisonTable = observer(() => {
() => ({
custom_4_digit_username_tag: i18n._(CUSTOM_USERNAME_TAG_DESCRIPTOR),
per_community_profiles: i18n._(PER_COMMUNITY_PROFILES_DESCRIPTOR),
- message_scheduling: i18n._(MESSAGE_SCHEDULING_DESCRIPTOR),
profile_badge: i18n._(PROFILE_BADGE_DESCRIPTOR),
custom_video_backgrounds: i18n._(CUSTOM_VIDEO_BACKGROUNDS_DESCRIPTOR),
entrance_sounds: i18n._(ENTRANCE_SOUNDS_DESCRIPTOR),
diff --git a/fluxer_app/src/features/app/constants/Endpoints.ts b/fluxer_app/src/features/app/constants/Endpoints.ts
index 8596e91a9..746d8a3b9 100644
--- a/fluxer_app/src/features/app/constants/Endpoints.ts
+++ b/fluxer_app/src/features/app/constants/Endpoints.ts
@@ -59,7 +59,6 @@ export const Endpoints = {
CHANNEL_RECIPIENT: (channelId: string, userId: string) => `/channels/${channelId}/recipients/${userId}`,
CHANNEL_MESSAGES: (channelId: string) => `/channels/${channelId}/messages`,
CHANNEL_MESSAGES_BULK: '/channels/messages/bulk',
- CHANNEL_MESSAGE_SCHEDULE: (channelId: string) => `/channels/${channelId}/messages/schedule`,
CHANNEL_MESSAGE: (channelId: string, messageId: string) => `/channels/${channelId}/messages/${messageId}`,
CHANNEL_MESSAGE_ATTACHMENT: (channelId: string, messageId: string, attachmentId: string) =>
`/channels/${channelId}/messages/${messageId}/attachments/${attachmentId}`,
@@ -210,8 +209,6 @@ export const Endpoints = {
USER_ENTRANCE_SOUND: (soundId: string) => `/users/@me/entrance-sounds/${soundId}`,
USER_ENTRANCE_SOUND_SELECTIONS: '/users/@me/entrance-sound-selections',
VOICE_CHANNEL_ENTRANCE_SOUND: (channelId: string) => `/voice/channels/${channelId}/entrance-sound`,
- USER_SCHEDULED_MESSAGES: '/users/@me/scheduled-messages',
- USER_SCHEDULED_MESSAGE: (messageId: string) => `/users/@me/scheduled-messages/${messageId}`,
USER_FAVORITE_MEMES: (query = ME) => `/users/${query}/memes`,
USER_FAVORITE_MEME: (query = ME, memeId: string) => `/users/${query}/memes/${memeId}`,
USER_FAVORITE_GIFS_RESOLVE: (query = ME) => `/users/${query}/favorite-gifs/resolve`,
diff --git a/fluxer_app/src/features/channel/components/channel_textarea/shared.ts b/fluxer_app/src/features/channel/components/channel_textarea/shared.ts
index 32e033443..e1dd1f0c4 100644
--- a/fluxer_app/src/features/channel/components/channel_textarea/shared.ts
+++ b/fluxer_app/src/features/channel/components/channel_textarea/shared.ts
@@ -21,16 +21,3 @@ export const OPEN_MENU_DESCRIPTOR = msg({
message: 'Open menu',
comment: 'Accessible label for the plus button that opens the textarea attachment and customization menu.',
});
-export const RESCHEDULE_MESSAGE_DESCRIPTOR = msg({
- message: 'Reschedule message',
- comment: 'Title of the confirmation alert shown when editing a scheduled message to change the scheduled time.',
-});
-export const UPDATE_DESCRIPTOR = msg({
- message: 'Update',
- comment: 'Confirm button label on the reschedule scheduled-message alert.',
-});
-export const THIS_WILL_MODIFY_THE_EXISTING_SCHEDULED_MESSAGE_RATHER_DESCRIPTOR = msg({
- message: 'This will modify the existing scheduled message rather than sending immediately.',
- comment:
- 'Body of the reschedule scheduled-message alert clarifying that the update modifies the scheduled message instead of sending it now.',
-});
diff --git a/fluxer_app/src/features/i18n/utils/CommonMessageDescriptors.ts b/fluxer_app/src/features/i18n/utils/CommonMessageDescriptors.ts
index f5d1a98cf..b593578f5 100644
--- a/fluxer_app/src/features/i18n/utils/CommonMessageDescriptors.ts
+++ b/fluxer_app/src/features/i18n/utils/CommonMessageDescriptors.ts
@@ -648,10 +648,6 @@ export const NEVER_DESCRIPTOR = msg({
message: 'Never',
comment: 'Generic short option label for "never" in time / frequency dropdowns.',
});
-export const NO_DESCRIPTION_PROVIDED_DESCRIPTOR = msg({
- message: 'No description provided.',
- comment: 'Generic short empty-state body shown when an entity has no description set.',
-});
export const PINNED_DM_DESCRIPTOR = msg({
message: 'Pinned DM',
comment: 'Generic short toast / status label confirming a DM was pinned.',
diff --git a/fluxer_app/src/features/messaging/components/modals/ScheduleMessageModal.tsx b/fluxer_app/src/features/messaging/components/modals/ScheduleMessageModal.tsx
deleted file mode 100644
index 672ea7af5..000000000
--- a/fluxer_app/src/features/messaging/components/modals/ScheduleMessageModal.tsx
+++ /dev/null
@@ -1,147 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import * as Modal from '@app/features/app/components/dialogs/Modal';
-import {CANCEL_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
-import {Button} from '@app/features/ui/button/Button';
-import {Combobox, type ComboboxOption} from '@app/features/ui/components/form/FormCombobox';
-import {Input} from '@app/features/ui/components/form/FormInput';
-import {MS_PER_DAY} from '@fluxer/date_utils/src/DateConstants';
-import {getSystemTimeZone} from '@fluxer/date_utils/src/DateIntrospection';
-import {msg} from '@lingui/core/macro';
-import {useLingui} from '@lingui/react/macro';
-import type React from 'react';
-import {useCallback, useEffect, useMemo, useState} from 'react';
-
-const SCHEDULE_MESSAGE_DESCRIPTOR = msg({
- message: 'Schedule message',
- comment: 'Title of the schedule-message modal.',
-});
-const PICK_A_TIME_WHEN_THIS_MESSAGE_SHOULD_BE_DESCRIPTOR = msg({
- message: 'Pick a time when this message should be posted.',
- comment: 'Helper text in the schedule-message modal explaining the action.',
-});
-const DATE_TIME_DESCRIPTOR = msg({
- message: 'Date & time',
- comment: 'Field label for the date and time picker in the schedule-message modal. The ampersand is intentional.',
-});
-const TIMEZONE_DESCRIPTOR = msg({
- message: 'Timezone',
- comment: 'Field label for the timezone picker in the schedule-message modal.',
-});
-const SCHEDULED_MESSAGES_CAN_BE_AT_MOST_30_DAYS_DESCRIPTOR = msg({
- message: 'Scheduled messages can be at most 30 days in the future.',
- comment:
- 'Inline validation message in the schedule-message modal when the picked time is more than 30 days away. Keep tone plain.',
-});
-const SCHEDULE_DESCRIPTOR = msg({
- message: 'Schedule',
- comment: 'Confirm button label in the schedule-message modal that saves the scheduled send.',
-});
-
-interface ScheduleMessageModalProps {
- onClose: () => void;
- onSubmit: (scheduledLocalAt: string, timezone: string) => Promise<void>;
- initialScheduledLocalAt?: string;
- initialTimezone?: string;
- title?: string;
- submitLabel?: string;
- helpText?: React.ReactNode;
-}
-
-const formatInputValue = (value: Date): string => value.toISOString().slice(0, 16);
-export const ScheduleMessageModal = ({
- onClose,
- onSubmit,
- initialScheduledLocalAt,
- initialTimezone,
- title,
- submitLabel,
- helpText,
-}: ScheduleMessageModalProps) => {
- const {i18n} = useLingui();
- const minDateTime = useMemo(() => formatInputValue(new Date(Date.now() + 60_000)), []);
- const maxDateTime = useMemo(() => formatInputValue(new Date(Date.now() + 30 * MS_PER_DAY)), []);
- const defaultTimezone = useMemo(() => getSystemTimeZone(), []);
- const timezoneOptions = useMemo((): Array<ComboboxOption<string>> => {
- const intl = Intl as typeof Intl & {supportedValuesOf?: (type: string) => Array<string>};
- const zones = typeof intl.supportedValuesOf === 'function' ? intl.supportedValuesOf('timeZone') : [defaultTimezone];
- return zones.map((zone) => ({value: zone, label: zone}));
- }, [defaultTimezone]);
- const initialScheduledAt = useMemo(
- () => initialScheduledLocalAt ?? formatInputValue(new Date(Date.now() + 5 * 60 * 1000)),
- [initialScheduledLocalAt],
- );
- const [scheduledLocalAt, setScheduledLocalAt] = useState(initialScheduledAt);
- const [timezone, setTimezone] = useState(initialTimezone ?? defaultTimezone);
- useEffect(() => {
- setScheduledLocalAt(initialScheduledLocalAt ?? formatInputValue(new Date(Date.now() + 5 * 60 * 1000)));
- }, [initialScheduledLocalAt]);
- useEffect(() => {
- if (initialTimezone) {
- setTimezone(initialTimezone);
- }
- }, [initialTimezone]);
- const [submitting, setSubmitting] = useState(false);
- const handleConfirm = useCallback(async () => {
- if (!scheduledLocalAt) {
- return;
- }
- setSubmitting(true);
- try {
- await onSubmit(scheduledLocalAt, timezone);
- onClose();
- } finally {
- setSubmitting(false);
- }
- }, [scheduledLocalAt, timezone, onSubmit, onClose]);
- return (
- <Modal.Root size="small" centered onClose={onClose} data-flx="messaging.schedule-message-modal.modal-root">
- <Modal.Header
- title={title ?? i18n._(SCHEDULE_MESSAGE_DESCRIPTOR)}
- data-flx="messaging.schedule-message-modal.modal-header"
- />
- <Modal.Content data-flx="messaging.schedule-message-modal.modal-content">
- <Modal.ContentLayout data-flx="messaging.schedule-message-modal.modal-content-layout">
- <Modal.Description data-flx="messaging.schedule-message-modal.modal-description">
- {helpText ?? i18n._(PICK_A_TIME_WHEN_THIS_MESSAGE_SHOULD_BE_DESCRIPTOR)}
- </Modal.Description>
- <Modal.InputGroup data-flx="messaging.schedule-message-modal.modal-input-group">
- <Input
- id="schedule-message-time"
- type="datetime-local"
- label={i18n._(DATE_TIME_DESCRIPTOR)}
- min={minDateTime}
- max={maxDateTime}
- value={scheduledLocalAt}
- onChange={(event) => setScheduledLocalAt(event.target.value)}
- data-flx="messaging.schedule-message-modal.schedule-message-time.set-scheduled-local-at.datetime-local"
- />
- <Combobox
- id="schedule-message-timezone"
- label={i18n._(TIMEZONE_DESCRIPTOR)}
- description={i18n._(SCHEDULED_MESSAGES_CAN_BE_AT_MOST_30_DAYS_DESCRIPTOR)}
- value={timezone}
- options={timezoneOptions}
- onChange={setTimezone}
- data-flx="messaging.schedule-message-modal.schedule-message-timezone.set-timezone"
- />
- </Modal.InputGroup>
- </Modal.ContentLayout>
- </Modal.Content>
- <Modal.Footer data-flx="messaging.schedule-message-modal.modal-footer">
- <Button variant="secondary" onClick={onClose} data-flx="messaging.schedule-message-modal.button.close">
- {i18n._(CANCEL_DESCRIPTOR)}
- </Button>
- <Button
- variant="primary"
- onClick={handleConfirm}
- submitting={submitting}
- disabled={!scheduledLocalAt}
- data-flx="messaging.schedule-message-modal.button.confirm"
- >
- {submitLabel ?? i18n._(SCHEDULE_DESCRIPTOR)}
- </Button>
- </Modal.Footer>
- </Modal.Root>
- );
-};
diff --git a/fluxer_app/src/features/messaging/components/popouts/InboxPopout.tsx b/fluxer_app/src/features/messaging/components/popouts/InboxPopout.tsx
index 8f5115a19..346a5d193 100644
--- a/fluxer_app/src/features/messaging/components/popouts/InboxPopout.tsx
+++ b/fluxer_app/src/features/messaging/components/popouts/InboxPopout.tsx
@@ -118,7 +118,7 @@ export const InboxPopout = observer(({initialTab}: {initialTab?: InboxTab} = {})
const readStateVersion = ReadStates.version;
const settingsVersion = UserGuildSettings.version;
const unreadChannels = useMemo(() => getUnreadChannels(), [readStateVersion, settingsVersion]);
- const baseTabs: Array<TabConfig> = [
+ const tabs: Array<TabConfig> = [
{
key: 'unreadChannels',
label: i18n._(UNREAD_DESCRIPTOR),
@@ -135,7 +135,6 @@ export const InboxPopout = observer(({initialTab}: {initialTab?: InboxTab} = {})
icon: <AtIcon weight="bold" className={styles.iconSmall} data-flx="messaging.inbox-popout.icon-small--3" />,
},
];
- const tabs = baseTabs;
const normalizedActiveTab = tabs.some((tab) => tab.key === activeTab) ? activeTab : tabs[0].key;
const setActiveTab = useCallback((tab: InboxTab) => {
InboxCommands.setTab(tab);
diff --git a/packages/constants/src/LimitTierPerks.ts b/packages/constants/src/LimitTierPerks.ts
index 74bb52c01..dcc2e0f79 100644
--- a/packages/constants/src/LimitTierPerks.ts
+++ b/packages/constants/src/LimitTierPerks.ts
@@ -63,14 +63,6 @@ export const LIMIT_TIER_PERKS: ReadonlyArray<LimitTierPerk> = [
restrictedValue: false,
stockValue: true,
},
- {
- id: 'message_scheduling',
- type: 'boolean',
- status: 'coming_soon',
- i18nKey: 'message_scheduling',
- restrictedValue: false,
- stockValue: true,
- },
{
id: 'profile_badge',
type: 'boolean',
diff --git a/packages/date_utils/src/DateIntrospection.ts b/packages/date_utils/src/DateIntrospection.ts
index 7586a36ff..f08eaf900 100644
--- a/packages/date_utils/src/DateIntrospection.ts
+++ b/packages/date_utils/src/DateIntrospection.ts
@@ -3,10 +3,6 @@
import {getDateFormatter} from '@fluxer/date_utils/src/DateFormatterCache';
import type {DateFieldType} from '@fluxer/date_utils/src/DateTypes';
-export function getSystemTimeZone(): string {
- return Intl.DateTimeFormat().resolvedOptions().timeZone;
-}
-
export function getDateFieldOrder(locale: string): Array<DateFieldType> {
const formatter = getDateFormatter(locale, {
year: 'numeric',
diff --git a/tools/dev/cassandra_target_schema.json b/tools/dev/cassandra_target_schema.json
index 467bb6d5e..5fafaf06a 100644
--- a/tools/dev/cassandra_target_schema.json
+++ b/tools/dev/cassandra_target_schema.json
@@ -7784,57 +7784,6 @@
"primary_key": "((user_id), message_id)",
"options": "CLUSTERING ORDER BY (message_id DESC)"
},
- {
- "name": "scheduled_messages",
- "columns": [
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "scheduled_message_id",
- "type": "bigint"
- },
- {
- "name": "channel_id",
- "type": "bigint"
- },
- {
- "name": "payload",
- "type": "text"
- },
- {
- "name": "scheduled_at",
- "type": "timestamp"
- },
- {
- "name": "scheduled_local_at",
- "type": "text"
- },
- {
- "name": "timezone",
- "type": "text"
- },
- {
- "name": "status",
- "type": "text"
- },
- {
- "name": "status_reason",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "invalidated_at",
- "type": "timestamp"
- }
- ],
- "primary_key": "((user_id), scheduled_message_id)",
- "options": "CLUSTERING ORDER BY (scheduled_message_id DESC)"
- },
{
"name": "suspicious_email_domains",
"columns": [