Skip to content

Conversation

@trieloff
Copy link
Contributor

Summary

  • Added automatic detection of YouTube chapter timestamps from video descriptions
  • Created chapter UI with clickable deep links to specific video moments
  • Styled chapter markers to match the existing feed design

Details

The implementation parses timestamps (formats like 00:00, 1:23, 1:23:45) from YouTube video descriptions and creates a "Chapters" section below each video thumbnail. Each chapter is a clickable link that opens the YouTube video at the specific timestamp.

Test Plan

Test the changes at: https://youtube-chapter-markers--helix-website--adobe.aem.live/community

The chapter markers should appear for videos that have timestamps in their descriptions. Each timestamp link should open the video at the correct moment.

Related

See discussion in Slack: https://cq-dev.slack.com/archives/C02U1A5480P/p1756141627192249

🤖 Generated with Claude Code

Automatically detect and display chapter timestamps from YouTube video descriptions,
creating deep links to specific moments in videos. Each chapter shows its
timestamp and title, making it easy for users to navigate to specific topics.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Lars Trieloff <lars@trieloff.net>
@aem-code-sync
Copy link

aem-code-sync bot commented Aug 26, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync
Copy link

aem-code-sync bot commented Aug 26, 2025

Page Scores Audits Google
📱 /community PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /community Lighthouse returned error: Something went wrong. PSI

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds automatic detection and display of YouTube chapter markers from video descriptions in the community feed. When a video description contains timestamps, the system now parses them and creates clickable chapter links that navigate to specific moments in the video.

  • Parses timestamp formats (00:00, 1:23, 1:23:45) from video descriptions
  • Creates interactive chapter UI with deep links to specific video moments
  • Adds responsive styling for chapter markers that integrates with existing feed design

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
blocks/feed/feed.js Adds timestamp parsing logic and chapter marker creation functionality
blocks/feed/feed.css Adds responsive styling for chapter markers with hover states and typography

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +25 to +37
let match = timestampRegex.exec(description);

while (match !== null) {
const [, time, title] = match;
const seconds = timeToSeconds(time);
chapters.push({
timestamp: time,
title: title.trim(),
seconds,
url: `${videoUrl}&t=${seconds}s`,
});
match = timestampRegex.exec(description);
}
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

Using exec() with a global regex in a while loop can create an infinite loop if the regex continues to match the same position. Consider using matchAll() or resetting the regex's lastIndex property, or use a non-global regex with match() method instead.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants