-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add option to pick Count period #31
Comments
Hi @olfek Counter is reset for a specific rule (let's say But to be honest, I was a bit hesitant to add the Counter feature as it introduces a bit of gamification and replaces one addiction (of visiting a website) with another (how many blocked I have today?). I think Counter is not an essential information and doesn't change the fact I tried to access something I shouldn't. Doesn't matter if it was 10x or 100x. Maybe better if I don't know this information. Shall we remove the feature? |
I would suggest adding a setting to enable/disable the counter rather than removing it completely. Someone might find it to be useful. If an enable/disable setting is added, I'd recommend having it enabled by default so new users can see the extension in all its glory. |
Yep this makes a lot of sense honestly, a counter since the rule was added. Besides, the counter would be even more useless if it reset on every new session, as it would be hiding our level of procrastination and unproductivity 😁 I could start a new session several times in one day so the counter wouldn't be very useful then. |
But, consider this example. Suppose its been 2 months since I added a block rule. The first month, I was visiting the blocked site a lot. Then the second month I wasn't visiting it very much. It would be nice for the counter to show this improvement in a time range of my choice. |
Exactly 😄
We already save counter information as timestamps, so it's ready to show chart over time 😅 Maybe we could even add a highscore 🤣
This is quite easy to add. I was thinking about it. Probably best way to satisfy both parties? |
Sounds good but the enable/disable setting for the counter would be a new issue. This issue is about when/if and under what circumstances the counter should be reset.
lol, to begin with, I think we should keep it simple. For me personally, I would want the counter to reset daily, but someone else might want the counter to reset weekly or monthly or never. |
Agreed.
I think the same. I actually think no counter is needed at all. It doesn't bring me value to know my blocked stats. It's not a game. |
For me it has actually been useful, I can sometimes waste a lot of time on YouTube, the other day I involuntarily visited YouTube and saw the blocked screen with a block count of 30+, it made me re-evaluate my life choices haha 😅 Seeing the number so high reaffirmed my commitment to avoiding YouTube. The counter makes the user feel guilty, makes them realise they have a problem, this is the counters purpose. Therefore this counter feature makes this extension more effective at combating procrastination, unproductivity and website addictions (YouTube in my case 😅) |
Tell me about it 😄 I don't want to see my YouTube counter because that number is just horrible 😄 Soooo. I think we can agree how resetting of counter works is as we need it to be. And can create a new issue to add option to |
by default - shown (allow new users to taste all the features) and yep, create a new issue 👍
Not for me unfortunately, I would like a daily reset. |
We don't need to reset anything 😉 We can just add a new dropdown to Options, where you would pick the era (filter, a view) for the displayed count: All time, This month, This week, Today. How that sounds? If you agree, feel free to create a new issue. |
Yep that sounds perfect. Lets just use this issue. |
What would the performance implications be though, if I've been using the extension for 365 days, and I only want the count for today, the code will need to process all blocks that have occurred in the last 365 days to find the block count for today. |
pseudocode
would it look something like this? |
This has the potential to become slower over time if implemented poorly. |
If you would let's say open It could be optimized in many ways, for sure. Not saying it is needed, but for example, you don't have to go over everything to find records for Today. You could start at the end and go backwards until you find something else as Today (which would be Yesterday). With this simple optimization, you'd go over only 1/365 (just an example, only valid when you'd have same counts for every day) of all records only and make it thus as fast as 0,1 millisecond. In other words, 1/10000 of a second. I wound't worry about the performance really. But glad you asked. If curious, you can try this by yourself. /**
* Repeats 10-times:
* Creates an array of "length" with random numbers in range <0, 1)
* and filters numbers down to numbers that are >0.5.
*
* And prints:
* - each run duration in ms
* - average run duration in ms
*/
const test = (length) => {
const durations = [];
for (let r = 1; r <= 10; r++) {
const arr = Array(length).fill().map(() => Math.random());
const startTime = performance.now();
const filtered = arr.filter((item) => item > 0.5);
const endTime = performance.now();
const duration = endTime - startTime;
durations.push(duration);
console.log(`run ${r} duration: ${duration} ms`);
}
const averageDuration = durations.reduce((p, c) => p + c, 0) / durations.length;
console.log(`average run duration: ${averageDuration} ms`);
};
test(1_000_000); // try a different length |
This is assuming that the counter data retrieved from storage is in the correct order, is that the case? Is the correct order guaranteed? |
Every blocking is always added to the end. The order is guaranteed. |
This feature is now implemented. Here's a preview: count-period.movWhen you change option to "Show Blocked info page", it would show additional and related options in that area, to show how many times blocked [Yes/No], and blocked period [All Time, This Month, This Week, Today]. Blocked info page message would then depend on the selected period:
As you can see, any other than "All Time" period is included in the message. Other changes:
What do you think? |
@penge looks good to me 👍 |
Agreed to add option to pick period for counter: All time, This month, This week, Today
Note: Previous discussion started on how to reset the count (counter) but that won't be necessary.
Should counter persist between browsing sessions?
Especially considering there is no way to reset the counter.
🤔
The text was updated successfully, but these errors were encountered: