#👾-core-development

1 messages · Page 229 of 1

fossil inlet
#

i had a horrible idea for getting names on common components

rugged spire
fossil inlet
#

rename common components that are minified ,like focus ring, to focusring

median rapids
#

it's fairly good actually

rugged spire
median rapids
#

xd

scenic brook
#

Ended up just going with this, seems the least cursed. Someone can just suggest changes in review if there's a better option

#

I kinda wanna map the modules for the whole lib but I don't really have time to hunt them down

limber skiff
#

they are probably exported in the same module tho

scenic brook
#

This alone is useDrag

#

Like it just seems to be a module per function near enough

#

But, y'know, me just being dumb is always on the table

charred monolithBOT
rugged spire
#

i like going down a rabbit hole to find 1300 line bd plugin file

scenic brook
#

☑️ I have read the requirements for opening an issue above

jolly egret
#

tfw contributor agreement

rugged spire
#

nuh uh

#

all closed since idk how long ago

#

also good luck to anyone who wants to port that anyway

charred monolithBOT
jolly egret
#

i really don't get it, if something is shouting at you in all caps maybe you should read it

#

instead of being annoying af to the maintainers of a project which very much do not want you to do this because its a waste of everyones time

rugged spire
jolly egret
#

okay you read them... now??

#

😭

rugged spire
#

honestly i bet the reason why nobody has ported this is because the original plugin is almost 2k LoC in a single file

jolly egret
#

also why would you want your discord to be animated like that husk

rugged spire
scenic brook
charred monolithBOT
jolly egret
#

their entire fork is doomed

scenic brook
jolly egret
#

they attempted to add bettermic, betterscreenshare, the entirety of philsPluginLibrary (which hasn't been updated in months and likely doesn't work properly), fakedeafen and a few other things

#

(and a lot of add files via upload)

#

add has marked themselves as the author of the massive plugin lib

rugged spire
#

its horror

#

they probably just want to annoy people in vc

jolly egret
#

make people go crazy but harassing one of their ears

rugged spire
#

you love forwarding causing mute

#

#🤖-bot-commands message

#

i bet the code from that doesn't even work anyway

charred monolithBOT
scenic brook
#

Yet another vencord feature stolen smh my head

glass jasper
scenic brook
#

Yes

austere talon
#

looks like custom badge component exploded

austere talon
#

canary motherfucker

fossil inlet
#

nevermind

#

just reloaded

#

and it went boom

odd heath
#

we should have a venbot command to run reporter

#

vreport or smth

frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

BadgeAPI (had no effect):
ID: 184325
Match: ```
/(?<=text:(\i).description,.{0,200})children:/


**__AccountPanelServerProfile (had no effect):__**
ID: `720734`
Match: ```
/(?<=\.SIZE_32\)}\);)/
Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

glass jasper
#

Oof... also i was thinking that it cant be that difficult to make a patch so badges show up in the My Account section of the settings with the other badges.

odd heath
#

what did you leak there 😭

glass jasper
#

what do you mean?

odd heath
#

you delete the attachment

glass jasper
#

what attachment?

odd heath
#

there was an image in ur msg and u removed it

#

i assumed you leaked something

glass jasper
#

what image?

#

(im trying to gaslight her, the truth is it was just a really bad image so I removed it)

odd heath
charred monolithBOT
charred monolithBOT
limber skiff
#

ngl, text replace and pin dms should not be using DataStore

#

not sure about relationship notifier and better sessions

limber skiff
#

it's not even a huge amount of data, I don't get why they were put in DataStore

limber skiff
#

what pr?

odd heath
#

The settings array one

limber skiff
#

it's different

#

that data doesn't need an UI for it

odd heath
#

Yeah but the data store thing is still included in the pr so

limber skiff
#

wdym

odd heath
#

The pr takes the data out of data store into a setting

half shell
#

Opinions on renaming "PinDMs" to "GroupDMs"/"TagDMs" or something along the lines

#

Or add it to the description

odd heath
#

Seems pointless and worse

rugged spire
dusk blaze
#

maybe add in tags so it shows up in search

rugged spire
#

just give us UserTags

frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

BadgeAPI (had no effect):
ID: 184325
Match: ```
/(?<=text:(\i).description,.{0,200})children:/


**__AccountPanelServerProfile (had no effect):__**
ID: `720734`
Match: ```
/(?<=\.SIZE_32\)}\);)/
Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

did they really bump electron to a version without the devtools fix

#

it's white again

#

god

#

gottta be kidding me

#

WHO DID THIS

fossil inlet
limber skiff
#

the css issue

#

weird colors and defaults to white

fossil inlet
#

TBH I like it like that

limber skiff
#

it's complete shit

fossil inlet
#

Not the defaulting to white part, but the weird colors.

#

i love the way the blue looks

limber skiff
#

Reflect.defineProperty lovely

charred monolithBOT
charred monolithBOT
fossil inlet
#

thanks blobcatcozy

#

?remind 4 hours add to console janitor

shut vineBOT
#

Alright @fossil inlet, in 4 hours: add to console janitor

fossil inlet
charred monolithBOT
median rapids
#

new electron devtools suck

fossil inlet
#

better than CEF devtools blobcatcozy

fossil inlet
#

(old patch didnt match anything even after all lazy chunks were loaded)

opaque silo
#

update your electron

limber skiff
#

read what I said...

opaque silo
#

BUHHHHHHHHHHHH

#

mobile small screen and j didnt scroll up more

#

love

#

why the hell would they bump to 33 flat

#

thats psychotic

#

well at least they are updating it ,,,.

glass jasper
opaque silo
#

that was so bad

#

it was a flashbang every time I opened devtools since I use system theme on discords main window

glass jasper
opaque silo
frail skyBOT
#
Bad Patches

BadgeAPI (had no effect):
ID: 184325
Match: ```
/(?<="aria-label":(\i).description,.{0,200})children:/


**__AccountPanelServerProfile (had no effect):__**
ID: `720734`
Match: ```
/(?<=\.AVATAR_SIZE\);)/
Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

fossil inlet
#

time to merge main

#

wait that ran on dev im stupid

limber skiff
#

troll

shut vineBOT
#

@fossil inlet, <t:1737234775:R>: add to console janitor

limber skiff
#

also btw it's Saturday, they don't work in weekends

#

which means no canary -> stable push

jolly egret
#

we are kinda overdue a tag push

glass jasper
#

Agreed should really do it with the next push to main

median rapids
#

what is even the point of the versioning

glass jasper
#

something like that i believe

median rapids
#

ahh

charred monolithBOT
charred monolithBOT
#

After (???) amount of usage, I've noticed this doesn't work. I been researching how PopoutWindowStore works to see how this could be fixed.

Replace the subscription to "POPOUT_WINDOW_OPEN" with the "message" event on the window.
Replace finding the most recent windowKey with event.data?.discordPopoutEvent?.key

This is how PopoutWindowStore adds the styles (]through a chain of functions)

Extra note: There is a ternary to switch between recreating all link[rel="stylesheet"] ele...

rugged spire
#

okay

#

i think I figured out something

charred monolithBOT
rugged spire
#

I am considering rewriting the managed styles API to support styles injected at runtime

uneven needle
rugged spire
uneven needle
#

probably?

rugged spire
#

this is why btw

rugged spire
#

i feel like if I make this it I will rewrite quickCss to use this and that will explode the changes you just made

#

it'll be better in the long term though

uneven needle
rugged spire
#

well then I will just rewrite that to be part of this new styles api

#

also does anyone know if VencordStyles["classNames"] is ever actually used or can just be removed

#

answering my own question... (this doesnt get called by anything)

#

i think this whole thing needs to be changed into a generic "edit style" function

rugged spire
#

I need to use a FluxStore in a core API, is this a bad practice?

#

it's going great

#

bruh

#

destructuring losing this moment

#

i just had to set a debugger point just to realise that I didn't add the element to the DOM

#

this happened because I moved where the element is created

grave mangoBOT
# rugged spire https://github.com/Sqaaakoi/Vencord/blob/dc957fc8e609962284e76c835fb78b212830f49...

Styles.ts: Lines 115-126

export const setStyleClassNames = (name: string, classNames: Record<string, string>, recompile = true) => {
    const style = requireStyle(name);
    style.edit = source => {
        return source
            .replace(/\[--(\w+)\]/g, (match, name) => {
                const className = classNames[name];
                return className ? classNameToSelector(className) : match;
            });
    };
    if (recompile && isStyleEnabled(style.name))
        compileStyle(style);
};
rugged spire
#

should I nuke isStyleEnabled while I'm at it

odd heath
#

Yes

odd heath
rugged spire
rugged spire
#

What is this

odd heath
#

Wha

rugged spire
#

thanks vscode very cool

rugged spire
#

I am quickly learning why the Styles API was written how it was

fossil inlet
austere talon
#

why are you even changing it

rugged spire
#

also to avoid any plugins creating and injecting their own style element

#

i'm still playing around with the API

#

oh also less CSS in JS

charred monolithBOT
fossil inlet
#

@granite wharf

#

Is it broken

austere talon
#

what

odd heath
rugged spire
limber skiff
#

I got a very basic implementation for array settings that dont include UI

#

will use it to migrate stuff from DataStore -> settings

fossil inlet
limber skiff
#

no

#

im not doing array ui

#

this is barebones to have defaults

fossil inlet
#

😭

odd heath
#

Well I have more than that

#

But that is also in my PR

#

As I've previously mentioned 😭

#

Just merge my PR :3c

limber skiff
rugged spire
#

i will add another changed file

odd heath
#

The rest is just changes to plugin settings to add the changes xd

limber skiff
#

good start

#

troll

#

(that's my changes)

odd heath
#

o

fossil inlet
limber skiff
#

holy shit

#

it worked

#

can just push to array and it saves changes

odd heath
#

FIRE

#

changed my mind

#

push your changes once youre done and ill adapt my pr

austere talon
#

dont just implement it without plan

#

it needs ui to manage and needs to be a few types of arrays

#

user array, role array, channel array, arbitrary string array, like that issue describes

limber skiff
#

nono that's not what I'm doing

#

I'm just doing barebone array for settings that dont require UI, but we want to save in the settings JSON

austere talon
#

that goes against how other settings work

#

by default it should have ui

#

if you don't want ui you should use hidden property

limber skiff
#

I dont wanna implement UI right now, I just want to easily be able to use array to save settings

austere talon
limber skiff
#

I will make array settings be hidden for now

austere talon
#

ARRAY optiontype should probably take a renderRow function

limber skiff
#

UI is way more complicated, and I dont wanna deal with it

austere talon
#

which gets one element and has to render row for settings

#

and then there are more specific arrays (user, role, channel, etc) which dont need it

limber skiff
#

mainly I wanna avoid this right now

#

I'm gonna make text replace and pin dms use settings instead of DataStore

#

so I need array

austere talon
#

just need to make DataStore sync instead

limber skiff
#

and to make it easy to migrate to when we have proper array settings, I wanna implement this basic type inference and default right now, without UI

limber skiff
austere talon
#

why

limber skiff
#

why would it

austere talon
#

PinDMs absolutely does

limber skiff
#

how?

#

it's a small amount of data

austere talon
#

because dms are essentially temporary state

#

copying PinDMs to a separate account wont work

#

will just fuck ur dms up

limber skiff
#

the same will happen if you sync DataStore

#

and it wont mess up anything?

#

dms that dont exist wont make a difference

odd heath
#

when would that ever happen

austere talon
#

different account

limber skiff
#

everyone just be using DataStore for everything when it's not needed

odd heath
#

pindms syncing >>>>> edge case where one converts vencord settings to diff account

#

ngl

#

its so ASS when i install on a new device and have to redo all my ordering

limber skiff
#

how edge case?

#

oh

#

nvm

#

there's no edge case though...

odd heath
#

i could add roles to my pr

limber skiff
#

text replace migrated

#

pretty easy

#

nvm it has some issues

#

oh I know why

rugged spire
#

surely you can figure out a way to implement this into the settings API

#

Testing my managed unified styles API is going just fine.

#

smh

#

i did something obviously dumb

rugged spire
#

This includes the core CSS

fossil inlet
#

horror

limber skiff
#

nvm the issue was different but easy fix regardless

odd heath
#

i reverted my part that migrates from datastore to array blobcatcozy

limber skiff
#

just message tags and pin dms now

charred monolithBOT
#
[Vendicated/Vencord] New branch created: partial-array-settings
limber skiff
#

pin dms is already user dependent

#

oh god noooo

#

why is it done like this

odd heath
#

yeah its VERY husk

rugged spire
#

@limber skiff you will cry when you see my significant changes to vencord code

scenic brook
#

For the arrays stuff

limber skiff
#

pin dms is harder than I thought

odd heath
rugged spire
#

i accidentally intentionally obsoleted someone elses PR

limber skiff
#

yeah but I cant save the data into something like this

#

I need a way to separate by userId

odd heath
limber skiff
rugged spire
#

you need a per user settings abstraction

limber skiff
#

it's done like that currently

odd heath
#

try if it breaks if another user loads it

limber skiff
#

so either, store an array with userId and categories in settings

#

or OptionType.OBJECT

odd heath
#

alternatively add the user id to the category object

limber skiff
#

I need help

rugged spire
limber skiff
#

🙏

limber skiff
#

@rugged spire do you have pinned dms?

rugged spire
#

nop

#

sorry

limber skiff
#

my changes already don't work nvm

rugged spire
#

i will submit giant pr soon

limber skiff
#

hehe

#

it worked

#

@odd heath do you have pinned dms?

limber skiff
#

can you test if migration works?

charred monolithBOT
odd heath
#

sure

charred monolithBOT
limber skiff
#

o wait it's not even passing tests

odd heath
#

😭

charred monolithBOT
limber skiff
#

alright done

odd heath
#

me wondering why the dms dont show up ordered:

#

alr @limber skiff should i try?

limber skiff
#

yeah

#

make sure everything is working and migrated

#

and that DataStore no longer has any PinDMs related keys

charred monolithBOT
odd heath
#

uuh i fucked up

#

gimme a while 😭

#

love git

limber skiff
#

don't worry

odd heath
#

ah i get why it errors

#

@limber skiff works

limber skiff
#

nice

odd heath
charred monolithBOT
limber skiff
#

@rugged spire @odd heath wanna review?

odd heath
charred monolithBOT
frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

okay I will just wait to see if @rugged spire wants to review

odd heath
#

oh @limber skiff one thing

#

why Settings.plugins.PinDMs.dmSectioncollapsed instead of settings.store?

charred monolithBOT
odd heath
#

actually whatr does this even do

limber skiff
#

I'm changing the setting name

#

so migrating the current value

rugged spire
odd heath
#

right oki

limber skiff
#

if I use settings.store I have to ts-ignore

#

because dmSectioncollapsed doesn't exists in its types anymore

odd heath
#

yea

#

i didnt see the letter difference

#

lol

rugged spire
#

though I don't get the point of categoryLen

#

you should probably refactor that out

#

what is this.

limber skiff
#

well the function existed so I just used it lol

rugged spire
#

guh

#

well

#

is it used anywhere else?

limber skiff
#

instead of importing the category list I used the function

rugged spire
#

if yes keep it

limber skiff
#

let me see

rugged spire
#

if no don't keep it

limber skiff
#

yeah

#

it's exported in the plugin object

rugged spire
#

ohhhhhh

#

yeah i see

limber skiff
#

it's finee

rugged spire
#

keep it

#

ready to see my horrors

#

?

charred monolithBOT
#

Converts the managed styles API to be a unified API for all styles

The problem

Vencord does not inject styles into popout windows.
Additionally, plugins that create their own styles at runtime contain a lot of (ugly) code to add these styles.

How this solves the problem

Almost every call to document.createElement("style")[^1] is replaced with the unified styles API.
This API should be considered the single source of truth regarding stylesheets for everything from now o...

rugged spire
glass jasper
charred monolithBOT
odd heath
austere talon
charred monolithBOT
austere talon
#

there should be a dedicated syntax for variables and then you specify them via some object

limber skiff
#

what?

austere talon
#
filter: blur({{VAR_NAME}});
#

something like this

#

and then you specify an object like

{
  VAR_NAME: whatever
}
limber skiff
rugged spire
#

okay

austere talon
charred monolithBOT
austere talon
#

like I said it has to be consistent with how the API works or it's an awful idea to add it

odd heath
#

what

limber skiff
#

bruhh

austere talon
#

don't rush adding something like that and don't just make changes to apis without everyone agreeing on it

limber skiff
#

you realize the difference between making the UI and the guild/channel/user stuff for it than just support saving

limber skiff
#

devbuilds arent even supported

#

I just wanna get rid of the datastore in a way that's not gonna change as soon as we change that API again

rugged spire
#

please do not nuke datastore entirely

limber skiff
#

you realize the actual UI for it is gonna take months to get added

#

if not a year

#

it's complex, very complex

limber skiff
austere talon
#

the core point is: do not make api changes without everyone's approval

limber skiff
#

okay so now we wait a year to get an actual change

#

plus that change literally impacts no one

#

if you need the UI for simply doesn't use?

#

it's not done and that's it, nothing bad about it

austere talon
#

don't focus so much on the ui aspect

limber skiff
#

okay but then approve that

austere talon
#

maybe, i'll have to see it first

limber skiff
#

the changes are extremely simple and just provide a clear way to use the settings instead of the datastore for arrays

charred monolithBOT
limber skiff
#

since it got reverted I will just push to there then

#

I realized the settings proxy were never supporting a delete

rugged spire
#

i dont think any vencord plugins use it anymore

austere talon
#

idr what that is

rugged spire
#

literally just a wrapper around the variables idea you had with a not so generic name

austere talon
#

the main reason plugins use self managed styles is custom variables

rugged spire
#

nuking it is dumb

austere talon
#

or maybe we don't need that

rugged spire
#

i will just rewrite it

austere talon
#

instead add an easy way to set variables on root

#

so you can just use css variables

#

we need to patch discord's css variable function for that

austere talon
#

discord has a function (might be a reatc hook) that manages this

rugged spire
#

yeah i know

austere talon
#

the variables and the classes

rugged spire
#

do we have to use that?

austere talon
#

hook into that to let plugins easily add variables

austere talon
#

if you try to add it manually discord will overwrite it

rugged spire
#

i never said I wanted to edit the properties of the html element

#

whats wrong with just making another style element at the bottom that uses :root selector

austere talon
#

it's better to put it on root element so it doesn't have to parse & recalculate styles afaik

austere talon
#

don't self merge major changes

charred monolithBOT
odd heath
#

this is gonna be a terrible merge conflict

#

Clueless ill just force push it away

rugged spire
rugged spire
#

ooops I was in [Electron Isolated Context]

grave mangoBOT
rugged spire
#

HELP HOW DO I GET OUT OF ELECTRON ISOLATED CONTEXT OTHER THAN THIS HORRIBLE MESS

charred monolithBOT
glass jasper
#

like this

#

or a keybind for opening quickcss

#

Like a plugin that adds a bunch of different keybinds

#

and other already existing plugins like NoF1 or F8break can be merged into it

fossil inlet
#

not a terrible idea

scenic brook
#

Record macro plugin suffoPeepoMischief

fossil inlet
scenic brook
#

AHK my beloved

fossil inlet
#

was my first lang blobcatcozy

austere talon
#

TODO: add a max limit of connections ShowConnections will display

opaque silo
glass jasper
fossil inlet
#

thanks github copilot

fossil inlet
granite wharf
fossil inlet
#

fuck that, i cant even scroll on it

odd heath
# fossil inlet thanks github copilot

I recently asked it to give me code to do something specific I don't remember with strings
It had some scientific term

But it went like "can't use this code since it matches public code" and I had to go to stackoverflow to get the code I wanted 😭

odd heath
#

Really

rugged spire
fossil inlet
#

your reviews are insane

rugged spire
#

I know.

odd heath
#

I never denied that tho

#

Ehh it's fine

charred monolithBOT
median rapids
#

there is now

frail skyBOT
#
Bad Patches

BadgeAPI (had no effect):
ID: 184325
Match: ```
/(?<="aria-label":(\i).description,.{0,200})children:/


**__AccountPanelServerProfile (had no effect):__**
ID: `720734`
Match: ```
/(?<=\.AVATAR_SIZE\);)/
Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

sterile narwhalBOT
#
Error 30009

Maximum number of connections reached (50)

frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

fossil inlet
long stream
limber skiff
#

@fossil inlet why is default not a multiple of 7

fossil inlet
limber skiff
#

each row has 7

#

o

fossil inlet
#

you can make it 21 if you want, i just think it looks better if the default is a mutuple of seven -1

limber skiff
#

I didn't see you added a button

#

mbbb

fossil inlet
#

all good

#

also i recall there being a way to scroll to a section on a profile but too tired to add that part

#

also i could be crazy

median rapids
#

i think ur crazy

fossil inlet
#

checks out

acoustic leafBOT
#
Matthew 7:12 - Revised Standard Version (RSV)

<12> So whatever you wish that men would do to you, do so to them; for this is the law and the prophets.

fossil inlet
austere talon
#

yeah seems good

#

honestly limit to 13

#

2 rows

#

probably bebtter

#

anything above 13 is insane

fossil inlet
#

eh the user can change it, idrc about the default

#

ill set the default to 13

fossil inlet
#

@austere talon how is this better

charred monolithBOT
austere talon
fossil inlet
austere talon
#

you are insane

#

make the markers all multiples of 7 (minus 1)

dusk blaze
#

i want 10000 connections

charred monolithBOT
limber skiff
#

it really should be a splice

charred monolithBOT
austere talon
#

both MessageTags and PinDms should just be objects instead of arrays cause they're basically implemented as just worse performing objects

#

well PinDms should be Record<UserId, Pin[]>

limber skiff
#

that means OptionType.Object

charred monolithBOT
austere talon
#

u can just use private setting

#

the only downside of private setting is that u need to null check

limber skiff
#

that's what I'm trying to avoid

austere talon
#

if that's really such a big deal then sure add OptionType.CUSTOM or smth

#

which is always hidden and can be anything

limber skiff
#

IgnoreActivities was already doing something like that

#

but for arrays too

austere talon
limber skiff
#

this isn't the root settings object though, is it?

#

root would be target

austere talon
austere talon
#

um

limber skiff
#

I guess it wasn't ever noticed

#

cuz where it's ignored here for example

grave mangoBOT
austere talon
#

it's supposed to be the root object

#

i think

limber skiff
#

it should be self.plain then

#

right?

austere talon
#

ummm actually

#

just leave it the way it is rn and ignore that feedback

#

we can rethink another time

grave mangoBOT
austere talon
#

yeah no it's supposed to be the root

#

lolll

#

anyway just leave it like this for now we can change it later

limber skiff
#
    /**
     * Add a global change listener, that will fire whenever any setting is changed
     *
     * @param data The new data. This is either the new value set on the path, or the new root object if it was changed
     * @param path The path of the setting that was changed. Empty string if the root object was changed
     */
austere talon
#

oh right i got confused because

limber skiff
#

ehmm we should just fix it

austere talon
#

old vencord settings had a function to add change listeners

#

that function got the new value set

#

then i ported vesktop settings store to vencord which always gives root

#

and i got them mixed up so its this frankenstein

austere talon
#

otherwise change it to always root

austere talon
limber skiff
#

actually it does require 😭

austere talon
#

i mean the new custom option wouldnt

limber skiff
#

because of this

#

stupid setting definitioin

austere talon
#

hmmm

limber skiff
#

might just change it to this then

austere talon
limber skiff
#

😭

austere talon
#

change it to

export type Def = PluginSettingArrayDef | ((
  ....
) & PluginSettingsCommon);
limber skiff
#

oh

#

okay that was more smart

#

LOL

austere talon
#

XD

#

i think my CUSTOM idea is much more powerful than ur array one cause it will allow anything json serialisable

limber skiff
#

I will try it

austere talon
#

but thats too much for now

limber skiff
#

pretty sure arrays still need a different proxy implementation but that's fine

#

also should we proxy the nested objects or not

#

I think just the top level object/array

#

nooot sure

austere talon
#

we should

#

if u want unproxied use plain uranium

limber skiff
#

okay that's a bit harder but let me see

austere talon
#

the normal one should be compatible

#

set and delete traps are literally the same thing

#

only difference is no get trap

limber skiff
#

the path differs

#

which makes sense in my head

#

unless we should make the path the index

austere talon
#

yeah we should imo

limber skiff
#

so like

#

something.0 or something[0]

austere talon
#

.0

#

is fine imo

limber skiff
#

then yeah same implementation

austere talon
#

doing that is more accurate than doing the array path

#

cause that would mean the array is being overwritten

limber skiff
#

now this worked with any[] because it was an array

#

if I do just any it wont work how I want

#

hmmm

austere talon
limber skiff
#

if default is undefined then we type to any

#

otherwise we infer from default

austere talon
#

you did any[] not any

limber skiff
#

yes

austere talon
#

why array

limber skiff
#

that was the old implementation

#

I'm saying if I change to any that method does not work

austere talon
#

ohhhh

limber skiff
#

everything extends any

#

and if I invert it

austere talon
#

try extends undefined

#

yeah it just becomes any

limber skiff
#

and omit default

#

fucking unknown

austere talon
#

ohhh

#

why is it unknown insead of any

limber skiff
#

apparently if its omitted its not extending undefined...

austere talon
#

try never

limber skiff
#

o I think type-fest has something

austere talon
#

uhhh

#

why cant you just do O["default"]

limber skiff
#

o wait

austere talon
#

try that and if it doesn't work, try

O extends { default: infer Default } ? Default : any
limber skiff
#

because of this

austere talon
#

oh my god spotify reset my password

austere talon
#

let me figure it out

#

just do the rest and leave types explosive and i will fix them

fossil inlet
#

@robust halo

inland fable
#

undefined as any?

limber skiff
#

what even is the issue now

#

that returns a boolean why doesn't it work

dusk blaze
#

reject typescript, embrace @ts-ignore

limber skiff
#

oh

glass jasper
limber skiff
#

extends true...

fossil inlet
#

IsAny<O["default"]> extends true ? 1 : 0

limber skiff
#

awww come on

austere talon
#

like i said i can fix it for u

limber skiff
#

alrighttt

fossil inlet
limber skiff
#

goodluck

#

heres the current stuff for it

austere talon
#

just push 😭

limber skiff
#

lmaoo

austere talon
#

also sorry for being inactive

#

i will do more again

#

i had low motivation

limber skiff
#

if i push now everything will explode

#

but alright

austere talon
#

good blobcatcozy

#

i love explosions

limber skiff
#

goddd

austere talon
#

lmaooo

#

yeah thats a thing

#

ohh wait

limber skiff
#

nah thats fine

#

that onChange is only called when its saved from the settings UI

#

😭

austere talon
limber skiff
#

hold on

robust halo
charred monolithBOT
austere talon
#

the scrumper

limber skiff
#

okay its all exploded right now

robust halo
limber skiff
#

but yeah try to fix the typing I will do the rest

fossil inlet
robust halo
austere talon
robust halo
austere talon
#

not you you prick!!!

robust halo
#

<3

#

love you too

austere talon
austere talon
fossil inlet
#

vencord flakes when

austere talon
#

jumpscare

#

why does it check that for managing global

#

(its yarn global add but same thing with that)

limber skiff
#

ehh

charred monolithBOT
limber skiff
#

I will try to fix the typings too

#

it's kinda shit without them

#

okay I almost got it

#

I got it

#
O extends PluginSettingCustomDef ? IsUnknown<O["default"]> extends true ? any : O["default"] extends undefined ? any : O["default"] :
#

not sure if there is a better way @austere talon

austere talon
#

the infer Default

limber skiff
#

omit default

#

or set it to undefined

austere talon
limber skiff
#

well actually now if you set default to undefined it shouldnt default to any

#

okay yeah you are right

austere talon
limber skiff
#

I still had the old mindset

#

where if you set undefined it would default to empty array

#

which meant any[]

#

and actually that was wrong too

#

lmao 😭

charred monolithBOT
austere talon
#

i pushed that other thing

limber skiff
#

wait no

#

dont do that

austere talon
#

why

limber skiff
#

it doesnt need it

#

we arent going to use any of the Common

austere talon
#

yeah but it makes it not error in the settings code

#

and it adds onChange

#

but yeah it does add this junk

limber skiff
#

I already fixed it I think

austere talon
#

oh okay

limber skiff
#

lets not touch ignored activities

austere talon
#

then undo (but add onChange to custom type)

limber skiff
#

it uses array but it's fine

#

I dont wanna migrate its settings again

#

(it's like the third time)

limber skiff
austere talon
#

just change it to use the new custom type but still with array

limber skiff
#

as I said before onChange is called when you save from the UI

#

which never happens for this one

austere talon
#

oh yeah true

#

you can just subscribe manually

#

or settings.use

limber skiff
#

ya

austere talon
#

oh wait

limber skiff
#

unless we wanna fix it

austere talon
#

with the .0 paths

limber skiff
#

(which would be good ngl)

austere talon
#

settings.use wont work hmm

limber skiff
#

oh

#

does it need to be [0]

austere talon
#

no no i mean

#

you do settings.use(["myArray"])

#

but when it fires myArray.0 it wont match myArray (iirc)

charred monolithBOT
limber skiff
austere talon
#

we could add support for settings.use(["myArray.*"]) but that's kinda complicated

austere talon
limber skiff
#

I guess?

austere talon
#

or just only fire myArray but then you won't know what actually changed (but tbh there probably isn't a use case for this)

limber skiff
#

I can test it with ignored activities already

austere talon
#

sure yeah

limber skiff
#

works perfectly

austere talon
#

well

#

globalListener should be called either both times or only with the array path

#

because that's used for subscriptions over ipc

limber skiff
#

so both or only once?

austere talon
#

only with array path would be best

limber skiff
#

alright

austere talon
#

it sends new object and path over ipc

#

so you can subscribe to paths in main too

#

vesktop uses it a lot

charred monolithBOT
grave mangoBOT
# austere talon https://github.com/Vencord/Vesktop/blob/main/src/main/mainWindow.ts#L351-L365

mainWindow.ts: Lines 351-365

addVencordSettingsListener("macosTranslucency", enabled => {
    if (enabled) {
        win.setVibrancy("sidebar");
        win.setBackgroundColor("#ffffff00");
    } else {
        win.setVibrancy(null);
        win.setBackgroundColor("#ffffff");
    }
});

addSettingsListener("enableMenu", enabled => {
    win.setAutoHideMenuBar(enabled ?? false);
});

addSettingsListener("spellCheckLanguages", languages => initSpellCheckLanguages(win, languages));
austere talon
#

so useful

#

plugins could use it in their native.ts file

charred monolithBOT
limber skiff
#

oh ya forgot about that

austere talon
#

anyway lets change MessageTags to object instead of array then

#

makes much more sense :P

fossil inlet
#

DONT GOOGLE discord.sex
worst mistake of my life

austere talon
#

same for PinDms (it should be Record<UserId, Pin[]>)

austere talon
fossil inlet
#

is it down for anyone else?

austere talon
#

oh my god this fucking bot just reopened my closed alert

glass jasper
#

^^ i thought they updated the link

fossil inlet
#

@median rapids why does discord.sex 502 but docs.discord.sex work

austere talon
#

krill issue

limber skiff
#

pindms almost works completely

median rapids
limber skiff
#

help me debug why changing the category color doesn't work

charred monolithBOT
fossil inlet
median rapids
#

not my domain

austere talon
#

isnt this wrong

#

why return

#

shouldn't we intialise to empty array

#

and try to get rid of the forceUpdate spam

can we use settings.use instead?

limber skiff
#

its already initialized to empty

#

lol

limber skiff
#

better not touch it for now

fossil inlet
#

@austere talon what types do i give to props on the store that i have no idea what they are

limber skiff
#

also uhmm

fossil inlet
#

or do i just not type them

limber skiff
#

nvm

#

this isn't saving the settings at all

austere talon
#

yes

#

because youre using unrelated object

#

like i said that return is wrong

limber skiff
#

but we are proxying nested

austere talon
#

you're pushing to that random array

#

xD

#

plain array

limber skiff
#

oh

#

okay that makes sense

austere talon
#
currentUserCategories = settings.store.userBasedCategoryList[userId] ??= [];
#

hahaha

limber skiff
#

text replace delete button also doesn't work anymore...

austere talon
#

does splice actually work with the proxy

#

or does it filter

limber skiff
#

it was working before yes

austere talon
#

oh forceUpdate is this horror

#

terrifying

#

wait no

#

it's still ours

#

just change that patch to $self.settings.use(["settingName"])

#

then you can remove the forceUpdate calls everywhere

limber skiff
#

those won't work with the nested object changes...

#

the path doesn't match

austere talon
#

hmm i see

#

settings.use() then

#

it will subscribe to any changes

#

iirc

#

it's still better than forceUpdate spam

limber skiff
#

I think it should always fire the top level setting name path

austere talon
#

for any custom?

#

kinda hard to do that especially if it's multiple level nested object

#

we would have to add special handling to the proxy that checks if the current path is custom setting

limber skiff
#

ugh that's kinda shit

austere talon
#

we can still add that later

#

or maybe just implement that settings.use(["thing.*"])

#

woudn't be that hard

#

but no rush, we can merge without support for that for now

#

and add support later when we need it

austere talon
limber skiff
#

alright

#

I dont get why splice doesnt work anymore

austere talon
#

wouldn't be that hard, just need to make the path listeners some kind of tree structure

limber skiff
#

i'm so confused

austere talon
#

cause of splice?

#

did you push everything

limber skiff
#

it should fire a deleteProperty

#

but that's not happening now

#

is the array not a proxy...

austere talon
#

why did you go back to array proxy

limber skiff
limber skiff
austere talon
#

makeArrayProxy

limber skiff
#

that's the old implementation I have open in my stable client

#

which still works

austere talon
#

ohhhh

limber skiff
#

lol

#

weird...

austere talon
#

it should work fine

#

whats different this time

limber skiff
#

I dont know either

#

but deleteProperty isn't being fired for the splice

#

oh

#

I should have looked at the console haha

#

right, the array has proxies and it's trying to clone that

#

nvm we should not proxy nested!

#

completely forgot about that issue and there's no fixing

austere talon
#

hmmm yeah

austere talon
limber skiff
#

this iirc

austere talon
#

instead of [index][key] =

limber skiff
#

but like either way, if we proxy the return from the array they are gonna end up inside again I think

limber skiff
austere talon
#

i think the clone error can be fixed

#

not proxying array elements would be kinda bad

limber skiff
#

let me see

austere talon
#

ohhhh i see

#

the array is a reference

#

by proxying its children we put proxies in the plain object

limber skiff
#

yeah

austere talon
#

why doesnt this problem exist with objects think

#

oh i see the problem

#

let me show you

limber skiff
#

im not sure how im still putting a proxy in the array now tho

austere talon
#

i will show you

limber skiff
#

of course...

#

splice gets and then sets it to a lower index

austere talon
#

basically what splice(1, 1) does is

const oldElement = arr[2];
arr[1] = oldElement;
delete arr[2];
limber skiff
#

okay yeah there is no escaping this

austere talon
#

but that arr[2] call gets proxy

#

there is

limber skiff
#

how so?

austere talon
#

we need to make custom array functions

#

extend array

limber skiff
#

that's horrible...

austere talon
#

it's actually not that bad