Skip to content

fix(wework): mark focused runtime task read - #1813

Merged
qdaxb merged 1 commit into
mainfrom
agent/fix-focused-runtime-task-read
Jul 8, 2026
Merged

qdaxb merged 1 commit into
mainfrom
agent/fix-focused-runtime-task-read

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Current task reminders now respect whether the workbench window is focused or visible.
    • A completed task you’re actively viewing will stay marked as read when the window is in focus.
    • Unread reminders for the active task are preserved when the window is not focused.
    • Reminder counts and unread state now update more consistently for tasks that temporarily disappear from view.

@qdaxb
qdaxb merged commit de83244 into main Jul 8, 2026
19 of 20 checks passed
@qdaxb
qdaxb deleted the agent/fix-focused-runtime-task-read branch July 8, 2026 09:02
@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9eee300-75f3-4e7c-af1f-910e24658c48

📥 Commits

Reviewing files that changed from the base of the PR and between 9717e99 and 216c403.

📒 Files selected for processing (2)
  • wework/src/features/workbench/runtimeTaskReminders.test.ts
  • wework/src/features/workbench/runtimeTaskReminders.ts

📝 Walkthrough

Walkthrough

buildRuntimeTaskReminderSnapshot and useRuntimeTaskReminders now accept the current runtime task and a visibility flag derived from window focus state, suppressing unread markers for the visible current task. A new focus-tracking effect and updated persistence logging were added, along with corresponding test updates.

Changes

Focus-aware task reminders

Layer / File(s) Summary
Snapshot logic accepts current task and visibility
wework/src/features/workbench/runtimeTaskReminders.ts
buildRuntimeTaskReminderSnapshot gains currentRuntimeTask and optional currentRuntimeTaskVisible params, removing the current task from unread keys and skipping completed-unread marking when visible.
Window focus tracking and hook wiring
wework/src/features/workbench/runtimeTaskReminders.ts
useRuntimeTaskReminders adds currentRuntimeTask param, tracks windowFocused via a new getWindowFocused() helper and focus/blur/visibilitychange listeners, wires it into the snapshot memo and persist logging, and extends effect dependencies.
Tests for current task and focus behavior
wework/src/features/workbench/runtimeTaskReminders.test.ts
Existing tests updated with currentRuntimeTask: null; new focus-aware tests validate unread/read behavior for the current task depending on window focus.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • wecode-ai/Wegent#1795: Both PRs modify runtimeTaskReminders unread/completed-unread snapshot behavior via currentRuntimeTask/currentRuntimeTaskVisible.
  • wecode-ai/Wegent#1809: Both PRs modify the same buildRuntimeTaskReminderSnapshot/useRuntimeTaskReminders code paths, with opposite changes to the current-task unread-suppression logic.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-focused-runtime-task-read

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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