-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
🚀 Feature Description
We need to implement a collaborative sharing mechanism within PaperDebugger. This feature allows Advisors (e.g., Professors) to share specific debug conversations with Students. The shared conversation must remain immutable to the student, ensuring the Advisor's original context is preserved. If a student attempts to interact with the shared conversation, the system should automatically "fork" (duplicate) the session for them.
📖 User Stories
- As an Advisor, I want to toggle a "Share" status on a conversation so that my students can view the debugging steps I have taken.
- As a Student, I want to see conversations shared by my Advisor at the top of my conversation list so I don't miss important guidance.
- As a Student, I want to chat within a shared context, but have it automatically create a personal copy so I don't mess up the Professor's original conversation.
🛠 Functional Requirements
1. API & Backend - Sharing Mechanism
- Endpoint: Implement an API endpoint (e.g.,
POST /conversations/{id}/share) to toggle visibility permissions. - Permissions: Allow specific target users (or project members) to gain
READaccess to the conversation. - Ownership: The original conversation remains owned by the Advisor.
2. UI/UX - Conversation List & Sorting
- Visual Indicator: Shared conversations must be clearly labeled in the list view (e.g., a badge saying
Shared by [User Name]). - Priority Sorting:
- Default: Shared conversations should automatically pin to the top of the conversation list.
- Option: Alternatively, provide a toggle/filter in the UI settings: "Show Shared Conversations First."
3. Interaction Logic - Immutable Source & Forking
- Read-Only View: When the student opens the shared conversation, they can view the history but cannot delete or edit existing messages.
- Fork-on-Chat (Duplication):
- If the student types a new message in the input bar of a shared conversation:
- The system creates a duplicate of the conversation (cloning the history up to that point).
- The student's new message is appended to this new copy.
- The UI seamlessly switches the student to the new conversation.
- The Advisor's original conversation remains untouched.
🎨 UI Mockup / Flow
- Advisor Side: Clicks "Share" icon on chat header -> Confirms Project/Student.
- Student Side (List):
- 📌 [Shared] Project Alpha Debugging (Shared by Prof. Smith)
- My Other Chat 1
- My Other Chat 2
- Student Side (Chat):
- Student types: "Can you explain this error?"
- System Toast: "Conversation duplicated. You are now working on your personal copy."
✅ Acceptance Criteria
- API developed to handle sharing permissions.
- Shared conversations appear in the recipient's list with the correct "Shared by" label.
- Shared conversations are sorted to the top of the list. (toggable)
- The original conversation is read-only for the recipient.
- Typing a message in a shared conversation triggers a deep copy (fork) of the session.
- The new message is sent to the forked session, not the original.
ℹ️ Additional Context
- Database consideration: The forked conversation should likely have a
parent_idreference to the original shared conversation for analytics/tracking purposes.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Design / Spec