Skip to content

[2.x] feat: Per-channel project cursor for multi-client server mode#8649

Merged
eed3si9n merged 7 commits intosbt:developfrom
bitloi:feat/channel-cursor-2799
Jan 30, 2026
Merged

[2.x] feat: Per-channel project cursor for multi-client server mode#8649
eed3si9n merged 7 commits intosbt:developfrom
bitloi:feat/channel-cursor-2799

Conversation

@bitloi
Copy link
Copy Markdown
Contributor

@bitloi bitloi commented Jan 28, 2026

Fixes #2799

Problem

When multiple clients connect to the same sbt server, they all share the same "current project" state. When one client switches projects with project X, all other clients see that change.

Solution

Store per-channel project cursors in State attributes. Each client maintains its own cursor that tracks which project it has selected.

Changes

  • Keys.scala - Add channelProjectCursors attribute
  • ProjectNavigation.scala - Add effectiveCurrentRef to resolve channel-specific cursor
  • ProjectExtra.scala - Use effectiveCurrentRef in Project.extract
  • MainLoop.scala - Add syncChannelCursor to auto-update cursors on project change

Test

  • ChannelCursorTest - Verifies two clients maintain independent project states

@bitloi bitloi force-pushed the feat/channel-cursor-2799 branch from 496d47a to 87303b9 Compare January 28, 2026 12:46
The per-channel cursor feature has been reverted. This commit removes
the remaining unused channelProjectCursors key definition.
Remove all remaining per-channel cursor code including:
- channelProjectCursors key from Keys.scala
- getChannelCursor, setChannelCursor, effectiveCurrentRef methods
- Import statement for channelProjectCursors
- Restore original ProjectNavigation implementation
@bitloi bitloi force-pushed the feat/channel-cursor-2799 branch from a77759f to f11b7de Compare January 28, 2026 23:17
@bitloi
Copy link
Copy Markdown
Contributor Author

bitloi commented Jan 29, 2026

@eed3si9n Please review my pr and give me your feedback

@eed3si9n
Copy link
Copy Markdown
Member

Hi @bitloi, thanks for the contribution!

Please check out our Contributor's Guildeline and:

  1. Make sure you can reproduce the problem and the fix manually
  2. Include tests for the change
  3. Follow our Gen-AI assisted contributions guideline (please declare Gen AI usages in the PR description, if any)

…nel cursors

- Add effectiveCurrentRef in ProjectNavigation to resolve channel-specific cursor
- Modify Project.extract to use effectiveCurrentRef for task resolution
- Add syncChannelCursor in MainLoop to auto-update cursors on project change
- Add ChannelCursorTest to verify multi-client independent project states
@bitloi bitloi requested a review from eed3si9n January 29, 2026 21:49
@bitloi
Copy link
Copy Markdown
Contributor Author

bitloi commented Jan 30, 2026

@eed3si9n Would you please give me your feedback for the change?

Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

@bitloi Works great. Thanks!

@eed3si9n eed3si9n changed the title feat: Per-channel project cursor for multi-client server mode [2.x] feat: Per-channel project cursor for multi-client server mode Jan 30, 2026
@eed3si9n eed3si9n merged commit 1ad6b88 into sbt:develop Jan 30, 2026
15 checks passed
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.

Channel cursor

2 participants