Skip to content

Conversation

@shipurjan
Copy link

Hello, this is a PR for a feature requested here (I needed it too)
#367

Basically it introduces the UI from Lockdown for Override, so that Override can be used for selected Sets and not only globally.

Use case:
I want to use LeechBlockNG to have some websites (defined 1 website per 1 block) blocked at all times, and only override them temporarily when I decide. But with current global override, it would give me access to all websites, not just 1 that I need. So with this solution it should work similar to Lockdown mode, but reversed.

Here are the test cases that I tested with this PR

# Test Case Expected Result
1 Open Override with no block sets having "Allow temporary override" enabled Shows error: "No block sets have 'Allow temporary override' enabled"
2 Enable "Allow temporary override" for 2+ block sets, open Override Shows checkboxes only for those sets
3 Select 1 set, enter 5 mins, activate Override activates for that set only
4 Select multiple sets, activate Override activates for all selected sets
5 Click "Activate" with no sets selected Shows error: "Please select the sites to override"
6 Click "Activate" with no duration entered Shows error about duration

UI State Persistence

# Test Case Expected Result
7 Set hours=1, mins=30, select sets 1 & 3, activate. Reopen Override Hours, mins, and checkbox selections are remembered

Override Behavior

# Test Case Expected Result
8 Activate override for set 1, visit blocked site in set 1 Site is accessible
9 Activate override for set 1 only, visit blocked site in set 2 Site is still blocked
10 Activate override, check toolbar icon Icon changes to override icon (orange)
11 Wait for override to expire OR cancel override Icon returns to normal

Edge Cases

# Test Case Expected Result
12 Activate override for set 1, then go to Options and disable "Allow temporary override" for set 1 Override continues until expiry (matches lockdown behavior)
13 Activate override for sets 1 & 3 for 5 mins, then activate for set 2 for 10 mins Set 1 & 3 have 5 min override, set 2 has 10 min override (independent)
14 Use "Cancel Override" from popup menu All active overrides are canceled

Override Limit (if configured)

# Test Case Expected Result
15 Set override limit to 2/day, activate override for 3 sets at once Counts as 1 use (not 3)
16 Reach override limit, try to open Override Shows limit reached error

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.

1 participant