Key Inspector: add ~30 checks for the 6 regressed plugins; ServerDrawer: server-name labels + hide-DM toggle

This commit is contained in:
Ally Founder 2026-08-02 14:10:27 -04:00
parent f9fd892db1
commit 299005f062
4 changed files with 91 additions and 9 deletions

View file

@ -1,4 +1,4 @@
import { find, findByName, findByProps, findByStoreName, findByTypeNameAll } from "@vendetta/metro";
import { find, findByName, findByProps, findByPropsAll, findByStoreName, findByTypeNameAll } from "@vendetta/metro";
import { semanticColors, rawColors } from "@vendetta/ui";
export interface CheckResult {
@ -38,11 +38,13 @@ const CHECKS: Check[] = [
{ label: 'find(resolveSemanticColor via meta)', run: () => find((m: any) => m?.meta?.resolveSemanticColor) },
// PronounDB
{ label: 'find(UserProfileContent)', run: () => find((m: any) => m?.type?.name === "UserProfileContent") },
{ label: 'find(UserProfile)', run: () => find((m: any) => m?.type?.name === "UserProfile") },
{ label: 'findByName("UserProfileSection", false)', run: () => findByName("UserProfileSection", false) },
// Message Snippets / Reminders / Urban Dictionary
{ label: 'findByProps("sendMessage", "sendBotMessage")', run: () => findByProps("sendMessage", "sendBotMessage") },
{ label: 'findByProps("sendBotMessage") (single prop, matches Revenge core)', run: () => findByProps("sendBotMessage") },
// ViewRaw
{ label: 'findByProps("openLazy", "hideActionSheet")', run: () => findByProps("openLazy", "hideActionSheet") },
@ -53,6 +55,7 @@ const CHECKS: Check[] = [
// CopyRoleColor
{ label: 'findByName("ThemedRolePill", false)', run: () => findByName("ThemedRolePill", false) },
{ label: 'findByName("RolePill", false)', run: () => findByName("RolePill", false) },
// FakeProfileThemesAndEffects (in progress)
{ label: 'findByProps("saveProfileChanges")', run: () => findByProps("saveProfileChanges") },
@ -60,6 +63,31 @@ const CHECKS: Check[] = [
{ label: 'findByProps("useThemeContext")', run: () => findByProps("useThemeContext") },
{ label: 'findByProps("getProfileTheme")', run: () => findByProps("getProfileTheme") },
{ label: 'findByProps("ThemeContextProvider")', run: () => findByProps("ThemeContextProvider") },
{ label: 'findByName("ProfileEffectRecord", false)', run: () => findByName("ProfileEffectRecord", false) },
{ label: 'findByStoreName("UserProfileStore")', run: () => findByStoreName("UserProfileStore") },
{ label: 'findByStoreName("CollectiblesPurchaseStore")', run: () => findByStoreName("CollectiblesPurchaseStore") },
{ label: 'findByStoreName("ProfileEffectStore")', run: () => findByStoreName("ProfileEffectStore") },
{ label: 'findByName("GuildProfileEditForm", false) (currently dead/unused patch)', run: () => findByName("GuildProfileEditForm", false) },
{ label: 'findByName("UserProfileEditForm", false)', run: () => findByName("UserProfileEditForm", false) },
{ label: 'findByName("useProfileTheme", false)', run: () => findByName("useProfileTheme", false) },
{ label: 'findByName("useProfileThemeColors", false)', run: () => findByName("useProfileThemeColors", false) },
{ label: 'findByPropsAll("NONE_ITEM")', run: () => findByPropsAll("NONE_ITEM") },
{ label: 'findByProps("Radius")', run: () => findByProps("Radius") },
{ label: 'findByProps("Spacing")', run: () => findByProps("Spacing") },
{ label: 'findByProps("SafeAreaContext")', run: () => findByProps("SafeAreaContext") },
{ label: 'findByName("useWindowDimensions")', run: () => findByName("useWindowDimensions") },
{ label: 'findByProps("IconSizes")', run: () => findByProps("IconSizes") },
{ label: 'findByName("FlashList")', run: () => findByName("FlashList") },
{ label: 'findByProps("Svg")', run: () => findByProps("Svg") },
{ label: 'findByProps("PressableOpacity")', run: () => findByProps("PressableOpacity") },
{ label: 'findByProps("TextStyleSheet")', run: () => findByProps("TextStyleSheet") },
{ label: 'findByProps("BottomSheet")', run: () => findByProps("BottomSheet") },
{ label: 'findByProps("ActionSheet")', run: () => findByProps("ActionSheet") },
{ label: 'findByProps("BottomSheetScrollView")', run: () => findByProps("BottomSheetScrollView") },
{ label: 'findByProps("showActionSheet")', run: () => findByProps("showActionSheet") },
{ label: 'findByName("EditProfileEffectActionSheet")', run: () => findByName("EditProfileEffectActionSheet") },
{ label: 'findByName("showCustomColorPickerActionSheet")', run: () => findByName("showCustomColorPickerActionSheet") },
{ label: 'findByProps("triggerHapticFeedback")', run: () => findByProps("triggerHapticFeedback") },
// Color tokens referenced by FPTE specifically
{ label: 'semanticColors.HEADER_SECONDARY', run: () => semanticColors?.HEADER_SECONDARY },

View file

@ -7,7 +7,7 @@ import { showToast } from "@vendetta/ui/toasts";
import { lazy } from "../lib/lazy";
import { rawFindByStoreName } from "../lib/rawFind";
import { getFlux, getHaptic, getBulkAckMod, getReadStateTypesMod } from "../lib/commonModules";
import { GuildNode } from "../utils/theme";
import { GuildNode, useTheme } from "../utils/theme";
import GuildIcon from "./GuildIcon";
import { ContextMenuModal, ContextMenuItem } from "./ContextMenuModal";
@ -104,6 +104,30 @@ function Badge({ guildId }: { guildId: string }) {
return null;
}
function GuildLabel({ guildId }: { guildId: string }) {
useProxy(storage);
const theme = useTheme();
const Flux = getFlux();
const GuildStore = getGuildStore();
// Same reasoning as GuildIcon: guild data streams in progressively after connect, so this
// subscribes rather than reading the name once at mount.
const name = Flux?.useStateFromStores?.(
[GuildStore],
() => GuildStore?.getGuild?.(guildId)?.name ?? "",
[guildId],
) ?? "";
if (storage.showGuildNames === false || !name) return null;
return (
<Text numberOfLines={2} style={[lb.label, { color: theme.text }]}>
{name}
</Text>
);
}
export default function GuildItem({ node, onPick }: { node: GuildNode; onPick: (id: string) => void }) {
const viewRef = React.useRef<View>(null);
const scale = React.useRef(new Animated.Value(1)).current;
@ -165,11 +189,14 @@ export default function GuildItem({ node, onPick }: { node: GuildNode; onPick: (
onLongPress={handleLongPress}
delayLongPress={500}
>
<View ref={viewRef} style={st.outer} collapsable={false}>
<Animated.View style={[st.icon, { transform: [{ scale }] }]}>
<GuildIcon id={guildId} />
</Animated.View>
<Badge guildId={guildId} />
<View style={st.outer}>
<View ref={viewRef} style={st.iconWrap} collapsable={false}>
<Animated.View style={[st.icon, { transform: [{ scale }] }]}>
<GuildIcon id={guildId} />
</Animated.View>
<Badge guildId={guildId} />
</View>
<GuildLabel guildId={guildId} />
</View>
</Pressable>
<ContextMenuModal
@ -185,10 +212,21 @@ export default function GuildItem({ node, onPick }: { node: GuildNode; onPick: (
}
const st = StyleSheet.create({
outer: { width: ICON, height: ICON },
outer: { width: ICON },
iconWrap: { width: ICON, height: ICON },
icon: { width: ICON, height: ICON, borderRadius: 16, overflow: "hidden" },
});
const lb = StyleSheet.create({
label: {
width: ICON,
marginTop: 4,
fontSize: 10,
lineHeight: 12,
textAlign: "center",
},
});
const bd = StyleSheet.create({
outline: {
position: "absolute",

View file

@ -1,5 +1,7 @@
import React from "react";
import { View, Text, Pressable, Animated, Dimensions, StyleSheet, BackHandler } from "react-native";
import { storage } from "@vendetta/plugin";
import { useProxy } from "@vendetta/storage";
import { lazy } from "../lib/lazy";
import { rawFind, rawFindByFunctionProps } from "../lib/rawFind";
import { getFlux, getHaptic, getColorModule } from "../lib/commonModules";
@ -57,6 +59,8 @@ function CreateJoinButton() {
}
export default function ServerDrawerSheet({ gestureContext }: { gestureContext: any }) {
useProxy(storage);
const pick = React.useCallback((id: string) => {
const haptic = getHaptic();
haptic?.triggerHapticFeedback?.(haptic.HapticFeedbackTypes.SOFT);
@ -132,7 +136,7 @@ export default function ServerDrawerSheet({ gestureContext }: { gestureContext:
style={[st.grid, { paddingHorizontal: padX, gap: GAP }]}
onLayout={onLayout}
>
<DmTile />
{!storage.hideDmTile && <DmTile />}
{nodes.map((node) =>
node.type === "folder"
? <FolderItem key={node.id} node={node} onPick={pick} />

View file

@ -35,6 +35,18 @@ export default function Settings() {
value={storage.showUnreadBadges !== false}
onValueChange={(v: boolean) => { storage.showUnreadBadges = v; }}
/>
<FormSwitchRow
label="Show server names"
subLabel="Word-wrapped name below each server's icon"
value={storage.showGuildNames !== false}
onValueChange={(v: boolean) => { storage.showGuildNames = v; }}
/>
<FormSwitchRow
label="Hide the DMs tile"
subLabel="Remove the DMs tile from the drawer entirely"
value={!!storage.hideDmTile}
onValueChange={(v: boolean) => { storage.hideDmTile = v; }}
/>
</FormSection>
<FormSection title="Folders">
<FormSwitchRow