Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Settings): implement array types #3121

Open
wants to merge 78 commits into
base: dev
Choose a base branch
from

Conversation

EepyElvyra
Copy link
Contributor

@EepyElvyra EepyElvyra commented Jan 3, 2025

This PR implements: #615 #2210

New option types:

  • OptionType.ARRAY
  • OptionType.USERS
  • OptionType.CHANNELS
  • OptionType.GUILDS

these replace the previously used strings with separators.
Additionally, context menu entries are generated for all user, channel and guild options.

Since IDs are not user-friendly, this PR additionally implements a Modal replicating Discord's forwarding Modal to search for users/channels/guilds by text.

Repository owner deleted a comment Jan 3, 2025
@EepyElvyra EepyElvyra changed the title feat: Add an array option type feat: Add array options and UI Jan 19, 2025
@EepyElvyra EepyElvyra changed the title feat: Add array options and UI feat: implement array options and UI Jan 19, 2025
@Vendicated Vendicated force-pushed the feat/api/SettingsLists branch from cda67bf to bc843c3 Compare January 23, 2025 02:27
@Vendicated
Copy link
Owner

i tried to fix conflicts but borked smth :P

@CodiumAI-Agent
Copy link

Persistent review updated to latest commit 8674764

@EepyElvyra EepyElvyra force-pushed the feat/api/SettingsLists branch from 8674764 to bc843c3 Compare January 23, 2025 12:02
# Conflicts:
#	src/components/PluginSettings/PluginModal.tsx
#	src/plugins/index.ts
#	src/utils/types.ts
- switch from indices to IDs
- make indexes for the channel view unique
- Fix guilds shuffling around in the channel view by sorting them alphabetically
- Fix possibility to add elements twice from search modal by allowing to hide already added items from the search modal
- Remove invalid channels instead of just not rendering them.
@EepyElvyra EepyElvyra changed the title feat: implement array options and UI feat(Settings API): implement array types Jan 25, 2025
@EepyElvyra EepyElvyra changed the title feat(Settings API): implement array types feat(Settings): implement array types Jan 25, 2025
const invalidChannels: string[] = [];

for (const item of items) {
const channel = ChannelStore.getChannel(item);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this account for channels the user cannot access? Honestly not sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly idk either

src/components/SearchModal.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants