Skip to content

Pulse Videos Play Inline With Their Thumbnail, Wherever They Show - #616

Closed
morepriyam wants to merge 1 commit into
feat/videos-upload-linksfrom
feat/pulse-video-cards
Closed

morepriyam wants to merge 1 commit into
feat/videos-upload-linksfrom
feat/pulse-video-cards

Conversation

@morepriyam

@morepriyam morepriyam commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Pulse videos now show as a card, the video's poster frame with a ▶, that plays inline. Before, they were a link to a file. The card appears in Huddle posts, on a ticket's, Redmine issue's and clock session's Videos, and as a timesheet change's walkthrough in review.

Rebuilt on #709: this PR used to stack on #615 (closed) and was 248 commits behind main. It's now one commit on #709. Its server code is gone: PulseVault 0.6.0 (from #709) serves a video's poster itself. See What changed from the original #616 and Stack and merge order below.

A Pulse post in Huddle Playing inline
Huddle: a Pulse post as a card with its poster frame and play button The same card playing inline

How it works

A card asks for its poster by the video's id, so nothing is copied onto posts or attachments, and a poster that lands after its video is still found.

flowchart LR
    PulseApp["Pulse app"] -->|"video, and its thumbnail relatedTo it"| Vault["PulseVault 0.6"]
    Card["Video card: Huddle post, ticket,<br/>Redmine issue, clock session, walkthrough"] -->|"GET /pulsevault/artifacts/:videoId/poster"| Vault
    Vault -->|"the thumbnail, or 404 (plain card with ▶)"| Card
    Card -->|"press ▶: inline player on /pulsevault/artifacts/:videoId"| Vault

    classDef client fill:#fde8e8,stroke:#ff383c,color:#111
    classDef server fill:#e8f0fe,stroke:#4a6fd8,color:#111
    class PulseApp,Card client
    class Vault server
Loading

Changes

  • PulseVideoPlayer (new), shared by the Huddle card, AttachmentsPanel and the timesheet approvals panel. It loads nothing until played: the poster is a plain image, and <video> mounts on the tap and starts from it, so iOS doesn't ask for a second tap. It's named after the video ("Play …"), keeps keyboard focus on the player, and starting one video pauses any other. A missing poster shows a plain box with the ▶.
  • Huddle: a pulse_video widget for SuperChat's GenUI plugin (pulseVideoBlock.ts, lazy PulseVideoCard.tsx), registered in Huddle.tsx. Post text is user-written, so the payload carries only the video's artifact id (zod-validated as a UUID) and an optional title; the card builds every URL itself. A hand-typed block can only point at this backend's PulseVault. A title's backticks are encoded so they can't close the fence.
  • pulse-upload/artifact.ts (new): the one place artifact paths are built (artifactPath, posterPath → PulseVault's /artifacts/:id/poster, pulseArtifactId). TimesheetJustificationFields' artifactUrl and the Huddle upload's inline path use it now.
  • Inbox search ignores card payloads, so artifact ids and the widget name don't match every query.
  • attachments.add no longer takes a thumbnail from the client (attachments.js, main.js, api.ts): nobody can set the poster another person's video shows.
  • e2e: the five checks that looked for a video link (huddle/pulsevault-video ×3, huddle/composer-actions, tickets/video-upload) now play the card and check the artifact it loads, via tests/e2e/fixtures/pulseVideo.ts.
  • docs/superchat-inbox-gaps.md row 3.7; release note "Videos play where they're posted" in release-notes/1.0.7.md.

What changed from the original #616

  • No server code. The original linked each thumbnail to its video in a pulse_uploads record, backfilled old ones at startup, and served GET /pulsevault/posters/:videoId. main no longer has pulse_uploads, and PulseVault 0.6.0 serves GET /artifacts/:id/poster (the newest finished thumbnail relatedTo the video), already in /pulsevault/docs. So none of that is needed, and posters for videos from before this change work without a backfill.
  • Kept: the card, the player, the widget, search, and the thumbnail hardening.

Not in this PR

  • Sidebar preview: the inbox's conversation list shows the card's raw JSON as the preview line. The fix belongs in @mieweb/ui (gap 1.2 in docs/superchat-inbox-gaps.md).
  • Card name: the card is named after the attachment's filename ("Video 28d80a5a"), not the Pulse draft's name.
  • Card colours: the card stays dark in every theme, as video surfaces do.
  • Thumbnail quality: Pulse's thumbnail is small (192×108) and ignores the video's rotation. That's on the Pulse side.

Tests

  • On this branch: typecheck, lint, format clean; unit tests 612 / 612 (pulseVideoBlock.test.ts, superChatFeed.test.ts).
  • In a browser against the dev backend: Huddle shows six cards and no video links, and a card plays its artifact inline (1080 × 1920, no errors); a ticket's Videos show 19 cards and no links; a video sent the way Pulse sends it (thumbnail relatedTo it, then the video) gets its poster from /artifacts/:id/poster and the card draws it. Videos uploaded from a file have no thumbnail and show the plain card; the browser logs each poster's 404.
  • e2e not run on this branch (the five updated checks included).

Stack and merge order

This work used to ship as one PR (#678). It is now five, so each can be reviewed on its own and the universal links can wait for Pulse's store release without holding the rest back.

Order PR Base What
1 #709 main Upload beside Pulse, every video converted; links in the text, Videos everywhere
2 #710 #709 The Clock page's Pulse card, a pending change and an upload's progress
2 #678 #709 Pulse opens through its universal links (waits on Pulse's App Store / Play Store release)
2 #616 #709 Pulse video cards
3 #711 #710 Timesheets as a list of sessions; the Work page in one layout

The three PRs in step 2 are independent of each other and can merge in any order once #709 is in. #711 follows #710. When a base PR merges, retarget the next one to main (GitHub does it when the merged branch is deleted).

Expected conflicts when the step-2 PRs merge after each other, all small:

Merged together, the five come out identical to the old #678 head plus the timesheet work and the video cards (checked file by file). The old heads are tagged backup/video-conform-2026-10-13 and backup/pulse-video-cards-2026-10-13.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 00:39
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🚀 Preview Deployment Ready

Service URL
App https://mieweb-timehuddle-feat-pulse-video-cards.os.mieweb.org
API (Meteor) https://mieweb-timehuddle-feat-pulse-video-cards-api.os.mieweb.org

Preview auto-deletes when this PR is closed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Ticket and clock videos cross-posted into Huddle cannot currently resolve their stored thumbnails, and the core linkage path lacks automated coverage.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds inline Pulse video cards across Huddle posts, tickets, and clock-session attachments.

Changes:

  • Links Pulse thumbnails during upload and via startup backfill.
  • Adds secure GenUI cards with lazy inline playback.
  • Updates search behavior, tests, documentation, and release notes.
File Description
meteor-backend/​server/​pulsevault.js Links and backfills video thumbnails.
meteor-backend/​server/​huddle.js Enriches post videos with thumbnails.
src/​features/​pulse-upload/​PulseVideoPlayer.tsx Adds shared poster/player UI.
src/​features/​huddle/​PulseVideoCard.tsx Connects GenUI to the player.
src/​features/​huddle/​pulseVideoBlock.ts Defines validated card payloads.
src/​features/​huddle/​superChatFeed.ts Emits cards and excludes payloads from search.
src/​features/​clock/​AttachmentsPanel.tsx Renders attachment videos inline.
src/​pages/​Huddle.tsx Registers the GenUI plugin.
tests/​e2e/​huddle/​pulsevault-video.spec.ts Covers Huddle card playback.
tests/​e2e/​tickets/​pulsevault.spec.ts Updates ticket card assertions.
tests/​e2e/​tickets/​helpers.ts Waits for the card after upload.
release-notes/​1.0.5.md Documents inline video cards.
docs/​superchat-inbox-gaps.md Updates the Pulse-card capability status.
.attic/​raw-video-uploads/​README.md Documents backend thumbnail linking.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread meteor-backend/server/huddle.js Resolved
Comment thread meteor-backend/server/pulsevault.js Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Thumbnail metadata read failures are silently swallowed, potentially leaving successfully uploaded posters permanently unlinked.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (2)

Comment thread meteor-backend/server/pulsevault.js Resolved
Comment thread tests/e2e/tickets/pulsevault.spec.ts Resolved
Copilot AI balanced review requested due to automatic review settings October 1, 2026 03:18
@morepriyam
morepriyam force-pushed the feat/pulse-video-cards branch from 7b8b454 to 242ea5d Compare October 1, 2026 03:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Late thumbnails do not refresh already-rendered cards, leaving stale fallback posters until reload.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)

Comment thread meteor-backend/server/pulsevault.js Resolved
Copilot AI balanced review requested due to automatic review settings October 1, 2026 06:51
@morepriyam
morepriyam force-pushed the feat/pulse-video-cards branch from 242ea5d to a73da9c Compare October 1, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Active videos can outlive their cards, and valid longer Pulse titles fail GenUI validation.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (1)

Comment thread src/features/huddle/pulseVideoBlock.ts Resolved
Copilot AI balanced review requested due to automatic review settings October 1, 2026 07:04
@morepriyam
morepriyam force-pushed the feat/pulse-video-cards branch from a73da9c to b107903 Compare October 1, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread src/features/huddle/pulseVideoBlock.ts Resolved
Comment thread tests/e2e/tickets/pulsevault.spec.ts Resolved
Comment thread meteor-backend/server/pulsevault.js Resolved
Comment thread src/features/huddle/superChatFeed.ts Resolved
Copilot AI balanced review requested due to automatic review settings October 1, 2026 07:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The poster lifecycle, inline playback, validation, cleanup, and primary edge cases are coherently implemented and covered by automated tests.

Review effort: Balanced
Findings: 2 Medium severity · 2 Low severity

Open (4)
Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings October 1, 2026 16:36
@morepriyam
morepriyam force-pushed the feat/pulse-video-cards branch from 00b3d72 to d5befca Compare October 1, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Inbox search still indexes JSON from manually authored Pulse video blocks, while API documentation and one cross-post assertion remain incomplete.

Review effort: Balanced
Findings: 3 Medium severity · 2 Low severity

Open (5)

Comment thread src/features/huddle/superChatFeed.ts Resolved
Copilot AI balanced review requested due to automatic review settings October 1, 2026 18:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Search filtering can hide non-Pulse GenUI blocks when a nested property names the Pulse widget.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment on lines +372 to +389
const FENCE = '```';
/**
* A `pulse_video` GenUI block, one line or pretty-printed. Fences are whole
* lines, as in Markdown, so backticks inside the JSON (a title) don't end it.
*/
const PULSE_CARD_BLOCK = new RegExp(
`(^|\\n)${FENCE}genui\\n(?:(?!\\n${FENCE})[\\s\\S])*?"widget"\\s*:\\s*"${PULSE_VIDEO_WIDGET}"(?:(?!\\n${FENCE})[\\s\\S])*\\n${FENCE}(?=\\n|$)`,
'g',
);

/**
* Text as a reader sees it: no markdown link targets and no Pulse card
* payloads, so media URLs, the widget name and artifact ids don't match every
* query. Other GenUI blocks show as code, so their text stays searchable.
*/
function searchableText(text: string): string {
return text.replace(/\]\([^)]*\)/g, ']').replace(PULSE_CARD_BLOCK, '$1');
}
Copilot AI balanced review requested due to automatic review settings October 5, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The search regex can incorrectly remove unrelated GenUI blocks containing a nested Pulse widget field.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

…e a Pulse video shows

A Pulse video shows as its poster frame with a play button, and plays
inline on a tap, instead of a link to a file: in Huddle posts (a
`pulse_video` GenUI widget whose payload is the artifact id only, validated
by zod), on ticket, Redmine and clock-session Videos, and as a timesheet
change's walkthrough in review. Starting one pauses the other; nothing
loads until played.

Ported from the original #616 branch onto main. The poster is PulseVault
0.6's own `GET /artifacts/:id/poster` (the thumbnail related to the video),
so #616's server-side thumbnail linking, backfill and /posters route are
not needed: the poster shows whichever order Pulse uploaded the two in,
and for videos from before this change. Clients can no longer set an
attachment's thumbnail. Every artifact path is built in one place
(pulse-upload/artifact.ts). The e2e checks that looked for a video link
now play the card and check the artifact it loads.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 21:56
@morepriyam
morepriyam force-pushed the feat/pulse-video-cards branch from 557df5e to 2648a59 Compare October 13, 2026 21:56
@morepriyam morepriyam changed the title feat(huddle): Pulse video cards — thumbnail + play, inline, everywhere a Pulse video shows Pulse Videos Play Inline With Their Thumbnail, Wherever They Show Oct 13, 2026
@morepriyam
morepriyam changed the base branch from feat/pulse-only-video to feat/videos-upload-links October 13, 2026 21:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new card rendering breaks a shared E2E helper, and poster and exact-artifact coverage remain incomplete.

4 open findings

🧠 Review effort: Balanced

Comment on lines +113 to +115
{videoId ? (
<figure className="attachment-video min-w-0">
<PulseVideoPlayer video={videoId} title={a.title ?? undefined} />
Comment on lines +24 to +29
await expect(play).toBeVisible({ timeout });
await play.click();
const player = scope.locator(
`.pulse-video-card video[src*="/pulsevault/artifacts/${videoid ?? ''}"]`,
);
await expect(player.first()).toBeVisible();
await expect(post.locator('a[href*="/pulsevault/artifacts/"]')).toBeVisible({
timeout: 10000,
});
await playPulseVideoCard(post);
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