# Improved Slack Work Session Shortcut
## Main Flow
# Start now - add small random delay
###Get Work Duration
### Calculate Break Schedule
Determine number of breaks based on hours
2-4 hours: 1-3 breaks
4-6 hours: 2-4 breaks + lunch
6+ hours: 3-6 breaks + lunch
#Check if lunch break should be scheduled
Before 2pm, check work duration
Long enough for lunch
Add 1 to numberOfBreais for the lunch break
Too short for lunch
Too late for lunch
## Full Break Scheduling Implementation
###Initialize break tracking
Will store break times as text
Track last break to ensure spacing
# Calculate minimum time between breaks (in seconds)
# Ensure at least 30 minutes between breaks
# If we have lunch, handle it separately
Calculate lunch time (between 12pm and 3pm)
Figure out when 12pm and 3pm are relative to start
Create 12pm timestamp
Create 3pm timestamp
Calculate seconds from start to noon and 3pm
If noon hasn't passed and work session extends past noon
Noon is in the future
Schedule lunch between noon and 3pm
Make sure lunch doesn’t go past 3pm or end of work
Too late, adjust
Past end of work, adjust
Add lunch to break times
Reduce regular breaks by 1 since lunch counts as a break
Work ends before noon
Already past noon
No lunch scheduled
Schedule regular breaks
Calculate valid time range for this break
Calculate latest time for this break (leave room for remaining breaks)
Pick random time in valid range
Valid range exists
If no valid range, space evenly
Add some randomness (±5 minutes)
Ensure break isn't too close to lunch (if scheduled)
Check distance to lunch
Get absolute value
Negative, make positive
If within 1 hour of lunch, adjust
Too close to lunch
Move break earlier
Move break later
Add to break times list
Less than 2 hours - no breaks
Wait for scheduled start time if needed
Wait for scheduled time
Add randomness
Start work session with delay
Main work loop with scheduled breaks
Sort reak times and execute work session
Work session with breaks
Extract next break time from the list
Calculate work time until next break
Work until break with natural variation
Add small random variation (+- 30 seconds)
Take the break
Lunch break: 35-50 minutes
Add random seconds
Regular break: weighted towards 10-20 minutes
Add random seconds
Lock screen during break with slight delay
Return to Slack with delay
Update currrent time
Remove processed break from list (rebuild without first two items)
Final work segment
Add random variation
No breaks - just wait the full duration with small variations
End of work session
Add extra random seconds
Even more random time