Skip to content

[codex] clear v2 ready notification on workspace click#3765

Merged
Kitenite merged 1 commit intomainfrom
clear-ready-notif-click
Apr 26, 2026
Merged

[codex] clear v2 ready notification on workspace click#3765
Kitenite merged 1 commit intomainfrom
clear-ready-notif-click

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Apr 26, 2026

Summary

  • Clear v2 workspace review attention when a workspace item is clicked, matching the v1 sidebar behavior for ready/completed notifications.
  • Add coverage that workspace-level attention clearing removes only review sources while preserving working, permission, and other-workspace statuses.

Impact

Clicking a v2 workspace row now acknowledges the ready notification immediately, without hiding active work or permission-request indicators.

Validation

  • bun test apps/desktop/src/renderer/stores/v2-notifications/store.test.ts
  • bunx biome check apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/hooks/useDashboardSidebarWorkspaceItemActions/useDashboardSidebarWorkspaceItemActions.ts apps/desktop/src/renderer/stores/v2-notifications/store.test.ts

Summary by cubic

Clicking a v2 workspace in the sidebar now clears its ready/review notification, matching the v1 behavior. Active work and permission indicators remain, and other workspaces are unaffected; tests cover this.

Written for commit 3438569. Summary will update on new commits.

Summary by CodeRabbit

  • Improvements

    • Workspace attention state now automatically clears when you select and navigate to a workspace.
  • Tests

    • Added tests to validate notification clearing behavior within workspace scope, ensuring that only notifications in the targeted workspace are affected while preserving notifications in other workspaces and different notification statuses.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0d4a59ac-efe7-415d-8caf-36015737bf42

📥 Commits

Reviewing files that changed from the base of the PR and between 7c168e7 and 3438569.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/hooks/useDashboardSidebarWorkspaceItemActions/useDashboardSidebarWorkspaceItemActions.ts
  • apps/desktop/src/renderer/stores/v2-notifications/store.test.ts

📝 Walkthrough

Walkthrough

When a workspace item in the dashboard sidebar is clicked, the hook now invokes clearWorkspaceAttention from the v2 notification store before navigating to the workspace route. A unit test validates that this action removes only "review" status notifications within the targeted workspace while leaving others unaffected.

Changes

Cohort / File(s) Summary
Hook Integration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/hooks/useDashboardSidebarWorkspaceItemActions/useDashboardSidebarWorkspaceItemActions.ts
Integrates clearWorkspaceAttention from v2 notification store and invokes it on workspace item click prior to route navigation.
Unit Test
apps/desktop/src/renderer/stores/v2-notifications/store.test.ts
Adds test case validating workspace-scoped clearing behavior, ensuring only "review" status notifications in the targeted workspace are cleared while preserving other statuses and unrelated workspaces.

Sequence Diagram

sequenceDiagram
    participant User
    participant DashboardSidebarWorkspaceItem as Workspace Item Hook
    participant NotificationStore as V2 Notification Store
    participant Router as Router/Navigation

    User->>DashboardSidebarWorkspaceItem: Click workspace item
    DashboardSidebarWorkspaceItem->>NotificationStore: clearWorkspaceAttention(workspaceId)
    NotificationStore->>NotificationStore: Remove "review" status notifications<br/>for workspace
    NotificationStore-->>DashboardSidebarWorkspaceItem: Workspace attention cleared
    DashboardSidebarWorkspaceItem->>Router: Navigate to /v2-workspace/$workspaceId
    Router-->>User: Display workspace
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A click clears the attention, neat and bright,
Workspace notifications vanish from sight,
The sidebar hops to a workspace anew,
With tests to ensure it does right, it's true! ✨

✨ 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 clear-ready-notif-click

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 and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR calls clearWorkspaceAttention(workspaceId) inside handleClick of the v2 workspace sidebar item, mirroring the v1 behavior that dismisses "ready" notifications when a workspace is selected. A matching unit test confirms that only review-status entries for the target workspace are removed while working, permission, and other-workspace entries survive.

Confidence Score: 5/5

Safe to merge — small, well-tested change with no risky side-effects.

The change is minimal: one store selector and one function call added to a click handler, with the store implementation already existing and the new test covering the key invariants. No P0/P1 issues identified.

No files require special attention.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/hooks/useDashboardSidebarWorkspaceItemActions/useDashboardSidebarWorkspaceItemActions.ts Adds clearWorkspaceAttention call on workspace item click, correctly scoped to the clicked workspaceId and placed before navigation.
apps/desktop/src/renderer/stores/v2-notifications/store.test.ts New test verifies clearWorkspaceAttention removes only 'review' entries for the targeted workspace while preserving 'working', 'permission', and other-workspace statuses.

Sequence Diagram

sequenceDiagram
    participant User
    participant WorkspaceItem as DashboardSidebarWorkspaceItem
    participant Store as V2NotificationStore
    participant Router

    User->>WorkspaceItem: click workspace row
    WorkspaceItem->>Store: clearWorkspaceAttention(workspaceId)
    Note over Store: removes entries where<br/>workspaceId matches AND status === "review"<br/>preserves "working", "permission", other workspaces
    Store-->>WorkspaceItem: state updated
    WorkspaceItem->>Router: navigate to /v2-workspace/:workspaceId
Loading

Reviews (1): Last reviewed commit: "clear v2 ready notification on workspace..." | Re-trigger Greptile

@Kitenite Kitenite merged commit 74d74bf into main Apr 26, 2026
6 of 7 checks passed
@Kitenite Kitenite deleted the clear-ready-notif-click branch April 26, 2026 19:59
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

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