Skip to content

Pulse Integration #112

@Dharp02

Description

@Dharp02

Pulse Integration

Overview

TimeHuddle needs to support video recording and upload via the Pulse Cam mobile app. Users should be able to attach recorded videos to tickets using a QR-code-based deep link flow that launches Pulse Cam, uploads the video through the PulseVault TUS endpoint, and links the result back to the originating ticket. A dedicated PulsePage gallery should make all video attachments discoverable, and the upload flow must be resilient across app restarts on native platforms.

Current State

  • No video upload capability exists in the app
  • Tickets can only have file-based attachments; no video recording flow is available
  • There is no backend endpoint to accept TUS (resumable) video uploads
  • No QR code or deep link integration for triggering external camera apps
  • No gallery page for browsing video attachments across tickets
  • Activity logs, timesheets, dashboard events, and ticket lists are not filtered by selected team

Proposed Changes

1. Backend PulseVault Endpoints

  • Add backend/src/routes/pulsevault.ts with:
    • POST /v1/pulsevault/reserve — reserves a video ID and maps it to a ticket/user pair (one-shot, authenticated)
    • POST /v1/pulsevault/upload/:videoId — TUS-compatible upload handler; links completed upload to the ticket as an attachment
    • Compatibility routes for older Pulse Cam clients (unauthenticated flow)
  • Register both versioned and compat routes in backend/src/server.ts
  • Add backend/src/services/video-reserve.service.ts — in-memory reservation store mapping video IDs to ticket/user pairs

2. Frontend Upload Flow

  • Add VideoUploadButton component to the Ticket Details modal — opens the PulseSetup UI
  • Add PulseSetup component:
    • Generates a one-time auth token and encodes it into a Pulse Cam deep link
    • Renders a QR code (via qrcode.react) for scanning on a mobile device
    • Persists the pending videoId per ticket in device storage so sessions survive app restarts
    • Polls for upload completion on native platforms after the deep link is followed

3. PulsePage Gallery

  • Add src/features/tickets/PulsePage.tsx — a dedicated page showing all video attachments for the selected team
  • Integrate PulsePage into the app navigation/layout

4. Team-Scoped Filtering

  • Filter activity logs, timesheet sessions, dashboard events, and ticket lists by the currently selected team throughout the app

5. Bug Fix: Video ID Overwrite Prevention

6. End-to-End Tests

  • Add e2e/pulsevault.spec.ts covering:
    • PulseSetup UI renders and QR code is shown
    • Upload Video button appears in Ticket Details
    • Direct MP4 upload via the TUS endpoint
    • Upload completion detection

Acceptance Criteria

  • A user can open a ticket and tap "Upload Video" to launch the Pulse Cam QR flow
  • Scanning the QR code opens Pulse Cam with the correct deep link (token + videoId embedded)
  • After recording, the video is uploaded via TUS and automatically attached to the ticket
  • Closing and reopening the app mid-flow resumes the pending upload session
  • A completed upload's videoId cannot be overwritten by a new recording session
  • The PulsePage gallery displays all video attachments for the active team
  • All ticket, activity, dashboard, and timesheet views respect the selected team filter
  • All Playwright e2e tests in pulsevault.spec.ts pass
  • npm run lint && npm run typecheck pass with no errors

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions