Skip to content

Comments

unreads: prevent open inactive tabs from automatically marking read#5512

Open
arthyn wants to merge 1 commit intodevelopfrom
nimbus/activity-detector
Open

unreads: prevent open inactive tabs from automatically marking read#5512
arthyn wants to merge 1 commit intodevelopfrom
nimbus/activity-detector

Conversation

@arthyn
Copy link
Member

@arthyn arthyn commented Feb 21, 2026

Summary

This PR adds a hook to detect client-side when your active/inactive so we can stop/start marking read automatically. I often would leave a window open with a bot I was DMing with and then wouldn't get pushes because the dismisses were happening from the automatic reading.

Assisted by nimbus (openclaw bot)

Changes

  • add new useUserActivity hook
  • added hook to channel and post screens to do detection

How did I test?

Manually

Risks and impact

  • Safe to rollback without consulting PR author? Yes
  • Affects important code area:
    • Onboarding
    • State / providers
    • Message sync
    • Channel display
    • Notifications
    • Other:

Rollback plan

Screenshots / videos

Adds user activity detection to prevent auto-marking messages as read
when the user is idle/AFK on web.

Changes:
- Add useUserActivity hook tracking mouse, keyboard, scroll, touch events
- Also checks document.hidden (tab visibility) and window focus
- Update Channel component to only markRead when user is active
- Update PostScreenView to only mark threads read when user is active

Default idle threshold: 60 seconds

Fixes issue where leaving a channel tab open would mark messages
as read even when user wasn't actively at the computer.
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