Meetings & Companion Selection Integration - RyanL2004/teamlyse GitHub Wiki

Integration Plan

1. Add a "Select Companion" Button to Meeting Form

  • Meeting Form Update:
    In your meeting-form.jsx, include a button or link that lets the user navigate to the companion selection page. For example, label it "Select Companion" or "Choose Your AI Companion."

2. Navigation & Data Passing

  • Routing:
    When the user clicks this button, navigate to your AICompanionSelection page (e.g., using React Router).

  • Data Transfer:
    Use URL parameters or a shared state management approach (like Context or Redux) to store the selected companion's details.

    • Simple Approaches:
      • Store the selected companion in a global state or context.
      • Use a callback or React Router’s state property to pass the selection back to the meeting form once the user chooses a companion.

3. Companion Selection Page (AICompanionSelection.jsx)

  • Display Companions:
    Your component should list the available companions.

  • Selection Action:
    When the user clicks the "Choose This Companion" button, trigger a callback or update your shared state to store the selected companion.

  • Post-Selection Navigation:
    After selection, navigate the user back to the meeting form page. Optionally, display a confirmation message or preview (e.g., showing the companion's name "Dex" on the meeting form).

4. Display the Selected Companion on the Meeting Form

  • UI Update:
    Update meeting-form.jsx to check if a companion has been selected.

    • If yes, display its details (name, persona, preview image if available, etc.) so that the user can see which companion will be used.
  • Payload Preparation:
    Ensure the meeting creation payload includes the selected companion’s ObjectId (or identifier).

5. Final Meeting Creation

  • Gather Meeting Details:
    When the user clicks "Create Meeting," collect all meeting details (title, date, description, etc.), including:

    • The meeting description (user prompt for instruction-engineering the AI)
    • The companion reference (selected companion's id)
  • Submission:
    Send this combined payload to your meeting creation endpoint, which will link the meeting with the selected companion.