From a684702afa3755f06114ae1523345c5c7ef252bb Mon Sep 17 00:00:00 2001 From: rmitnam <153247638+rmitnam@users.noreply.github.com> Date: Sat, 5 Sep 2026 22:14:11 +0700 Subject: [PATCH 1/2] feat: add FlexibleDMs --- src/plugins/flexibleDMs/components.tsx | 242 ++++++++++++++++++++++++ src/plugins/flexibleDMs/index.tsx | 191 +++++++++++++++++++ src/plugins/flexibleDMs/model.ts | 120 ++++++++++++ src/plugins/flexibleDMs/pinDms.ts | 26 +++ src/plugins/flexibleDMs/settings.tsx | 36 ++++ src/plugins/flexibleDMs/state.ts | 99 ++++++++++ src/plugins/flexibleDMs/style.css | 252 +++++++++++++++++++++++++ src/plugins/pinDms/data.ts | 4 +- src/plugins/pinDms/index.tsx | 6 +- src/utils/constants.ts | 4 + 10 files changed, 976 insertions(+), 4 deletions(-) create mode 100644 src/plugins/flexibleDMs/components.tsx create mode 100644 src/plugins/flexibleDMs/index.tsx create mode 100644 src/plugins/flexibleDMs/model.ts create mode 100644 src/plugins/flexibleDMs/pinDms.ts create mode 100644 src/plugins/flexibleDMs/settings.tsx create mode 100644 src/plugins/flexibleDMs/state.ts create mode 100644 src/plugins/flexibleDMs/style.css diff --git a/src/plugins/flexibleDMs/components.tsx b/src/plugins/flexibleDMs/components.tsx new file mode 100644 index 00000000000..c87383c5ae8 --- /dev/null +++ b/src/plugins/flexibleDMs/components.tsx @@ -0,0 +1,242 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2026 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import ErrorBoundary from "@components/ErrorBoundary"; +import { FolderIcon } from "@components/Icons"; +import { classes } from "@utils/misc"; +import { RenderModalProps } from "@vencord/discord-types"; +import { ChannelStore, ContextMenuApi, FluxDispatcher, IconUtils, Menu, Modal, openModal, React, ReadStateStore, SelectedChannelStore, TextInput, UserStore, useState, useStateFromStores } from "@webpack/common"; + +import { Folder, Placement, Row } from "./model"; +import { accountId, closeAll, dissolveFolder, drop, editFolder, PrivateChannelSortStore } from "./state"; + +const DRAG_TYPE = "application/x-vencord-dm-folder"; +let dragging: { id: string; userId: string | undefined; folder: boolean; } | undefined; + +export function clearDrag() { + dragging = undefined; +} + +const DEFAULT_COLOR = 0x5865f2; +const SWATCHES = [ + 1752220, 3066993, 3447003, 10181046, 15277667, 15844367, 15105570, 15158332, 9807270, 6323595, + 1146986, 2067276, 2123412, 7419530, 11342935, 12745742, 11027200, 10038562, 9936031, 5533306 +]; + +function FolderColorPicker({ color, onChange }: { color: number; onChange(color: number): void; }) { + const hex = `#${color.toString(16).padStart(6, "0")}`; + const check = ( + + ); + return ( +