Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(plugin): CustomIdle #2342

Merged
merged 17 commits into from
May 18, 2024
Merged

feat(plugin): CustomIdle #2342

merged 17 commits into from
May 18, 2024

Conversation

waresnew
Copy link
Contributor

@waresnew waresnew commented Apr 8, 2024

Fulfills Vencord/plugin-requests#199

Main feature is changing the timer until your status gets set to idle (or preventing auto-idle forever)

image

There's also a confirmation notification where it'll let you stay idle, even if you come back to Discord

image

You'll stay idle until you click "Exit idle"

@waresnew
Copy link
Contributor Author

waresnew commented Apr 8, 2024

ngl i think it'd be better to do like a "You are currently still idle. Click the button to exit idle" bar instead of the grace period

also bc the way I animated the grace period notification is kinda ugly

lemme change that

@waresnew waresnew marked this pull request as draft April 8, 2024 20:26
@Vendicated
Copy link
Owner

keep in mind that this idle timer is coupled with mobile notifications. so if you set it to a very high number or disable it outright, it might break mobile notifications

@waresnew
Copy link
Contributor Author

waresnew commented Apr 8, 2024

keep in mind that this idle timer is coupled with mobile notifications. so if you set it to a very high number or disable it outright, it might break mobile notifications

oh ok i'll make a more precise patch for disabling then

@waresnew
Copy link
Contributor Author

waresnew commented Apr 9, 2024

aight it won't affect mobile notifications now (it'll respect the setting in vanilla discord)

you can see here:

image

^ I'm online (disabled auto-idle) but I'm afk

Also changed the "grace period" thing to this:

image

@waresnew waresnew marked this pull request as ready for review April 9, 2024 20:32
@Golonchy
Copy link

Cool af

@Wraaath
Copy link

Wraaath commented Apr 22, 2024

Bump

@R00tB33rMan
Copy link

Did some testing with this and feel it’s ready for use. Vesktop currently does not handle Idling very well and this as a workaround seems like a fair consideration to me. Could not produce any bugs with this branch. At this time, I have to run four Discord tabs, instead of two to keep my Discord online at all times, which is incredibly inefficient. How ready would you say this is or what’s blocking this from being added to the plugin library, @Vendicated?

@JosTheDude
Copy link

Requesting addition here, works well

@Kromilan
Copy link

I was deperatly looking for a plugin like this. When I have Discord open on my second monitor and have an eye on it, I am there. Hands on my keyboard and mouse, and always an eye on Discord. But I still get set to idle when I don't actually click into the client for too long and then they think I'm not available and nobody messages me any more :( I'm so glad there's a plugin in development to fix this!!
I have a question though. I am absolutely not familiar with github though, so sorry if this is a stupid question: can this already be installed and if so, how? I saw some people in the comments tested it, so I guess they installed it somehow, but then there are also comments suggesting it's not available yet?

@waresnew
Copy link
Contributor Author

can this already be installed and if so, how?

it can be installed, but it's not an official plugin yet (vee needs to approve it first) so you need to install the dev version of Vencord. then you download the index.ts in this pull request and you move it to src/userplugins/customidle (create a folder)

however you won't get any support with dev versions/unofficial plugins like this one so you have to figure it out yourself in the end

@UglukOrc
Copy link

I'm so happy you've made this dream come true! I understand it isn't officially released, But, I found it amazing how BetterDiscord had something like it, and I was just wondering beyond wonder why Vencord didn't have any option for it! Thanks @waresnew

@Vendicated
Copy link
Owner

Vendicated commented May 15, 2024

How ready would you say this is or what’s blocking this from being added to the plugin library, @Vendicated?

@R00tB33rMan there's nothing blocking it from being merged, it's just that i haven't gotten to it yet! there's quite the backlog of pull requests so it sadly takes a while sometimes. anyway ill look at this some time in the coming few days

you (and anyone reading this) can always help by testing open pull requests early and testing their functionality. see if all works as expected, if there are any bugs or if there is any behaviour that you think might be confusing, then leave constructive feedback to the author

for example in this pr it'd be good to test & report if this causes any issues / edge cases with mobile notifications or if those work flawlessly

@Vendicated
Copy link
Owner

please add a readme file

@waresnew
Copy link
Contributor Author

waresnew commented May 15, 2024

ok it looks like a lot of people use this plugin to partially solve idling while the window is in the foreground

i'm not sure if it's feasible to globally capture user input even when the window's unfocused

in terms of formatting, i can't access vscode rn so i'll fix it in like 10 hours

i'll add a readme in a moment

src/plugins/customidle/index.ts Outdated Show resolved Hide resolved
@Nuckyz
Copy link
Collaborator

Nuckyz commented May 16, 2024

The way this is currently done has a big problem. The same function that handles setting mobile notifications to true is the function that sets the idle. It is ran using a setInterval as seen here:
image

Modifying IDLE_DURATION to MAX_SAFE_INTEGER causes "C" to run on loop non stop. But also, modifying it means you are still making setting mobile notifications depend on the new idle timeout, because it changes how often it does the checking, even though you made the check itself not depend on the new idle timeout

@Nuckyz
Copy link
Collaborator

Nuckyz commented May 16, 2024

I have applied my suggestion of a better handling for showing the notice, and also better formatting. But the issues I mentioned are still present

@waresnew
Copy link
Contributor Author

waresnew commented May 16, 2024

oh, i see

edit: it looks like that setInterval is only run when on web discord (I only tested on desktop so ig that's why I didn't notice)

i'm a bit busy rn so i'll add a patch for that in a few days

ty for reviewing

@waresnew
Copy link
Contributor Author

ok i just realized that setInterval's delay has to be a 32 bit integer

so MAX_SAFE_INTEGER was making it overflow to 0 💀

technically this made it so the setinterval was still being run but this probably caused lag

@Vendicated
Copy link
Owner

so this still needs work if i'm understanding correctly? marking as draft accordingly

@Vendicated Vendicated marked this pull request as draft May 17, 2024 15:55
@waresnew
Copy link
Contributor Author

ok it won't prevent you from being AFK on web installs now

i'm gonna unmark it as draft now

@waresnew waresnew marked this pull request as ready for review May 18, 2024 14:06
src/plugins/customidle/index.ts Outdated Show resolved Hide resolved
src/plugins/customidle/index.ts Outdated Show resolved Hide resolved
@Nuckyz
Copy link
Collaborator

Nuckyz commented May 18, 2024

Great fix, just these three nitpicks and it should be ready

src/plugins/customidle/README.md Outdated Show resolved Hide resolved
waresnew and others added 3 commits May 18, 2024 19:38
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
@waresnew
Copy link
Contributor Author

okk made the changes 👍

@Nuckyz Nuckyz changed the base branch from main to dev May 18, 2024 23:41
@Nuckyz Nuckyz enabled auto-merge (squash) May 18, 2024 23:41
@Nuckyz Nuckyz merged commit 54e1bac into Vendicated:dev May 18, 2024
1 check passed
@Nuckyz
Copy link
Collaborator

Nuckyz commented May 18, 2024

Thank you for the new plugin!

@waresnew waresnew deleted the customidle branch May 18, 2024 23:42
@UglukOrc
Copy link

Thank you for the new plugin!

Hol up! This working now?? @Nuckyz

@Nuckyz
Copy link
Collaborator

Nuckyz commented May 20, 2024

When it gets released to the main branch, yes

LunaisLazier pushed a commit to LunaisLazier/Mooncord that referenced this pull request May 21, 2024
@R00tB33rMan
Copy link

Thank you all for your hard work. I really appreciate everyone's interest in improving the user experience and am glad that this was merged through everyone's availability and persistence.

ImLvna pushed a commit to ImLvna/Vencord that referenced this pull request May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants