#πŸ‘Ύ-core-development

1 messages Β· Page 165 of 1

brazen bone
#

Just rewrite the whole thing from scratch, no biggie

spark pivot
#

SettingTextComponent does the same thing lol

#

i feel like it's kinda unnecessary to make a whole css file for one class with one attribute

brazen bone
#

Then check if discord already has a class for that I guess

spark pivot
#

porbablyt

brazen bone
#

Would be surprised if it doesn't

#

I do agree that single-rule sheets does feel a bit silly, but classes do have benefits regarding theming

spark pivot
#

oh nvm found a css file that is related to the components im working in

#

i'll just put it in that

#

i just didnt want to make a whole new css file

charred monolithBOT
#

Tauri fixes none of the issues you have described, plus requires a significant amount of rewriting of Vesktop and potentially Vencord to accomplish.

Electron is incredibly heavy and eats RAM like an American eats, well, anything.

So does Tauri. Yes, it's reduced, but it's still using WebViews which are still going to be Chromium-based most of the time, so there isn't really much of an improvement.

annoying bugs such as the occasional error when opening the app without internet wo...

turbid hatch
#

??

#

this person obviously doesn't understand what tauri is

spark pivot
#

this person also thinks that you can just

- "electron": "^28.1.3",
+ "tauri": "whatever"
charred monolithBOT
austere talon
austere talon
charred monolithBOT
austere talon
#

the point is that inline styles are meh and awful for themes to override because they have to spam !important

#

v+ programming @bleak gyro

bleak gyro
#

thank you

uncut glen
#

vee its not ment to show the google in the plugin in the end we just made it as more engines to use

charred monolithBOT
bleak gyro
#

okay so an idea for third-party resources is (amazingly draw by moxxie)

#

we might not need the filters on the side since from what we've thought of there are only 2

uncut glen
#

im a grate artist and i can totally spell fr fr

lime stone
#

why did you star your own message

brazen bone
#

Why didn't you?

uncut glen
lime stone
#

vee will take down starboard machine again

charred monolithBOT
charred monolithBOT
charred monolithBOT
frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
#

Describe the bug
fcitx doesn't work, I can't write in any language other than english even if I run a vesktop with the relevant arguments.

To Reproduce
Steps to reproduce the behavior:

  1. install fcitx5
  2. check guide for electron apps
  3. run vesktop with /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=startvesktop dev.vencord.Vesktop --enable-features=UseOzonePlatform --ozone-platform=way...
#

Discord Account

flamehead83#9404

What happens when the bug or crash occurs?

When I try to open discord through a speed dial link on opera GX it gives me:
Cloud Settings
Could not synchronize settings from the cloud [TypeError: Failed to fetch].
But once I refresh the page then it goes away.
It only appears after clicking the speed dial link button that opens a new tab and then when I refresh in that tab it doesn't show the error.
![d](https://github.com/Vendicated/Vencord/asse...

rugged spire
#

explode please

charred monolithBOT
charred monolithBOT
#

If a channel has many message links, MessageLinkEmbeds may load many link embeds, even for messages that are not in the user's viewport. As of writing, the plugin loads embeds from the oldest message to the newest message, so the embeds for the most recent messages do not appear until all the old embeds are loaded.

Add an option to only load link embeds in the user's viewport to work around this issue. This will result in less API requests and faster loading for channels with many message ...

charred monolithBOT
#

Before this commit, Queue#push was using an constant time array push, while Queue#unshift - and most importantly - Queue#next were using O(n) array (un)shifts.
However, as both push() and unshift() called run(), which called next() - all methods were O(n).

Swap the time complexity of these methods by reversing the order of the underlying array.
Queue#unshift is now constant time, and Queue#push is now O(n) - which is the same as before, as it previously called an O(n)...

#

Before this commit, MessageLinkEmbeds loaded embeds from oldest to newest. This was especially noticeable in channels with many message links - the most recent embeds would only load after all the old embeds were loaded first.

Additionally, if a channel had many message links, switching to another channel would prevent message link embeds from loading in the newly switched channel until the old channel's embeds are loaded first.

Swap the Queue#push with Queue#unshift to simulate a F...

livid heath
#

whar

#

are these 4 prs just for one thing

charred monolithBOT
brazen bone
#

Very nice branch names, mcpower:push-znykrnwkpypw mcpower:push-ymqkwqwlyrmr mcpower:push-quorwosyorxo mcpower:push-otqpxxlwqnuk

shy veldt
#

yeah

charred monolithBOT
austere talon
#

why make duplicate prs

charred monolithBOT
#

Specifically, it will result in less API requests and faster loading for channels. This is independent of the ordering change, but I agree that the main issue - that it takes a while to load recent embeds - is fixed by either commit.

The (default-off) option was added specifically due to the scrolling issue you mentioned. I personally don't mind this and would rather have better performance / less API requests, but I understand that the option may not be useful to most people, and is proba...

brazen bone
#

Okay that's a pretty weird bug in FastMenu/BetterSettings... Why does changing the name of a role make the left sidebar disappear

charred monolithBOT
brazen bone
#

Cause found... Attempting to rectify

brazen bone
#

Right, fixed. What was I thinking when I wrote that patch like that

charred monolithBOT
bleak gyro
#

How could I improve this?

#

ill probably add something like "Copy this content and put it in your Quick CSS file"

crude raptor
#

would there be any way to have a simple button to auto-append it to your quickcss?

bleak gyro
#

That could be a great feature

brazen bone
#

Alternatively, have a link to the raw css that you can put in the themes list (and maybe a way to automatically add it there)

charred monolithBOT
austere talon
#

i have a cool idea for fakenitro maybe @limber skiff

#

it could let you use emotes from anywhere

#

like you just copy paste an emote and it sends it even if youre not in that server

#

you can already do that by copying the emote link when someone else sends it but it doesnt get the fakenitrogoodies like name

crude raptor
#

right clicking an emoji or /emojis/ embed could have an option to store the link locally as a pseudo-emote-server

limber skiff
austere talon
#

what info do you need other than name and id

#

🫨

limber skiff
#

you are right, none actually

austere talon
#

the emoji code is everything thats needed

limber skiff
#

so you mean like our own emote browser

austere talon
#

noo

limber skiff
#

okay I dont quite get it

austere talon
#

make this work

crude raptor
#

it likes its idea :3

charred monolithBOT
limber skiff
#

I see

#

so using the format for emojis like <...>

crude raptor
#

vee's idea is basically just let fakenitro use emojis that other people have posted, not just from your servers

#

it thinks itd be cool if you could also store a local list of emoji links and names by right clicking

limber skiff
#

Yes I know that

#

can someone post a emoji link for me

crude raptor
limber skiff
#

oh yeah it's very doable

#

emoji links don't even need the guild id

#

I think we just need to modify the preSend a bit?

austere talon
crude raptor
#

idk saves making a server

limber skiff
#

@austere talon btw if you plan or merging something, merge to dev2 since it already has commits we need to merge too

austere talon
#

merge dev2 into dev1

limber skiff
#

sure

austere talon
#

🐝

charred monolithBOT
#

627ee19 Modify how wreq is grab; beforeWebpackInit API;... - Nuckyz
76ea0d2 make reporter log normally if level is not erro... - Nuckyz
0f402ea ClientTherme: do not use lodash on start method - Nuckyz
11defb1 oversights and cleanups for latest webpack rela... - Nuckyz
b3fa577 Fix hyperLinkText setting for fake stickers - Nuckyz

austere talon
#

oh not those

limber skiff
#

oh...

#

why?

austere talon
#

not the webpack changes

limber skiff
#

they work fine

#

may prevent us future issues

#

specially reporter related

#

let me reset to previous commit for now

#

wtff lma

#

how did I not notice that

charred monolithBOT
austere talon
brazen bone
#

Isn't it easier to use like an interactive rebase for that

charred monolithBOT
austere talon
#

please format your commit messages like PluginName: message

limber skiff
#

ye

austere talon
#

you should rebase your webpack changes in a different branch and make them a single commit

limber skiff
#

aight

austere talon
#

i need to properly look at them first

charred monolithBOT
limber skiff
#

okay there

#

I'm so inconsistent with commit messages it's crazy

austere talon
#

that commit message is bad 😭

#

use extended message

limber skiff
#

😭

#

okay okay I change later

austere talon
#
Webpack: Refactor for future proofing

- Rework how webpackRequire is grabbed
- Add beforeWebpackInit and factory listener apis
- Future proof extractAndLoadChunks & reporter
charred monolithBOT
charred monolithBOT
charred monolithBOT
#

Summary

While Server Home was deprecated client-side, the UI for it is still there and the backend will probably continue to exist for the foreseeable future. This plugin makes it functional again.

Issues

  • Message history retrieval is broken. It repeatedly refetches the same few message contexts, seemingly not caching them.
  • The tab doesn't show up if the Server Guide tab is visible, as Server Guide replaces Server Home. Not sure if this is easily fixable.

![image](https://...

median rapids
#

@limber skiff as promised meowlien

#

i have no idea how to fix the message history thing though

limber skiff
#

nice

#

I will try to fix the issues

median rapids
charred monolithBOT
charred monolithBOT
spark pivot
#

i just thought of something
what if there was a button in css code blocks that just adds the css to your quickcss

brazen bone
#

So you mean like, I write ```css

  • { transform: rotate(1deg) !important; }
#

That'd be cool

spark pivot
#

yeah

austere talon
#

someone prd that before

#

but it somehow didnt work

#

need to revisit

charred monolithBOT
crude hearth
#

DOLFIES HOLY SHEET

#

wait

#

dolfies pred before too

#

I always thought you as a person that is too busy with other stuff so you couldnt pr ever

median rapids
charred monolithBOT
#

yes that sounds good, about what i had in mind!

try having a style similar to https://discord.com: basically screenshots and for each screenshot a short headline and extended description

a few of those to highlight the main features

on the top there should also be a short headline introducing vesktop and a download button that jumps you to the download section

Good suggestions! I want to also try to keep design consistent with existing pages like home page and plugin...

charred monolithBOT
frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

charred monolithBOT
charred monolithBOT
limber skiff
#

you have to see this working ven

#

lets see how fast muahahaha

charred monolithBOT
frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

@austere talon

charred monolithBOT
median rapids
charred monolithBOT
limber skiff
median rapids
#

😨

limber skiff
#

true true

#

the perfect commit to brick vencord

median rapids
#

just force push to main

#

man i love how all the app command search stuff is still in the client

#

despite that backend service being deactivated

rugged spire
#

what fucking branch are y'all even supppsed to base your new stuff on

limber skiff
#

how do you even find that stuff

median rapids
limber skiff
#

yeah but I mean why are you looking into that?

median rapids
#

oh ran into it accidentally lol

limber skiff
#

I see

austere talon
glass jasper
rugged spire
charred monolithBOT
median rapids
#

oh wait i lied

#

that doesnt send context properties for some reason 😭

rugged spire
#

Slight Mistake

austere talon
#

that plugin won't be merged anyway

median rapids
austere talon
#

too niche / gimmicky

#

like just use xmpp/matrix if u want encryption

rugged spire
#

let me guess, hacky

median rapids
#

yeah i don't think this is a concept that works very well lol

austere talon
#

sending encrypted text files on discord is kinda insane

#

and you can't prevent discord from being able to mitm

rugged spire
#

@jagged reef userplugin time

median rapids
#

just hop in a vc

#

they're e2ee now

median rapids
#

(unless a bot or someone with an older client joins)

austere talon
median rapids
#

oh actually did that even roll out lol

glass jasper
austere talon
#

but even then you would never be able to prevent discord from accessing the key if fhey really wanted

median rapids
brazen bone
#

I bet shoulder surfing is a bigger security issue than mitming

rugged spire
#

The shit I say on Discord would horrify people IRL

brazen bone
#

Oh don't worry I'm sure it horrifies people online too

charred monolithBOT
charred monolithBOT
#

how do you even encrypt the messages?

export const encryptData = async (pemPublicKey, data) => {
    const publicKey = await importPemPublicKey(pemPublicKey);

    const chunkSize = 446;

    const encryptedChunks: any[] = [];
    const encoder = new TextEncoder();

    for (let i = 0; i < data.length; i += chunkSize) {
        const chunk = await data.substring(i, i + chunkSize);
        const encryptedChunk = await crypto.subtle.encrypt(
            {
               ...
crude hearth
#

You told me to make E2ee chat plugin

crude hearth
charred monolithBOT
#

I think this is not a Vesktop bug, actually, it's just Hyprland being very shoddy with IMEs in Chromium apps. I think I found a fix for this at some point, but after every problem disappeared when I switched back to KDE, I seriously doubt it has anything to do with the apps and everything to do with how Hyprland implements the various text input protocols

rugged spire
# charred monolith

HEARTWARMING: User discovers their issue is unrelated to the project by themselves

jagged cloak
#

lol

crude hearth
#

hyprland users:

jagged cloak
#

hyprland users are an even smaller subset of people than arch users

crude hearth
#

I am not fatphobic but hyprland users are really something else

limber skiff
#

@median rapids it's actually so shit to fix the home issue with server guide

#

it's a single boolean, but adding a second thing to the channel list for the home/server guide to appear at the same time is horrible

#

the fact they share the same route πŸ’€

charred monolithBOT
brazen bone
#

Add a new path to the router blobcatcool

limber skiff
#

it's not easy

#

need to patch a thousand of places to not break home or server guide

rugged spire
#

channel tabs if it was epic

rugged spire
#

channel tabs will never get merged will it

#

git made my head explod

limber skiff
#

@median rapids this took more than an hour but I fixed request spam for the home

#

turns out when LOAD_MESSAGES_SUCCESS is dispatched, if isBefore or isAfter are both false, it resets the cache

#

and the focusMessage function which the home uses fetches messages around an id, but since it tries more than one message in the same channel it would reset and clear the messages previously fetched

#

the fix... add a before which is the same id as the message πŸ’€

charred monolithBOT
#

if you read the console output you shared, you'll notice that it's not actually passing the flag you --enable-wayland-ime flag you specified.

this might be an issue specific to the flatpak wrapper script, where it's not correctly forwarding user flags

try on a non flatpak version of vesktop to see if it works there

austere talon
#

this is like the 20th complaint about listen along not working

rugged spire
#

?????

#

oh

austere talon
#

you'd think people would at least put in the minimum effort of testing if the issue also happens on stock discord but no

rugged spire
#

this is fine

#

i just had an awful fucking idea

#

holy fuck the existing code is already just as fucked up as my idea

#

cool vencord facts: someone has already made a hackier plugin than you

#

shit is fucked

limber skiff
#

what is?

rugged spire
#

my attempt to inject channeltabs instead of the titlebar and update it properly

limber skiff
#

I mean dont you just need to change where it patches

rugged spire
#

nop

#

it takes in context to use to update itself

#

fuck it

#

external store time

limber skiff
#

just useStateFromStore with SelectedChannelStore

charred monolithBOT
rugged spire
#

husk still fucked up

charred monolithBOT
rugged spire
rugged spire
lime stone
rugged spire
#

should've listened

rugged spire
lime stone
#

linux doesn't have any titlebar though?

#

i don't think mac does either nvm, there's probably a drag area

rugged spire
#

it does a check even if there is no titlebar applied in the end

charred monolithBOT
rugged spire
#

please rate my custom titlebar

rugged spire
#

Good luck installing it

brazen bone
#

Change the background to some sick flames and it'll be 33% more rad

median rapids
#

maybe a setting to just outright replace server guide with home is better

#

or a toggle when you right click

rugged spire
limber skiff
#

I think it uses a hook so we can change the value and the button will update

#

but if it doesn't we can make the function do

rugged spire
rugged spire
limber skiff
#

@median rapids we can add a context menu check mark to force useCanSeeOnboardingHome to return false

#

it's a hook so if we add a state and update it accordingly, server guide will turn into home and vice versa reactively

charred monolithBOT
limber skiff
#

seems doable, but I wont do it rn cuz sleep

lime stone
#

what happened to the styling :(

rugged spire
lime stone
#

channeltabs

rugged spire
lime stone
#

i made it look nice but since then it has become very inconsistent

charred monolithBOT
charred monolithBOT
#

I think this is not a Vesktop bug, actually, it's just Hyprland being very shoddy with IMEs in Chromium apps. I think I found a fix for this at some point, but after every problem disappeared when I switched back to KDE, I seriously doubt it has anything to do with the apps and everything to do with how Hyprland implements the various text input protocols

EDIT: See more about how to fix this issue at https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland, though your mileage may dramat...

charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
#

Describe the bug
when an app makes a new audio channel, vesktop does not always pick it up. this is most obvious when playing back videos in a web browser, like youtube, as web browsers make a new audio channel every time a video is played, and then delete their own channel when the video stops playing (although this behavior in itself is inconsistent, so it might take a few tries to reproduce the bug)

To Reproduce

  1. start a screenshare on vesktop with audio
  2. watch a youtube ...
charred monolithBOT
#

Describe the bug
when an app makes a new audio channel, vesktop does not always pick it up. this is most obvious when playing back videos in a web browser, like youtube, as web browsers make a new audio channel every time a video is played, and then delete their own channel when the video stops playing (although this behavior in itself is inconsistent, so it might take a few tries to reproduce the bug)

To Reproduce

  1. start a screenshare on vesktop with "entire system" audio
  2. ...
glass jasper
charred monolithBOT
charred monolithBOT
charred monolithBOT
#

Summary

This should allow you to change what popups get removed with AlwaysTrust, defaulting to all, before you would need to have both popups hidden. This addon allows you to choose which popup(s) to remove, instead of all of them.

Warning

This is my first experience with TypeScript, please check my work before merging. I have checked this with my own Vencord installation, so it should work.

charred monolithBOT
frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

charred monolithBOT
brazen bone
#

I keep seeing terms like upsell and sku in the code. I assume upsell is related to nitro shilling, but wtf is a sku

limber skiff
#

related to decorations

#

it's something to do with their identification

#

that's all I know

brazen bone
limber skiff
#

oh

#

yeah decorations use them too

brazen bone
#

So marketing stuff, nothing to care about

limber skiff
#

upsells is related to nitro ads maybe?

brazen bone
#

Well, I'd assume the term refers to selling something

limber skiff
#

yeah makes sense

austere talon
#

upsell is basically just nitro ads yeah

brazen bone
#

So eliminate on sight but otherwise not worth caring about

austere talon
#

upselling is a sales technique where a seller invites the customer to purchase more expensive items, upgrades, or other add-ons to generate more revenue. while it usually involves marketing more profitable services or products,[1] it can be simply exposing the customer to other options that were perhaps not considered

#

so like when you open someone else's profile and it says "wow such a shiny banner don't you want one too?"

#

that's a nitro upsell

rugged spire
median rapids
#

they were first used for the game store

#

then billing was rebuilt untop of them

#

then server subs was hacked into them

#

then server products

#

then app subs

#

then avatar decos

#

then profile effects

#

etc...

limber skiff
#

yeah it makes sense from the docs

#

I mentioned decorations cuz I reviewed decor so I saw them being used

charred monolithBOT
charred monolithBOT
charred monolithBOT
still wasp
charred monolithBOT
rugged spire
#

i wonder what my custom channel tabs looks like on my desktop

#

channel taaaaaaaaaaaaaaaaaaabs

rugged spire
#

Refactor shit code time

limber skiff
#

alien jumpscare

#

tell me if everything is good and I can merge

still wasp
#

I'M LAZY

#

πŸ’€

limber skiff
#

what was the bug?

still wasp
#

I couldn't figure out how to re render the component lmao

limber skiff
#

hmm

#

it's prob an issue with how the Datastore is async

#

I don't know how you did, but I recommend having a cache and use it to render the components

#

so you always update the cache and later update the datastore async

still wasp
#

Oh i didn't think of that

#

NEVERMIND I AM AN IDIOT yeah

#

I was calling the update function before the sticker was unblocked NAH

limber skiff
#

lol

still wasp
#

Works great now yippee

limber skiff
rugged spire
#

This is absolutely horrible so far btw

#

yet it looks so clean

charred monolithBOT
limber skiff
#

in fact, most of the time you will see me talking here @rugged spire

#

lol

rugged spire
#

very true

limber skiff
#

yeah I help in support sometimes too

rugged spire
#

sometimes

brazen bone
#

That place is too braindead for me

rugged spire
#

REAL

#

I like to call it the daycare channel

odd heath
#

Yeah occasionally ill be in support too but rarely

#

I've gotten enough damage from support channels

rugged spire
#

Pro tip: Copy random bullshit

charred monolithBOT
brazen bone
#

Well yeah that's why discord's code is there

#

But why the leading comma format

#

It's ugly

rugged spire
brazen bone
#

Consider rewriting your code into something human readable after copypasting

#

Got a really nasty case of comma operator there

rugged spire
#

Badge Obtained

charred monolithBOT
charred monolithBOT
median rapids
#

hm the jumping to message when clicking is still slightly broken

#

but it works if you click if a couple times 😭

charred monolithBOT
charred monolithBOT
limber skiff
charred monolithBOT
brazen bone
#

Now that's how you report a bug

#

Find a year-old merged PR and provide no relevant details

crude raptor
#

true

lime stone
#

what commit did you base on

rugged spire
lime stone
#

so you reverted the style changes?

#

that's how they looked before my commit to make them firefox style xd

#

firefox style just makes more sense because it's impossible to make them look attached due to the multiple colours

#

looks so weird

#

but at least the height is back to being consistent

charred monolithBOT
charred monolithBOT
charred monolithBOT
rugged spire
lime stone
#

since then tabs started having inconsistent height :(

#

but in that commit i changed the tabs to be rounded on all sides

rugged spire
#

How much of ChannelTabs was removed and forgotten about since then husk husk husk

lime stone
#

wdym

rugged spire
#

Native discord experiment favourites support got completely removed in favour of the favourites bar

#

Leading to broken display when in the favourites experiment

#

Take your time with your long message

lime stone
#

it's not long (ocd moment)

rugged spire
#

That's also fine

lime stone
#

xd

#

i'm confused whether you're on an old commit or reverted the tab changes

#

oh i think you said you did

rugged spire
#

I reworked it to effectively make the button hitbox bigger

#

The tab style could be a setting

lime stone
#

well, i thought firefox style was a more sane default - and you can use css

#

doesn't middle click close tabs anyway

#

other tweaks look cool though

rugged spire
lime stone
#

ohh

rugged spire
#

Each tab is now just a button itself instead of a div containing the button to activate it

lime stone
#

but what's wrong with it being a tiny bit shorter

#

bd plugin also does this

rugged spire
#

It's visually no different the way I have styled it, but you can FEEL it.

In other words, you can throw your cursor to the top and actually click the tab

verbal pumice
lime stone
#

i mainly use gnome and macos so throwing cursor to top places your mouse on the time etc. xd

rugged spire
lime stone
#

i mean change the hitbox without appearance

#

like, firefox recognises it from here

charred monolithBOT
median rapids
#

sounds good then ig

charred monolithBOT
#

Describe the bug

There is no button on macOS to exit fullscreen once entered. By this, I mean there is no button in the top left to get out of fullscreen once entered.

To Reproduce

Steps to reproduce the behavior:

  1. Open Vesktop on macOS
  2. Click on the green button in the top left
  3. You will be in fullscreen, but will not be able to get out of it.

Expected behavior

There should be a button to exit fullscreen like most macOS apps.

Screenshots

![image]...

#

Describe the bug

I noticed that you cannot mark folders as read on Vesktop, compared to the official Discord app where marking folders as read works.

To Reproduce

Steps to reproduce the behavior:

  1. Make sure you have a channel that you have not read and is in a folder
  2. Right click on that folder
  3. You will notice that the 'Mark Folder As Read' button is greyed out when it should be clickable

Expected behavior

The 'Mark Folder As Read' button should be clickab...

charred monolithBOT
charred monolithBOT
rugged spire
#

o o o o o o o i am answering stupid issues

charred monolithBOT
rugged spire
#

thank you vee

lime stone
rugged spire
#

probably lmao

lime stone
#

the folder treats muted guilds as read

charred monolithBOT
limber skiff
#

@austere talon any idea how to fix states in our context menu patches not updating the components? I think it has something to do with the context we call the patches, like if they arent in react or something

#

you know more than me about react so perhaps you have an idea

austere talon
#

or show a code example

limber skiff
#

yeah

#

say I have this patch

#

if I click the checkmark it doesnt re-render the checkmark as checked

austere talon
#

well the way the api works the func is only called once per identical children array

limber skiff
#

oh

#

it's prob because of it then πŸ’€

austere talon
#

you'd need to not use the callback

#

and even then it might not work

#

at this point it might be a good idea to patch the menu api to add our own menu item component so we can use a proper component with state and not have to do this cursed workaround

brazen bone
#

You could add a custom component to the menu that wraps a MenuCheckboxItem and has hooks

limber skiff
#

this is shit

#

maybe there is a better place to patch

#

hmmm but I see what yall mean

#

that could work prob yeah

#

I'll experiment later

brazen bone
#

On the other hand, the menu api only allows a few specific component types, so that probably wouldn't work...

austere talon
#

that's what i mean by patching it

#

to add our own component to it

#

but also i think there's a way to use a custom react component in a menu

brazen bone
#

There is MenuControlItem

#

...Why does it use .reduce instead of .flatmap

#

Discord's menu code, that is

charred monolithBOT
limber skiff
#

I forgot the image

#

πŸ’€

brazen bone
#

I may be mistaken, but isn't the whole problem with the context menu stuff that it does _patchContextMenu(props); rather than props = _patchContextMenu(props);?

limber skiff
#

how so?

brazen bone
#

Mutating the props makes rendering impure, which requires the menu hooks to be run only once, which makes react hooks not work

limber skiff
#

does anyone remember where the assets issue is

#

I forgot

brazen bone
#

If you do not mutate the props, this would allow the menu hooks to be run as part of the regular rendering cycle, including react hooks

limber skiff
#

they already run more than once

#

however our callback to push items to the children only runs once

#

because otherwise the menu would get 1000000 copies of the same button

brazen bone
#

Exactly

#

And if you did not mutate the props, that would not happen

limber skiff
#

If you say so

#

I'm not that much of an expert on react to know that deep

#

but if that does fix the problem, then thanks a lot

#

okay I cannot find the assets place

brazen bone
#

I'll have to experiment a bit to know for sure, but I'm pretty sure that is at least part of the issue

brazen bone
limber skiff
#

pull from dev and modify resurrect home

#

it's pretty easy

#

you have to remove ContextMenuApi.closeContextMenu();btw

#

that's the hacky fix for it not updating

#

ideally the menu should re-render a billion times and our old items disappear

#

@brazen bone is that what you think it should fix?

brazen bone
#

Yes

limber skiff
#

okay don't forget to push the child in the first callback instead of the second

#

because the second only runs once

#

just return nothing

#

if that works we can remove all of that anyways

brazen bone
#

Though an issue is that many of the patches mutate children deeply, so a shallow clone won't be enough

limber skiff
#

don't worry about it

#

use lodash deep clone

#

only 1 context menu can be open at once anyways

brazen bone
#

I worry that that might in some cases cause a too deep clone

#

I'll look into that

brazen bone
#

Yep, this seems to work; the menu item is not duplicated and the hook works

limber skiff
#

how did you do?

brazen bone
#

Pretty much just inserting a deepClone on the props

#

Though I don't like that; it might break things if some menuitem is passed a ref or something

limber skiff
#

hm

#

I think it's fine for now

#

easier than wrapping components

#

how does it perform on user settings context menu

#

that's the biggest I think

brazen bone
#

I don't notice any slowdown

limber skiff
#

nice

#

can you commit and send link? I wanna see

brazen bone
#

Sure

#

If things do need to be done once in the menus, I think that can be done with a plain ol' useLayout or similar

limber skiff
#

changing the second patch is needed?

brazen bone
#

Without that, lodash clones the Arguments object into { 0: a, 1: b } instead of [a, b]

limber skiff
#

horror

brazen bone
#

Won't be necessary once I make a more fine-grained cloning I think

#

There we go, this is much more selective about what it clones

#

Actually on second thought, if something edits a menu in the once part, this will make those edits ineffectual

austere talon
#

maybe use window.structuredClone instead of lodash if its available

#

likely a lot faster

brazen bone
#

That won't work, mdn says structuredClone throws errors on functions

#

And those menu items often contain callbacks

limber skiff
#

the only reason it exists is because we were getting duplicates

brazen bone
#

Yeah but someone would have to go around and clean it up everywhere

limber skiff
#

yes

brazen bone
#

Actually wasn't there talk of making a ```js
contextMenuPatches: {
"guild-context"(children, props) { ... }
},

limber skiff
#

that's no issue

frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

I can do it if you don't want to

frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

austere talon
#

unless its like the settings api

brazen bone
#

Yeah options→settings is a bit overdue

austere talon
#

so itd just kinda be a waste of time

brazen bone
#

Perhaps

#

I haven't really looked into how they differ, I just know that any new plugins should use settings

limber skiff
#

they just have strong typings

#

and the easy use of settings.use

austere talon
#

its the same, in fact even the new settings api still uses the options field internally

its just strongly typed instead of typed as any like nookies said, and also more convenient and shorter

brazen bone
#

I'm not sure how the contextMenuPatches: api would deal with addGlobalContextMenuPatch, but that one doesn't seem to ever be used anyway so

austere talon
#

also you don't have to repeat your plugin name everywhere (which leads to easy bugs if you try to rename the plugin)

austere talon
brazen bone
#

Or just "*"() {}

austere talon
#

true

#

but also yeah that api isnt that useful, i cant think of a usecase for it xd

#

other than debugging ig?

limber skiff
#

I mean no need to remove it though

brazen bone
#

In most cases it'd probably be more efficient to just patch the Menu component

austere talon
#

in console

#

but other than that i cant think of much

brazen bone
#

I'm gonna try making the contextMenuPatches: api

#

Is it just iterate over all plugins or is there some more performant way to do it?

austere talon
#

we already iterate over all the plugins anyway

#

check how the flux prop is implemented :p

#

and replicate

brazen bone
#

Yeah I figure flux triggers way more often than menu, so if it's fast enough for that

austere talon
#

or rather change that code to also do the other one

#

uh what

#

do you mean whenever a context menu is opened it checks all plugins

#

dont do that

#

just keep the old api and make the property a wrapper around it

brazen bone
#

That makes more sense

#

Do you prefer contextMenuPatches: or contextMenus: or something else?

austere talon
#

actually im not really happy with the current flux: implementation

#

because its done inside startPlugin, which is called very late

grave mangoBOT
# austere talon https://github.com/Vendicated/Vencord/blob/main/src/plugins/index.ts#L121-L158

**index.ts: **Lines 121-158

export const startPlugin = traceFunction("startPlugin", function startPlugin(p: Plugin) {
    const { name, commands, flux } = p;

    if (p.start) {
        logger.info("Starting plugin", name);
        if (p.started) {
            logger.warn(`${name} already started`);
            return false;
        }
        try {
            p.start();
            p.started = true;
        } catch (e) {
            logger.error(`Failed to start ${name}\n`, e);
            return false;
        }
    }

    if (commands?.length) {
        logger.info("Registering commands of plugin", name);
        for (const cmd of commands) {
            try {
                registerCommand(cmd, name);
            } catch (e) {
                logger.error(`Failed to register command ${cmd.name}\n`, e);
                return false;
            }
        }
    }

    if (flux) {
        for (const event in flux) {
            FluxDispatcher.subscribe(event as FluxEvents, flux[event]);
        }
    }

    return true;
}, p => `startPlugin ${p.name}`);
austere talon
#

it would likely be good to refactor it to add the necessary subscriptions immediately

#

but thats a task for a separate pr

brazen bone
#

Sounds fine for commands and menus, but yeah for flux it'd be good to have it immediately

limber skiff
#

we could just add the flux listeners when it's waitFor callback is ran

#

the same place where it sets the export

charred monolithBOT
limber skiff
#

that's too hacky or not? what do you think ven

brazen bone
#

Remember to also add the listeners when the plugin is enabled from the menu

limber skiff
#

true

brazen bone
#

This also makes a good opportunity to fix a longstanding bug in ViewRaw where the plugin doesn't unregister its context menus properly when disabled

#

...Oh I'm dumb

#

The check for whether the once-callback has been run happens after cloning the props, so it's run always

charred monolithBOT
limber skiff
#

but remove it

brazen bone
#

Feels silly to remove the check separately from actually removing the callback, which I won't do until I've removed all the () => () => from everywhere

limber skiff
#

oh yaya

brazen bone
#

Do you think it's better to have ```js
contextMenus: {
"message": messageContextMenuPatch,
}

limber skiff
#

like that is fine

#

but this is good cuz you can type the function

#

and we don't need to use a const to type anymore

brazen bone
#

Also keeps the "header block" of the plugin short

#

Which is nice

brazen bone
#

I'll have to move some of the patch definitions to above the plugin definition so it's in scope

#

That produces slightly bigger diffs than I'd quite like, but no way to avoid it

austere talon
#

wdym

brazen bone
#

There was one case where export default definePlugin() was before const ctxMenuPatch: NavContextMenuPatchCallback so I had to move that to be before

charred monolithBOT
glass jasper
median rapids
#

yorp

#

annoyed me so i fix

brazen bone
#

All plugins migrated

#

I'll put up a pr, but then I'm going to bed

limber skiff
charred monolithBOT
#

Clones the context menu props so that they are not mutated (React doesn't like it when you mutate stuff). This makes it safe to run context menu patches at every rerender, so the thing with returning a closure which is run once is removed.[^useEffect] Additionally, since I had to edit all plugins that use context menu patches, I took the opportunity to add a contextMenus key to the plugin definition, and made all plugins use that.

charred monolithBOT
charred monolithBOT
charred monolithBOT
limber skiff
#

@brazen bone what's the reason for this check if it's a MenuControlItem, and why not for MenuItem too?

#

that's my only question, the rest looks good and I did some cleanups already

brazen bone
limber skiff
#

I don't understand

charred monolithBOT
charred monolithBOT
charred monolithBOT
brazen bone
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
#
  • Rework how webpack require is grabbed:
    • Instead of trying to push a fake module to webpackChunkdiscord_app everytime it is value is defined again, it now monkey patches the init callback Discord runs to initialize the app after all needed chunks are loaded

    • This lets us more reliably get the webpack require as soon as we can, but of course not too soon in a point where needed properties would not be yet defined.

  • Add beforeWebpackInit API:
    • By monkey patching the init call...
limber skiff
#

wall of text jumpscare

limber skiff
#

shut up github

#

hopefully that makes it better for you Ven

charred monolithBOT
limber skiff
#

it looks even better

#

because the menu no longer closes

charred monolithBOT
charred monolithBOT
limber skiff
#

I would say this is a perfect pr to explode

#

wtf

#

Discord Development went back to Electron 22

limber skiff
brazen bone
#

Because blindly cloning stuff can have weird side effects, like messing up arguments objects and probably breaking react refs

#

I can't say for certain that anything would indeed break, but I'd rather play it safe and only clone what's necessary

#

And as mentioned, it's not like window.structuredClone would be of use since that doesn't work on functions, so it's either a custom function or lodash

limber skiff
#

okay then

#

we also need to do this

#

it's likely another case where we do not know what it can be

#

and the reason for the second predicate

#

well actually the third is not needed

brazen bone
#

If we want to be very faithful to discord's code it'd be ```js
if (obj.type === Menu.MenuGroup || (obj.type === Menu.MenuItem && obj.props.render == null)) {
// clone children
}

limber skiff
#

MenuItem doesnt have children anyways

brazen bone
#

It does though, that's how you make submenus

limber skiff
#

I mean

#

when it has render it doesnt have children

#

so we dont need the predicate

#

I think this works, we can change if it causes issues but I doubt it will

#

as I said the third predicate is not needed because it render is present, then children isnt

brazen bone
#

I guess (type === MenuGroup || type === MenuItem) && children would be enough

limber skiff
#

hm okay

brazen bone
#

But what's going on with this module (the one where MenuControlItem and all that are supposedly defined) ```js
function (e, t, n) {
"use strict";
function i() { return null; }
function r(e) { return null; }
function o(e) { return null; }
function a(e) { return null; }
function s(e) { return null; }
function _(e) { return null; }
n.r(t),
n.d(t, {
MenuCheckboxItem: function () { return a; },
MenuControlItem: function () { return _; },
MenuGroup: function () { return r; },
MenuItem: function () { return o; },
MenuRadioItem: function () { return s; },
MenuSeparator: function () { return i; },
});
};

#

...I guess those aren't real components, since they just check for identity of the type

#
Β» Vencord.Webpack.Common.Menu.MenuCheckboxItem.toString()
function a(e){return null}
``` Yep those are the real definitions, fun
limber skiff
#

yeah

#

I was so confused too

#

they are just for the type lol

brazen bone
#

I sure wonder why they made it in such a convoluted way

limber skiff
#

it's sad that we have to deal with this cloning stuff

#

but it's honestly the least hacky way we can have a api which still gets access to the original context menu props

#

hmm actually

brazen bone
#

The only alternative I can see is making plugins manually patch each individual menu they need and that's bad

limber skiff
#

there is another way but it's complicated

#

need to patch openContextMenu but also need a way for the contextMenuApiArguments to reach it

#

and we would need to build our menu items manually too

#

this is okay for now

limber skiff
#

for some reason in some context menu items are being duplicated

#

I'm gonna keep this

#

seem to work for all

austere talon
#

btw it was even funnier back when we had mangled exports so there was no way of knowing which function is which menu item

#

i wrote a cursed patch that properly named all of them

#

and nookies and i together wrote a really cursed dynamic patch generator that found all menu api usages in other files based on a minified name

limber skiff
#

I loved that

#

it was so cursed but incredibly fast

grave mangoBOT
# austere talon https://github.com/Vendicated/Vencord/blob/1764206e19cfdb7f2a7e69497ab017853e7c9...

**apiMenuItemDeobfuscator.ts: **Lines 41-77

{
    find: '"Menu API',
    replacement: {
        match: /function.{0,80}type===(.{1,3})\..{1,3}\).{0,50}navigable:.+?Menu API/s,
        replace: (m, mod) => {
            let nicenNames = "";
            const redefines = [] as string[];
            // if (t.type === m.MenuItem)
            const typeCheckRe = /\(.{1,3}\.type===(.{1,5})\)/g;
            // push({type:"item"})
            const pushTypeRe = /type:"(\w+)"/g;

            let typeMatch: RegExpExecArray | null;
            // for each if (t.type === ...)
            while ((typeMatch = typeCheckRe.exec(m)) !== null) {
                // extract the current menu item
                const item = typeMatch[1];
                // Set the starting index of the second regex to that of the first to start
                // matching from after the if
                pushTypeRe.lastIndex = typeCheckRe.lastIndex;
                // extract the first type: "..."
                const type = pushTypeRe.exec(m)?.[1];
                if (type && type in nameMap) {
                    const name = nameMap[type];
                    nicenNames += `Object.defineProperty(${item},"name",{value:"${name}"});`;
                    redefines.push(`${name}:${item}`);
                }
            }
            if (redefines.length < 6) {
                console.warn("[ApiMenuItemDeobfuscator] Expected to at least remap 6 items, only remapped", redefines.length);
            }

            // Merge all our redefines with the actual module
            return `${nicenNames}Object.assign(${mod},{${redefines.join(",")}});${m}`;
        },
    },
},
austere talon
limber skiff
#

this was when we removed the curse

#

in fact the day I made that dynamic patch was when I learned about proxies

brazen bone
#

Exports having names is quite convenient

#

Discord could make this much harder if they wanted

austere talon
#

that's how it was before

#

we didn't have any export names

limber skiff
#

it wasn't that worse

austere talon
#

it was fine yeah

limber skiff
#

you just had to guess more

austere talon
limber skiff
#

like hmmmm what does this function do

austere talon
#

and you had to findByCode everything

#

but other than that it was whatever

#

oh and their old compiler aggressively merged modules and killed a shit ton of exports

#

so we often had to use patches just to grab discord functions

#

while other mods just coped without those modules

limber skiff
#

findByCode was pretty stable anyways

brazen bone
#

I guess you still had prop names to navigate by

limber skiff
#

yeah

austere talon
limber skiff
#

Decor still does it for some not exported stuff lol

#

honestly Vencord went to another level when ven made the reporter

#

it's life saving

brazen bone
#

Automated diagnostics is always good

limber skiff
#

but we didn't have webpack finds testing for a long time

#

only patches and bad starts

austere talon
limber skiff
#

and discord errors which has never been useful besides showing discord shit code when a variable isnt defined

austere talon
#

we're the future πŸš€

limber skiff
#

and it is not our fault

austere talon
livid heath
limber skiff
#

because the reporter nowdays loads chunks using their entry points

limber skiff
#

if you merge my webpack refactor pr we will be the first mod to use that way of grabbing webpack stuff too

#

all the rest still push to the array

livid heath
#

how does the new system work?

austere talon
#

tbh i love that the webpack runtime is so monkey patchable

#

i wonder if they did that on purpose

grave mangoBOT
# limber skiff https://github.com/Vendicated/Vencord/blob/0aff61cf812090d7b9d2a1ad4e4a9b51a78fb...

**patchWebpack.ts: **Lines 53-96

// wreq.O is the webpack onChunksLoaded function
// Discord uses it to await for all the chunks to be loaded before initializing the app
// We monkey patch it to get immediate access to the webpack require before the app runs,
// and to monkey patch the initialize app callback to run our listeners before doing it
Object.defineProperty(Function.prototype, "O", {
    set(onChunksLoaded: any) {
        const wreq = this;
        // When using react devtools or other extensions, or even when discord loads the sentry, we may also catch their webpack here.
        // This ensures we actually got the right one
        if (new Error().stack?.includes("discord.com") && wreq.p === "/assets/") {
            logger.info("Found Webpack onChunksLoaded");
            delete (Function.prototype as any).O;

            const originalOnChunksLoaded = onChunksLoaded.bind(wreq);
            onChunksLoaded = function (result: any, chunkIds: string[], callback: () => any, priority: number) {
                if (callback != null && initCallbackRegex.test(callback.toString())) {
                    Object.defineProperty(wreq, "O", {
                        value: originalOnChunksLoaded,
                        configurable: true
                    });

                    const originalCallback = callback;
                    callback = function () {
                        _initWebpack(wreq);

                        for (const beforeInitListener of beforeInitListeners) {
                            beforeInitListener();
                        }
                        originalCallback();
                    };
                }

                originalOnChunksLoaded(result, chunkIds, callback, priority);
            };

        }

        Object.defineProperty(this, "O", {
            value: onChunksLoaded,
            configurable: true
        });
    },
    configurable: true
});
livid heath
#

o that's smart

limber skiff
#

so it's basically

initVencordWebpack()
beforeInitListeners()
callDiscordEntryPoint()

#

but all with monkey patch

brazen bone
austere talon
#

wdym?

brazen bone
#

Not that it works, there are ways to get hold of it anyway

austere talon
#

i forgot what u is, remind me again

limber skiff
#

u is the chunk id to asset url map

brazen bone
#

Chunk id -> javascript asset mapping

austere talon
#

ah

#

it's a function that takes an id and returns url right

brazen bone
#

Yeah

limber skiff
#

yeah

austere talon
#

yeah i extracted the map in the past it's really easy

#
const map = eval(wreq.u.toString().match(regex);```
limber skiff
#

not so long ago they made it worse

brazen bone
#

You can extract it either with prototype pollution or regex

limber skiff
#

you can't do that anymore

livid heath
#

ofc its .toString

limber skiff
#

they reverted

austere talon
#

don't you lose some performance by always declaring the object inline

#

instead of caching it in a variable

brazen bone
#

Probably not much, but yeah must be nonzero

livid heath
#

i wonder if browser's js engine does some optimization

brazen bone
#

Though getting chunk urls is hardly a bottleneck compared to the subsequent http request

charred monolithBOT
livid heath
#

thank you gboard for correcting http to https

charred monolithBOT
charred monolithBOT
austere talon
#

and it's nothing compared to discords own performance issues

charred monolithBOT
rugged spire
brazen bone
shy veldt
#

they had a section in guild settings

#

similiar to app directory or so

#

but they hand picked like 6 bots

#

and thats what its used for

#

well more like no longer used

rugged spire
#

i think i can vaguely remember something like that

charred monolithBOT
brazen bone
#

Why does channel.getGuildId() exist? It's just return this.guild_id

rugged spire
brazen bone
#

Except for being unnecessarily confusing

rugged spire
#

look at this disgusting hack i made yesterday

#

works really well btw

rugged spire
#

fixed that trolley

austere talon
rugged spire
#

because i'm sure there is a Proper Wayℒ️

rugged spire
brazen bone
#

What are you trying to use that variable for

#

Because it smells a bit xy

rugged spire
#

(Overriding heights used for the original Discord titlebar)

#

Oh and before anyone screams too hard at me, Yes I know that file is undisputably a hack

#

and I will not PR that into ChannelTabs

charred monolithBOT
#

Is your feature request related to a problem? Please describe.
The Notification Badge option only works when libunity is installed, but this might not be exactly clear to non-Ubuntu users.

Describe the solution you'd like
In the option's description, add a help text such as:
image
Note: if this is not working for you, be sure to install the "libunity" package for your distro.

**De...

rugged spire
#

theoretical idea

#

but

#

what if

#

channel tabs

#

but vertical

brazen bone
#

What if :root { transform: rotate(90deg) }

rugged spire
#

why husk my idea

still wasp
brazen bone
#

So true bestie

rugged spire
#

What have I done

#

:root { transform: rotate(-90deg); width: 100vh; height: 100vw; right: 0; bottom: 0; }

brazen bone
#

You are approaching perfection

#

That's a lot of guilds

charred monolithBOT
shy veldt
rugged spire
#

I have a stupid question

#

Would automatically muting yourself in a voice channel be considered selfbotting

lime stone
#

depends how the action is triggered ig?

rugged spire
brazen bone
#

Inactivity is the opposite of action

rugged spire
#

I will respectfully refrain from submitting a PR until it has been determined whether the act of automatically muting yourself is considered selfbotting

lime stone
#

what is it

rugged spire
#

Automatically muting yourself in a voice channel if you haven't spoken for a certain amount of time

charred monolithBOT
spark pivot
#

Well it is a self bot but I think its fine since it will barely happen

rugged spire
#

so, Technically it is a bot, however it effectively does nothing

austere talon
#

anything that doesn't spam requests is fine

rugged spire
austere talon
#

if the requests could reasonably be triggered by normal app usage, it's fine

rugged spire
#

the most it would send is a single mute yourself event

rugged spire
#

the only concern I have is how it would precisely trigger after a certain time

#

which..... is the whole point

#

reusing code I already wrote time!!!!!

charred monolithBOT
charred monolithBOT
rugged spire
#

Would this be considered hacky

brazen bone
#

What's wrong with [15, ...makeRange(60, 900, 60)]?

rugged spire
#

Nothing at all.

#

Thank you for the suggestion on how to improve because I forgot you could do that with an array (for a moment)

charred monolithBOT
frail skyBOT
#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

None

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

charred monolithBOT
lime stone
#

veetop

charred monolithBOT
#

Describe the bug

Screen flickering after opening a pop-up, as in full user profiles

This bug is happening after upgrading plasma from 5 to 6

The "flickering" is the user profile disappearing quickly then coming back

This issue seems to happen around 5 seconds after opening the full user profile pop-up

To Reproduce

Select user from server member list
Open the profile fully by selecting the profile image
Wait around five seconds
Elements disappear and reappear i...

median rapids
#

(idk how react works bleh)

charred monolithBOT
charred monolithBOT
crude raptor
#

[Vendicated/Vendroid] New star added