Skip to content

Comments

feat: sharing toggle#84

Merged
LuisNivar merged 2 commits intochore/update-turbofrom
feat/sharing-toggle
Jan 1, 2026
Merged

feat: sharing toggle#84
LuisNivar merged 2 commits intochore/update-turbofrom
feat/sharing-toggle

Conversation

@BrianUribe6
Copy link
Collaborator

Disable collaboration by default until the user enables it.

@BrianUribe6 BrianUribe6 changed the title Feat/sharing toggle feat: sharing toggle Dec 30, 2025
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactored to use jotai instead of context

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactored to use jotai instead of context

Copy link
Contributor

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 a collaboration toggle feature that disables collaboration by default until explicitly enabled by the user. The implementation includes significant dependency upgrades (Turbo v1 to v2), refactoring of identity management from Context API to Jotai atoms, and a new UI for managing sharing settings.

  • Upgrades Turbo from v1.10.x to v2.7.2 with corresponding configuration updates
  • Refactors identity management to use Jotai atoms instead of React Context
  • Adds a collaboration toggle state with UI controls in the share dialog
  • Automatically enables collaboration when accessing another user's notebook

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
turbo.json Updated configuration format from 'pipeline' to 'tasks' for Turbo v2 compatibility
package.json Upgraded Turbo dependency to v2.7.2
package-lock.json Lock file updates for Turbo and eslint-config dependencies
packages/eslint-config/package.json Updated eslint-config-turbo and eslint-config-prettier versions
apps/front-end/src/lib/local-identity.ts Refactored to use Jotai atoms, removed localStorage logic
apps/front-end/src/lib/identity-provider.tsx Simplified to use Jotai hook instead of Context API
apps/front-end/src/lib/collaboration/store.ts Added isCollaborationEnabledAtom and useIsCollaborationEnabled hook
apps/front-end/src/lib/collaboration/hooks.ts Updated hooks to handle collaboration disabled state
apps/front-end/src/lib/collaboration/StartCollaboration.tsx Added cleanup for awareness field on unmount
apps/front-end/src/plugins/CollaborationPlugin.tsx Added check to prevent rendering when collaboration is disabled
apps/front-end/src/components/Icons.tsx Added LockIcon and UnlockIcon exports
apps/front-end/src/app/[notebookId]/layout.tsx Converted to client component, added auto-enable logic for other users' notebooks
apps/front-end/src/app/[notebookId]/[noteId]/page.tsx Minor formatting change in JSX
apps/front-end/src/app/Providers.tsx Removed IdentityProvider wrapper
apps/front-end/src/app/Header.tsx Converted to client component, passes notebookId to DialogCollab
apps/front-end/src/app/DialogCollab.tsx Enhanced with collaboration toggle UI and state management
apps/front-end/drizzle/* Removed database migration files
apps/collab-server/Dockerfile Parameterized Node version, updated to 24-alpine
Comments suppressed due to low confidence (1)

apps/front-end/src/lib/collaboration/hooks.ts:48

  • The useIsSynced hook does not update when isCollaborationEnabled changes. If collaboration is enabled after initial render, isSynced will remain true even though the provider may not be synced yet. The isCollaborationEnabled should be added to the useEffect dependency array, and the logic should handle the state change dynamically.
export function useIsSynced() {
  const provider = useConnection();
  const [isCollaborationEnabled] = useIsCollaborationEnabled();
  const [isSynced, setIsSynced] = useState(provider.isSynced || !isCollaborationEnabled);

  useEffect(() => {
    const onSynced = () => setIsSynced(true);
    provider.on("sync", onSynced);
    return () => {
      provider.off("sync", onSynced);
    };
  }, [provider]);

  return isSynced;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BrianUribe6 BrianUribe6 changed the base branch from main to chore/update-turbo December 30, 2025 20:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@LuisNivar LuisNivar merged commit 6712793 into chore/update-turbo Jan 1, 2026
1 check passed
@LuisNivar LuisNivar deleted the feat/sharing-toggle branch January 1, 2026 20:34
LuisNivar pushed a commit that referenced this pull request Jan 1, 2026
* chore: Update turbo

* feat: sharing toggle (#84)

* feat(sharing): Toggle collaboration

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants