Skip to content

Conversation

billcookie
Copy link
Contributor

@billcookie billcookie commented Sep 10, 2025

Overview

This PR implements workflow-specific cursor visibility, ensuring that user cursors are only displayed to collaborators who are working within the same workflow. The changes track which workflow each user is currently viewing and their open workflows through the awareness system.

What I've done

  • Added workflow tracking fields to user awareness state
  • Implemented cursor filtering based on current workflow context
  • Added spotlight user workflow synchronization functionality
  • Only updates awareness states when more than one user
  • Refactor by adding useSpotlightUser and useAwarenessCursor hooks

What I haven't done

How I tested

Screenshot

Which point I want you to review particularly

Memo

Copy link
Contributor

github-actions bot commented Sep 10, 2025

🚀 Cloud Run Preview Deployed

🔗 Click here to open the preview in a new tab

@billcookie billcookie marked this pull request as ready for review September 11, 2025 01:01
@billcookie billcookie requested a review from KaWaite as a code owner September 11, 2025 01:01
@Copilot Copilot AI review requested due to automatic review settings September 11, 2025 01:01
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements workflow-specific cursor visibility, ensuring that user cursors are only displayed to collaborators who are working within the same workflow. The changes track which workflow each user is currently viewing and their open workflows through the awareness system.

  • Added workflow tracking fields to user awareness state
  • Implemented cursor filtering based on current workflow context
  • Added spotlight user workflow synchronization functionality

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui/src/types/user.ts Extended AwarenessUser type with workflow tracking fields
ui/src/lib/yjs/useWorkflowTabs.ts Exposed openWorkflowIds for awareness updates
ui/src/features/Editor/index.tsx Passed currentWorkflowId to Canvas component
ui/src/features/Editor/hooks.ts Added workflow state synchronization and spotlight user workflow handling
ui/src/features/Canvas/index.tsx Added currentWorkflowId prop and conditional MultiCursor rendering
ui/src/features/Canvas/components/MultiCursor/index.tsx Implemented workflow-based cursor filtering

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@billcookie billcookie changed the title feat(ui): Keep cursors in their respective workflows [FLOW-FE-267] feat(ui): Keep cursors in their respective workflows and Hook Refactor [FLOW-FE-267] Sep 11, 2025
@billcookie billcookie requested a review from Copilot September 12, 2025 00:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@billcookie billcookie merged commit 51f20e1 into main Sep 16, 2025
21 checks passed
@billcookie billcookie deleted the ui/awareness-subworkflow-fix branch September 16, 2025 02:52
shunski pushed a commit that referenced this pull request Sep 16, 2025
…r [FLOW-FE-267] (#1418)

* feat(ui): Keep cursors in their respective workflows

* fix(ui): prettier check ran

* feat(ui): add openWorkflowIds to user state and update workflow handling logic

* feat(ui): implement useSpotlightUser hook for managing spotlight user workflows

* feat(ui): refactor spotlight user handling and add awareness cursor hook

* fix(ui): removed unnecessary conditional

* fix(ui): type issue for handlePaneMouseMove

* fix(ui): only update awareness when multiple users

* fix(ui): remove console logs

* fix(ui): cursor z-index from 1000 to 2000 to fix batch node collision issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants