From 6f52993838573cd133f128c1c0b8507524140a00 Mon Sep 17 00:00:00 2001 From: pylixonly <82711525+pylixonly@users.noreply.github.com> Date: Sat, 9 Nov 2024 17:43:14 +0800 Subject: [PATCH 1/4] fix: set bottom inset for floating buttons credit to e9877234befc837126f4a24b23c837e7ed8f6b5b --- src/core/ui/components/AddonPage.tsx | 4 +++- src/metro/common/components.ts | 2 +- src/metro/common/types/components.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/ui/components/AddonPage.tsx b/src/core/ui/components/AddonPage.tsx index 7122e39..f2c5d4c 100644 --- a/src/core/ui/components/AddonPage.tsx +++ b/src/core/ui/components/AddonPage.tsx @@ -7,7 +7,7 @@ import isValidHttpUrl from "@lib/utils/isValidHttpUrl"; import { lazyDestructure } from "@lib/utils/lazy"; import { findByProps } from "@metro"; import { clipboard } from "@metro/common"; -import { Button, FlashList, FloatingActionButton, HelpMessage, IconButton, Stack, Text, TextInput } from "@metro/common/components"; +import { Button, FlashList, FloatingActionButton, HelpMessage, IconButton, Stack, Text, TextInput, useSafeAreaInsets } from "@metro/common/components"; import { ErrorBoundary, Search } from "@ui/components"; import fuzzysort from "fuzzysort"; import { ComponentType, ReactNode, useCallback, useMemo } from "react"; @@ -111,6 +111,7 @@ export default function AddonPage({ CardComponent, ...props }: const [search, setSearch] = React.useState(""); const [sortFn, setSortFn] = React.useState<((a: unknown, b: unknown) => number) | null>(() => null); + const { bottom: bottomInset } = useSafeAreaInsets(); const results = useMemo(() => { let values = props.items; @@ -198,6 +199,7 @@ export default function AddonPage({ CardComponent, ...props }: renderItem={({ item }: any) => } /> {props.installAction && } diff --git a/src/metro/common/components.ts b/src/metro/common/components.ts index 48c8d3e..358b46b 100644 --- a/src/metro/common/components.ts +++ b/src/metro/common/components.ts @@ -20,7 +20,7 @@ export const CompatButton = findByPropsLazy("Looks", "Colors", "Sizes"); export const HelpMessage = findByNameLazy("HelpMessage"); // React Native's included SafeAreaView only adds padding on iOS. -export const { SafeAreaView, SafeAreaProvider } = lazyDestructure(() => findByProps("useSafeAreaInsets")); +export const { SafeAreaView, SafeAreaProvider, useSafeAreaInsets } = lazyDestructure(() => findByProps("useSafeAreaInsets")); // ActionSheet export const ActionSheetRow = findProp("ActionSheetRow"); diff --git a/src/metro/common/types/components.ts b/src/metro/common/types/components.ts index 1a8bbde..619e8e2 100644 --- a/src/metro/common/types/components.ts +++ b/src/metro/common/types/components.ts @@ -133,6 +133,7 @@ interface FABProps { icon: ImageSourcePropType | ReactNode; style?: Style; onPress: () => void; + positionBottom?: number; } export type FloatingActionButton = React.FC; From 514665fecdb753aedaecf28533f41e82921d2388 Mon Sep 17 00:00:00 2001 From: pylixonly <82711525+pylixonly@users.noreply.github.com> Date: Sat, 9 Nov 2024 21:09:18 +0800 Subject: [PATCH 2/4] chore: use issue forms feature [skip ci] --- .github/ISSUE_TEMPLATE/bug-report.md | 35 ---- .github/ISSUE_TEMPLATE/bug-report.yml | 191 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature-request.yml | 41 +++++ 4 files changed, 233 insertions(+), 35 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index 3bffcb3..0000000 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: 'bug: ' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Device Information (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Discord Version [e.g. 222111] - - Bunny Version [e.g e19e89c-main] - -**Checklists** -- [ ] I understand that this is a bug report and not a place to request new features or plugins -- [ ] I understand that this is no place to report bugs produced by a plugin -- [ ] I can reproduce this bug in Bunny's safe mode AND unable to reproduce it in vanilla/unmodded Discord diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..cb92112 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,191 @@ +name: Bug report +description: Create a bug report to help us improve +title: "[bug]: " +labels: [bug] +body: + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > ## Before you submit this issue... + > We might reject any issues that can't be solved within the repository, or reports that are too general. For example: + > + >
+ > "Bunny crashes upon starting..." + > > There are lots of different things that could be causing this, but it's probably not related to this repository. + >
+ >
+ > "Bunny freezes on splash screen..." + > > The issue is too general and should be reported only when it occurs after an update to a specific Discord version or after a specific action or configuration has been made within Bunny. + >
+ >
+ > "Bunny refuses to install/stuck on downloading..." + > > This is an external issue (sideloading) that does not have a place in this repository. If it's a problem with Bunny Manager, report it to the appropriate repository. + >
+ > + > If you think that your problem belongs to one of these, you should avoid submitting this report unless you are told to do so. + > + > Please report the problem or ask for help in the appropriate place. For example, if the problem occurs in BunnyManager, report it in the BunnyManager repository. If an error occurs when trying to sideload the prepatched IPA, reach out support for the sideloader you're using. + + - type: checkboxes + id: checklist + attributes: + label: Checklist + description: You should ensure the completion of the task before proceeding to check it off the checklist. Neglecting to do so may impede the efficiency of the issue resolution process. The developer has the right to delete the issue directly if you check the list blindly. + options: + - label: I am able to reproduce the bug with the latest version of Bunny and Discord. + required: true + - label: I've checked that there is no open or closed issue about this bug. + required: true + - label: The title of this issue accurately describes the bug. + required: true + - label: This is not a feature request or a general question. + required: true + - label: This bug can be reproduced consistently and is not caused by a plugin. + required: true + - label: I have read the notes above and ensured that my issue is clear and within this repository. + required: true + + - type: textarea + id: reproduce-steps + attributes: + label: Steps to reproduce the bug + description: What did you do for the bug to show up? + placeholder: | + Example: + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + placeholder: | + Example: + "This should happen..." + validations: + required: true + + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + placeholder: | + Example: + "This happened instead..." + validations: + required: true + + - type: textarea + id: sreen-media + attributes: + label: Screenshots/Screen recordings + description: | + A picture or video helps us understand the bug more. + + You can upload them directly in the text box. + + - type: textarea + id: logs + attributes: + label: Logs + description: | + Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + + - type: dropdown + id: platform + attributes: + label: What platform did you produce this issue on? + options: + - Android + - iOS + validations: + required: true + + - type: input + id: discord-version + attributes: + label: Discord version + description: | + The version of Discord you are using. You can find this in the settings. You may leave both the version number and the build number. + placeholder: | + Example: + "253.2 (66074)" + validations: + required: true + + - type: input + id: version + attributes: + label: Version + description: | + The version of Bunny the issue is occuring on. You can find this in the settings. Bunny version is in formatted like the following: `beaf689-main` and NOT like this: `0.2.3`. + placeholder: | + Example: + "beaf689-main" + + - type: input + id: loader-version + attributes: + label: Loader version + description: | + The version of the loader you are using. You can find this in the settings. + placeholder: | + Example: + "BunnyTweak (0.3.2)" + validations: + required: true + + - type: input + id: device + attributes: + label: Device + description: | + The device model you are using. + placeholder: | + Example: + "iPhone 13 Pro Max" + validations: + required: true + + - type: input + id: os-version + attributes: + label: OS version + description: | + The version of the operating system you are using. + placeholder: | + Example: + "iOS 15.0.1" + validations: + required: true + + - type: textarea + id: debug-info + attributes: + label: Debug information + description: | + Debug information is important for the developer to understand the environment in which the bug occurred. You can get this information by sending `/debug` in the chat. + placeholder: | + Example: + Bunny: beaf689-main (BunnyXposed 0.2.4) + Discord: 255.2 (255202) + React: 18.3.1 (RN 0.74.5-discord-11) + Hermes: for RN 0.74.5-discord-11 (bcv96) + System: Android 13 (SDK 33) + Device: M2101K7BG (secret) + + - type: textarea + id: additional-information + attributes: + label: Additional information + placeholder: | + Example: + "I have tried to do this..." + "This only happens in this situation..." + "This could be related to..." \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000..80d4b33 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,41 @@ +name: Feature request +description: Suggest an idea for Bunny +title: "[feature]: " +labels: [enhancement] +body: + - type: checkboxes + id: checklist + attributes: + label: Checklist + description: You should ensure the completion of the task before proceeding to check it off the checklist. Neglecting to do so may impede the efficiency of the issue resolution process. The developer has the right to delete the issue directly if you check the list blindly. + options: + - label: I've checked that there is no other issue about this feature request. + required: true + - label: This issue contains only one feature request. + required: true + - label: The title of this issue accurately describes the feature request. + required: true + + - type: textarea + id: feature-description + attributes: + label: Feature description + description: What feature you want Bunny to have? Provide detailed description about what it should look like or where it should be added. + validations: + required: true + + - type: textarea + id: why-is-the-feature-requested + attributes: + label: Why do you want this feature? + description: Describe the problem or limitation that motivates you to want this feature to be added. + validations: + required: true + + - type: textarea + id: additional-information + attributes: + label: Additional information + description: Add any other context or screenshots about the feature request here. + placeholder: | + Additional details and attachments. \ No newline at end of file From 1bddd2824f2870cd3b397172c842d3c959070ad2 Mon Sep 17 00:00:00 2001 From: pylixonly <82711525+pylixonly@users.noreply.github.com> Date: Sat, 9 Nov 2024 21:51:39 +0800 Subject: [PATCH 3/4] types: correct some types [skip ci] --- src/lib/addons/plugins/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/addons/plugins/types.ts b/src/lib/addons/plugins/types.ts index fb7027a..8107375 100644 --- a/src/lib/addons/plugins/types.ts +++ b/src/lib/addons/plugins/types.ts @@ -1,5 +1,5 @@ -import { createStorage } from "@core/vendetta/storage"; import { Author } from "@lib/addons/types"; +import { createStorage } from "@lib/api/storage"; import { Logger } from "@lib/utils/logger"; export interface PluginRepo { @@ -47,7 +47,7 @@ export interface PluginInstanceInternal extends PluginInstance { export interface BunnyPluginProperty { readonly manifest: BunnyPluginManifestInternal; readonly logger: Logger; - createStorage(): ReturnType>; + createStorage(): ReturnType>; } export type BunnyPluginObject = typeof window.bunny & { From 99c12660f4857abe33ddc5b7056242b5c0ea8bcc Mon Sep 17 00:00:00 2001 From: pylixonly <82711525+pylixonly@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:48:02 +0800 Subject: [PATCH 4/4] fix(native): update native modules name MMKVManager -> NativeCacheModule --- src/lib/api/native/modules/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/api/native/modules/index.ts b/src/lib/api/native/modules/index.ts index c0736ed..a31dead 100644 --- a/src/lib/api/native/modules/index.ts +++ b/src/lib/api/native/modules/index.ts @@ -2,7 +2,7 @@ import { RNModules } from "./types"; const nmp = window.nativeModuleProxy; -export const MMKVManager = nmp.MMKVManager as RNModules.MMKVManager; +export const MMKVManager = (nmp.NativeCacheModule ?? nmp.MMKVManager) as RNModules.MMKVManager; export const FileManager = (nmp.NativeFileModule ?? nmp.RTNFileManager ?? nmp.DCDFileManager) as RNModules.FileManager; export const ClientInfoManager = nmp.NativeClientInfoModule ?? nmp.RTNClientInfoManager ?? nmp.InfoDictionaryManager; export const DeviceManager = nmp.NativeDeviceModule ?? nmp.RTNDeviceManager ?? nmp.DCDDeviceManager;