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
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
Proposed Changes
1. Backend PulseVault Endpoints
backend/src/routes/pulsevault.tswith: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 attachmentbackend/src/server.tsbackend/src/services/video-reserve.service.ts— in-memory reservation store mapping video IDs to ticket/user pairs2. Frontend Upload Flow
VideoUploadButtoncomponent to the Ticket Details modal — opens the PulseSetup UIPulseSetupcomponent:qrcode.react) for scanning on a mobile devicevideoIdper ticket in device storage so sessions survive app restarts3. PulsePage Gallery
src/features/tickets/PulsePage.tsx— a dedicated page showing all video attachments for the selected team4. Team-Scoped Filtering
5. Bug Fix: Video ID Overwrite Prevention
videoIdwhen a new recording session starts on the same ticket (PR fix: enhance video ID handling to prevent overwriting completed uploads #130)6. End-to-End Tests
e2e/pulsevault.spec.tscovering:Acceptance Criteria
pulsevault.spec.tspassnpm run lint && npm run typecheckpass with no errors