Skip to content

Commit eef4cb0

Browse files
Dominik Steinacherclaude
andcommitted
refactor(aicoc): drop iframe embed path; fix slack icon
Round-2 review feedback from @rofe on #93: 1. Recording is always a link, never an iframe embed. Removed EMBEDDABLE_HOSTS allowlist and the iframe-building branch in buildRecording(). Recordings now always render as a "Watch recording" button (or "Watch on SharePoint" when the URL is on sharepoint.com). Also removed the .session-header-embed CSS that supported the iframe. 2. Replaced icons/slack.svg with the official Slack monochrome logo. The previous path was malformed; the new one is the recognisable 4-element hash shape. Both lint:js and lint:css continue to pass clean. Also cleaned up an iCloud sync-conflict duplicate `styles/aicoc 2.css` that was tripping stylelint with stale content from before the modern color-function migration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 37ad3ad commit eef4cb0

3 files changed

Lines changed: 9 additions & 51 deletions

File tree

blocks/session-header/session-header.css

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -239,24 +239,6 @@ main .session-header .btn-tertiary {
239239
border-color: rgb(255 255 255 / 30%);
240240
}
241241

242-
/* Inline iframe embed (Stream / YouTube / Vimeo only) */
243-
.session-header-embed {
244-
position: relative;
245-
margin-top: 24px;
246-
width: 100%;
247-
max-width: 720px;
248-
aspect-ratio: 16 / 9;
249-
border-radius: 12px;
250-
overflow: hidden;
251-
box-shadow: 0 12px 40px rgb(0 0 0 / 35%);
252-
}
253-
254-
.session-header-embed iframe {
255-
width: 100%;
256-
height: 100%;
257-
border: 0;
258-
}
259-
260242
/* ── SIDEBAR ──────────────────────────────────────────────────────────── */
261243
.session-header-sidebar {
262244
padding: 28px 32px 8px;

blocks/session-header/session-header.js

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
import { getMetadata, createOptimizedPicture, decorateIcons } from '../../scripts/lib-franklin.js';
22

3-
/**
4-
* Hosts whose URLs can safely be iframe-embedded as a video player.
5-
* Anything else (SharePoint, intranet, unknown) renders as a "Watch recording"
6-
* button that opens in a new tab.
7-
*/
8-
const EMBEDDABLE_HOSTS = new Set([
9-
'web.microsoftstream.com',
10-
'youtube.com',
11-
'www.youtube.com',
12-
'youtu.be',
13-
]);
14-
153
// Icon markers — replaced with inline SVG by decorateIcons() at end of decorate.
164
// SVG sources live in /icons/<name>.svg.
175
const icon = (name) => `<span class="icon icon-${name}"></span>`;
@@ -65,30 +53,18 @@ function splitCommaList(raw) {
6553
}
6654

6755
/**
68-
* Build the recording widget. SharePoint and unknown hosts render as a
69-
* "Watch recording" button (opens in a new tab). Public Stream / YouTube
70-
* URLs become an inline iframe.
56+
* Build the recording button — opens the recording in a new tab.
57+
* SharePoint URLs get a "Watch on SharePoint" label; everything else gets
58+
* "Watch recording".
7159
*/
7260
function buildRecording(url) {
7361
if (!url) return null;
7462
let host = '';
75-
try { host = new URL(url).hostname.toLowerCase(); } catch (_) { /* malformed */ }
76-
77-
if (EMBEDDABLE_HOSTS.has(host)) {
78-
return el(
79-
'div',
80-
{ class: 'session-header-embed' },
81-
el('iframe', {
82-
src: url,
83-
title: 'Session recording',
84-
allowFullscreen: true,
85-
frameBorder: '0',
86-
allow: 'autoplay; encrypted-media; picture-in-picture',
87-
}),
88-
);
63+
try {
64+
host = new URL(url).hostname.toLowerCase();
65+
} catch (_) {
66+
// Malformed URL — fall through with empty host; we still render the link.
8967
}
90-
91-
// Default: SharePoint or unknown → button (opens in a new tab)
9268
const label = host.includes('sharepoint.com') ? 'Watch on SharePoint' : 'Watch recording';
9369
return el('a', {
9470
class: 'btn btn-primary',

icons/slack.svg

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)