-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabricroadmap.html
More file actions
657 lines (608 loc) · 30.6 KB
/
Copy pathfabricroadmap.html
File metadata and controls
657 lines (608 loc) · 30.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fabric Roadmap – Microsoft Communications Portal</title>
<script>
(() => {
const param = new URLSearchParams(window.location.search).get("clawpilotTheme");
const theme = param || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
document.documentElement.setAttribute("data-theme", theme);
})();
</script>
<script src="/static/util.js" defer></script>
<link rel="stylesheet" href="/static/common.css">
<link rel="stylesheet" href="/static/roadmap.css">
</head>
<body>
<script src="/static/nav.js" defer></script>
<div class="page-content">
<h1 class="page-heading">Microsoft Fabric Roadmap</h1>
<div class="au-search-bar">
<label for="au-search" class="sr-only">Search features by name or description</label>
<input type="text" class="au-search-input" id="au-search"
placeholder="Search features by name or description…"
aria-label="Search features by name or description" data-act="debouncedSearch" data-on="input">
</div>
<div class="au-filters">
<div class="au-filter-group">
<label class="au-filter-label" id="au-status-filter-label">Status:</label>
<div class="au-multi" id="au-status-multi">
<button type="button" class="au-multi-toggle" aria-haspopup="true" aria-expanded="false" aria-labelledby="au-status-filter-label au-status-label" data-act="toggleMenu" data-menu="au-status-multi">
<span id="au-status-label">All Statuses</span>
<span class="au-multi-caret" aria-hidden="true">▾</span>
</button>
<div class="au-multi-panel" id="au-status-panel">
<div class="au-multi-actions">
<button type="button" data-act="setAllOptions" data-kind="status" data-checked="1">Select all</button>
<button type="button" data-act="setAllOptions" data-kind="status" data-checked="0">Clear</button>
</div>
<div id="au-status-options"></div>
</div>
</div>
</div>
<div class="au-filter-group">
<label class="au-filter-label" id="au-product-filter-label">Product:</label>
<div class="au-multi" id="au-product-multi">
<button type="button" class="au-multi-toggle" aria-haspopup="true" aria-expanded="false" aria-labelledby="au-product-filter-label au-product-label" data-act="toggleMenu" data-menu="au-product-multi">
<span id="au-product-label">All Products</span>
<span class="au-multi-caret" aria-hidden="true">▾</span>
</button>
<div class="au-multi-panel" id="au-product-panel">
<div class="au-multi-actions">
<button type="button" data-act="setAllOptions" data-kind="product" data-checked="1">Select all</button>
<button type="button" data-act="setAllOptions" data-kind="product" data-checked="0">Clear</button>
</div>
<div id="au-product-options"></div>
</div>
</div>
</div>
<div class="au-filter-group">
<label class="au-filter-label" id="au-type-filter-label">Release Type:</label>
<div class="au-multi" id="au-type-multi">
<button type="button" class="au-multi-toggle" aria-haspopup="true" aria-expanded="false" aria-labelledby="au-type-filter-label au-type-label" data-act="toggleMenu" data-menu="au-type-multi">
<span id="au-type-label">All Types</span>
<span class="au-multi-caret" aria-hidden="true">▾</span>
</button>
<div class="au-multi-panel" id="au-type-panel">
<div class="au-multi-actions">
<button type="button" data-act="setAllOptions" data-kind="type" data-checked="1">Select all</button>
<button type="button" data-act="setAllOptions" data-kind="type" data-checked="0">Clear</button>
</div>
<div id="au-type-options"></div>
</div>
</div>
</div>
<div class="au-filter-group">
<label class="au-filter-label" for="au-timerange">Time Range:</label>
<select class="au-filter-select" id="au-timerange" data-act="filterUpdates" data-on="change">
<option value="3">Last 3 months</option>
<option value="6" selected>Last 6 months</option>
<option value="12">Last 12 months</option>
<option value="0">All time</option>
</select>
</div>
<div class="au-filter-group">
<label class="au-filter-label" for="au-sort">Sort:</label>
<select class="au-filter-select" id="au-sort" data-act="filterUpdates" data-on="change">
<option value="timeline-asc">Timeline (earliest)</option>
<option value="timeline-desc">Timeline (latest)</option>
<option value="product">Group by Product</option>
</select>
<label class="au-filter-label" for="au-expand-all" id="au-expand-all-label" style="display:none;align-items:center;gap:0.4rem;cursor:pointer">
<input type="checkbox" id="au-expand-all" data-act="toggleExpandAll" data-on="change">
Expand all
</label>
</div>
<div class="au-filter-group" style="margin-left:auto;gap:0.75rem">
<span id="au-result-count" style="font-size:12px;color:var(--cp-text-muted)"></span>
<button class="export-btn" id="au-export-btn" type="button" data-act="openExportModal">⬇ Export</button>
<button class="export-btn" data-act="loadFabricRoadmap">↻ Refresh</button>
</div>
</div>
<div class="au-cards" id="au-cards-container">
<div class="au-loading" role="status" aria-live="polite">
<div class="spinner" aria-hidden="true"></div>
<span>Loading Fabric Roadmap…</span>
</div>
</div>
</div>
<div class="au-modal-overlay" id="au-modal" data-act="handleModalBackdrop">
<div class="au-modal" role="dialog" aria-modal="true" aria-labelledby="au-modal-title">
<div class="au-modal-header">
<div>
<div class="au-modal-title" id="au-modal-title"></div>
<div class="au-modal-meta" id="au-modal-meta"></div>
</div>
<button class="au-modal-close" data-act="closeUpdate" aria-label="Close">×</button>
</div>
<div class="au-modal-body" id="au-modal-body"></div>
</div>
</div>
<script>
let allUpdates = [];
let currentFiltered = [];
const statusFilter = new Set();
const productFilter = new Set();
const typeFilter = new Set();
if (window.CPActions) window.CPActions.register({
toggleMenu: (e, el) => toggleMenu(el.dataset.menu),
setAllOptions: (e, el) => setAllOptions(el.dataset.kind, el.dataset.checked === '1'),
toggleProductGroup: (e, el) => toggleProductGroup(el),
openUpdate: (e, el) => openUpdate(el.dataset.id),
selectAllExportProducts: (e, el) => selectAllExportProducts(el.dataset.state === '1'),
});
// Quarter sorting helper: converts "Q3 2026" → 20263, "Q1 2025" → 20251
function quarterSortKey(releaseDate) {
if (!releaseDate) return 99999;
const m = /Q(\d)\s+(\d{4})/.exec(releaseDate);
if (!m) return 99999;
return parseInt(m[2]) * 10 + parseInt(m[1]);
}
function statusClass(status) {
const s = (status || '').toLowerCase();
if (s.includes('planned')) return 'planned';
if (s.includes('shipped')) return 'shipped';
return 'unknown';
}
function typeClass(type) {
const t = (type || '').toLowerCase();
if (t.includes('general')) return 'ga';
if (t.includes('preview')) return 'preview';
return '';
}
function stripHtml(html) {
return window.CPUtil ? window.CPUtil.stripHtml(html) : '';
}
async function loadFabricRoadmap() {
const container = document.getElementById('au-cards-container');
container.innerHTML = '<div class="au-loading" role="status" aria-live="polite"><div class="spinner" aria-hidden="true"></div><span>Loading Fabric Roadmap…</span></div>';
try {
const res = await fetch('/api/fabricroadmap');
const data = await res.json();
if (data.error && (!data.items || !data.items.length)) {
container.innerHTML = `<div class="au-empty">⚠️ ${escapeHtml(data.error)}</div>`;
return;
}
allUpdates = (data.items || []).map(item => ({
id: item.ReleaseItemID,
title: item.FeatureName,
description: item.FeatureDescription || '',
product: item.ProductName || '',
status: item.ReleaseStatus || '',
releaseType: item.ReleaseType || '',
releaseDate: item.ReleaseDate || '',
releaseSemester: item.ReleaseSemester || '',
sortKey: quarterSortKey(item.ReleaseDate),
}));
rebuildFilters();
filterUpdates();
} catch (err) {
container.innerHTML = `<div class="au-empty">❌ Failed to load: ${escapeHtml(err.message)}</div>`;
}
}
function rebuildFilters() {
const statuses = new Set();
const products = new Set();
const types = new Set();
allUpdates.forEach(u => {
if (u.status) statuses.add(u.status);
if (u.product) products.add(u.product);
if (u.releaseType) types.add(u.releaseType);
});
const sortedStatuses = [...statuses].sort();
const sortedProducts = [...products].sort((a, b) => a.localeCompare(b));
const sortedTypes = [...types].sort();
renderMultiOptions('au-status-options', sortedStatuses, statusFilter, 'status');
renderMultiOptions('au-product-options', sortedProducts, productFilter, 'product');
renderMultiOptions('au-type-options', sortedTypes, typeFilter, 'type');
updateMultiLabel('status', sortedStatuses, 'Statuses');
updateMultiLabel('product', sortedProducts, 'Products');
updateMultiLabel('type', sortedTypes, 'Types');
}
function renderMultiOptions(containerId, values, selectedSet, kind) {
const c = document.getElementById(containerId);
c.innerHTML = values.map(v => `
<label class="au-multi-option">
<input type="checkbox" data-kind="${kind}" data-value="${escapeHtml(v)}"
${selectedSet.has(v) ? 'checked' : ''}
data-act="onMultiChange" data-on="change">
<span>${escapeHtml(v)}</span>
</label>`).join('');
}
function onMultiChange(ev) {
const kind = ev.target.dataset.kind;
const value = ev.target.dataset.value;
const set = kind === 'status' ? statusFilter : kind === 'product' ? productFilter : typeFilter;
if (ev.target.checked) set.add(value); else set.delete(value);
const containerId = kind === 'status' ? 'au-status-options' : kind === 'product' ? 'au-product-options' : 'au-type-options';
const allKnown = Array.from(document.querySelectorAll(`#${containerId} input`)).map(i => i.dataset.value);
const label = kind === 'status' ? 'Statuses' : kind === 'product' ? 'Products' : 'Types';
updateMultiLabel(kind, allKnown, label);
filterUpdates();
}
function setAllOptions(kind, checked) {
const set = kind === 'status' ? statusFilter : kind === 'product' ? productFilter : typeFilter;
const containerId = kind === 'status' ? 'au-status-options' : kind === 'product' ? 'au-product-options' : 'au-type-options';
const inputs = document.querySelectorAll(`#${containerId} input`);
inputs.forEach(i => {
i.checked = checked;
if (checked) set.add(i.dataset.value); else set.delete(i.dataset.value);
});
const allKnown = Array.from(inputs).map(i => i.dataset.value);
const label = kind === 'status' ? 'Statuses' : kind === 'product' ? 'Products' : 'Types';
updateMultiLabel(kind, allKnown, label);
filterUpdates();
}
function updateMultiLabel(kind, allValues, plural) {
const labelEl = document.getElementById(`au-${kind}-label`);
const set = kind === 'status' ? statusFilter : kind === 'product' ? productFilter : typeFilter;
const total = allValues.length;
const sel = [...set].filter(v => allValues.includes(v));
if (sel.length === 0 || sel.length === total) labelEl.textContent = `All ${plural}`;
else if (sel.length === 1) labelEl.textContent = sel[0];
else labelEl.textContent = `${sel.length} ${plural}`;
}
function toggleMenu(id) {
document.querySelectorAll('.au-multi.open').forEach(el => {
if (el.id !== id) {
el.classList.remove('open');
const t = el.querySelector('.au-multi-toggle');
if (t) t.setAttribute('aria-expanded', 'false');
}
});
const wrap = document.getElementById(id);
const isOpen = wrap.classList.toggle('open');
const toggle = wrap.querySelector('.au-multi-toggle');
if (toggle) toggle.setAttribute('aria-expanded', String(isOpen));
}
document.addEventListener('click', (e) => {
if (e.target.closest && e.target.closest('.au-multi')) return;
document.querySelectorAll('.au-multi.open').forEach(el => {
el.classList.remove('open');
const t = el.querySelector('.au-multi-toggle');
if (t) t.setAttribute('aria-expanded', 'false');
});
});
let __searchTimer = null;
function debouncedSearch() {
clearTimeout(__searchTimer);
__searchTimer = setTimeout(filterUpdates, 150);
}
// Convert "Q3 2026" to a comparable number: 2026 * 4 + 3 = 8107
function quarterToNum(rd) {
const m = /Q(\d)\s+(\d{4})/.exec(rd);
if (!m) return null;
return parseInt(m[2]) * 4 + parseInt(m[1]);
}
function filterUpdates() {
const q = (document.getElementById('au-search').value || '').toLowerCase().trim();
const sort = document.getElementById('au-sort').value;
const timeRange = parseInt(document.getElementById('au-timerange').value) || 0;
const allKnownStatuses = Array.from(document.querySelectorAll('#au-status-options input')).map(i => i.dataset.value);
const allKnownProducts = Array.from(document.querySelectorAll('#au-product-options input')).map(i => i.dataset.value);
const allKnownTypes = Array.from(document.querySelectorAll('#au-type-options input')).map(i => i.dataset.value);
const statusActive = statusFilter.size > 0 && statusFilter.size < allKnownStatuses.length;
const productActive = productFilter.size > 0 && productFilter.size < allKnownProducts.length;
const typeActive = typeFilter.size > 0 && typeFilter.size < allKnownTypes.length;
// Calculate the minimum quarter based on time range
let minQuarterNum = 0;
if (timeRange > 0) {
const cutoff = new Date();
cutoff.setMonth(cutoff.getMonth() - timeRange);
const cutoffQ = Math.ceil((cutoff.getMonth() + 1) / 3);
minQuarterNum = cutoff.getFullYear() * 4 + cutoffQ;
}
let filtered = allUpdates.filter(u => {
if (statusActive && !statusFilter.has(u.status)) return false;
if (productActive && !productFilter.has(u.product)) return false;
if (typeActive && !typeFilter.has(u.releaseType)) return false;
if (minQuarterNum > 0) {
const qn = quarterToNum(u.releaseDate);
if (qn !== null && qn < minQuarterNum) return false;
}
if (q) {
const hay = (u.title + ' ' + u.product + ' ' + u.releaseDate + ' ' + stripHtml(u.description)).toLowerCase();
if (!hay.includes(q)) return false;
}
return true;
});
if (sort === 'timeline-asc') {
filtered.sort((a, b) => a.sortKey - b.sortKey || a.title.localeCompare(b.title));
} else if (sort === 'timeline-desc') {
filtered.sort((a, b) => b.sortKey - a.sortKey || a.title.localeCompare(b.title));
}
currentFiltered = filtered;
document.getElementById('au-result-count').textContent =
`${filtered.length} of ${allUpdates.length}`;
const groupByProduct = sort === 'product';
document.getElementById('au-expand-all-label').style.display = groupByProduct ? 'flex' : 'none';
if (groupByProduct) renderGrouped(filtered);
else renderFlat(filtered);
}
function renderFlat(items) {
const grid = document.getElementById('au-cards-container');
grid.classList.remove('is-grouped');
if (!items.length) { grid.innerHTML = '<div class="au-empty">No features match the filter.</div>'; return; }
grid.innerHTML = items.map(cardHtml).join('');
}
function renderGrouped(items) {
const grid = document.getElementById('au-cards-container');
grid.classList.add('is-grouped');
if (!items.length) { grid.innerHTML = '<div class="au-empty">No features match the filter.</div>'; return; }
const expandAll = !!document.getElementById('au-expand-all').checked;
const groups = new Map();
items.forEach(u => {
const key = (u.product || 'Other').trim();
if (!groups.has(key)) groups.set(key, []);
groups.get(key).push(u);
});
const sortedKeys = [...groups.keys()].sort((a, b) => a.localeCompare(b));
const chevron = '<svg class="au-product-chevron" viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="M3 4.5l3 3 3-3" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
grid.innerHTML = sortedKeys.map(key => {
const list = groups.get(key);
const collapsedClass = expandAll ? '' : ' is-collapsed';
return `
<div class="au-product-group${collapsedClass}">
<div class="au-product-header" role="button" tabindex="0" aria-expanded="${expandAll ? 'true' : 'false'}" data-act="toggleProductGroup">
${chevron}
<span>${escapeHtml(key)}</span>
<span class="au-product-count">${list.length} feature${list.length !== 1 ? 's' : ''}</span>
</div>
<div class="au-product-cards">
${list.map(cardHtml).join('')}
</div>
</div>`;
}).join('');
}
function toggleProductGroup(header) {
const group = header.closest('.au-product-group');
if (!group) return;
const collapsed = group.classList.toggle('is-collapsed');
header.setAttribute('aria-expanded', String(!collapsed));
syncExpandAllCheckbox();
}
function toggleExpandAll() {
const expand = !!document.getElementById('au-expand-all').checked;
document.querySelectorAll('.au-product-group').forEach(g => {
g.classList.toggle('is-collapsed', !expand);
const h = g.querySelector('.au-product-header');
if (h) h.setAttribute('aria-expanded', String(expand));
});
}
function syncExpandAllCheckbox() {
const cb = document.getElementById('au-expand-all');
const groups = document.querySelectorAll('.au-product-group');
if (!groups.length) { cb.checked = false; cb.indeterminate = false; return; }
let expanded = 0;
groups.forEach(g => { if (!g.classList.contains('is-collapsed')) expanded++; });
cb.checked = expanded === groups.length;
cb.indeterminate = expanded > 0 && expanded < groups.length;
}
function cardHtml(u) {
const sc = statusClass(u.status);
const tc = typeClass(u.releaseType);
const snippet = stripHtml(u.description).slice(0, 220);
return `
<div class="au-card" data-act="openUpdate" data-id="${escapeHtml(u.id)}">
<div class="au-card-body">
<div class="au-card-top">
<span class="au-status-pill ${sc}">${escapeHtml(u.status || 'Unknown')}</span>
</div>
<div class="au-card-product">
<span class="au-card-product-dot"></span>
<span>${escapeHtml(u.product)}</span>
</div>
<div class="au-card-title">${escapeHtml(u.title || 'Untitled feature')}</div>
${snippet ? `<div class="au-card-snippet">${escapeHtml(snippet)}</div>` : ''}
<div class="au-card-meta">
${u.releaseType ? `<span class="au-tag-pill ${tc}">${escapeHtml(u.releaseType)}</span>` : ''}
${u.releaseDate ? `<span class="au-tag-pill timeline">${escapeHtml(u.releaseDate)}</span>` : ''}
</div>
</div>
</div>`;
}
function openUpdate(id) {
const u = allUpdates.find(x => String(x.id) === String(id));
if (!u) return;
document.getElementById('au-modal-title').textContent = u.title || 'Feature';
const metaParts = [];
if (u.status) metaParts.push(u.status);
if (u.product) metaParts.push(u.product);
if (u.releaseDate) metaParts.push(u.releaseDate);
document.getElementById('au-modal-meta').textContent = metaParts.join(' · ');
const body = document.getElementById('au-modal-body');
const safeDesc = u.description
? ((window.CPUtil && window.CPUtil.sanitizeHtml) ? window.CPUtil.sanitizeHtml(u.description) : escapeHtml(u.description))
: '<em>No description available.</em>';
body.innerHTML = `
<div class="au-modal-section">
<div class="au-modal-section-title">Details</div>
<dl class="au-detail-list">
<dt>Product</dt><dd>${escapeHtml(u.product)}</dd>
<dt>Status</dt><dd>${escapeHtml(u.status)}</dd>
<dt>Release Type</dt><dd>${escapeHtml(u.releaseType)}</dd>
<dt>Timeline</dt><dd>${escapeHtml(u.releaseDate)}</dd>
${u.releaseSemester ? `<dt>Release Wave</dt><dd>${escapeHtml(u.releaseSemester)}</dd>` : ''}
</dl>
</div>
<div class="au-modal-section">
<div class="au-modal-section-title">Description</div>
<div>${safeDesc}</div>
</div>
`;
document.getElementById('au-modal').classList.add('open');
if (window.CportalAi && window.CportalAi.isEnabled()) {
window.CportalAi.attachToModal(body, 'fabricroadmap', u);
}
}
function closeUpdate() {
document.getElementById('au-modal').classList.remove('open');
}
function handleModalBackdrop(ev) {
if (ev.target.id === 'au-modal') closeUpdate();
}
document.addEventListener('keydown', (ev) => {
if (ev.key === 'Escape') closeUpdate();
});
// ════════════════════════════════════════════════
// GENERATE EXPORT MODAL
// ════════════════════════════════════════════════
const EXPORT_MODAL_CONFIG = {
getAllRows: () => allUpdates || [],
getProducts: (u) => u && u.product ? [u.product] : [],
getDate: () => null, // Fabric uses quarters, not exact dates
runExport: (rows, format) => exportFabricRoadmapToHtml(rows, format),
};
const EXPORT_UNCLASSIFIED = '(Unclassified)';
function getExportProducts(row) {
const arr = (EXPORT_MODAL_CONFIG.getProducts(row) || []).map(p => String(p || '').trim()).filter(Boolean);
return arr.length ? arr : [EXPORT_UNCLASSIFIED];
}
function openExportModal() {
const rows = EXPORT_MODAL_CONFIG.getAllRows() || [];
if (!rows.length) { alert('Data is still loading. Please try again in a moment.'); return; }
const set = new Set();
rows.forEach(r => getExportProducts(r).forEach(p => set.add(p)));
const products = Array.from(set).sort((a, b) => {
if (a === EXPORT_UNCLASSIFIED) return 1;
if (b === EXPORT_UNCLASSIFIED) return -1;
return a.localeCompare(b);
});
const list = document.getElementById('gen-product-list');
if (!products.length) {
list.innerHTML = '<div class="gen-empty">No products found.</div>';
} else {
list.innerHTML = products.map(p => {
const safe = p.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
return `<label data-product="${safe.toLowerCase()}"><input type="checkbox" value="${safe}" checked data-act="updateExportCount" data-on="change"> ${safe}</label>`;
}).join('');
}
document.getElementById('gen-product-search').value = '';
filterExportProductSearch();
updateExportCount();
document.getElementById('gen-modal').hidden = false;
if (window.trapFocus) trapFocus(document.getElementById('gen-modal'));
}
function closeExportModal() { if (window.releaseFocus) releaseFocus(); const el = document.getElementById('gen-modal'); if (el) el.hidden = true; }
function selectAllExportProducts(state) {
document.querySelectorAll('#gen-product-list input[type="checkbox"]').forEach(cb => {
const label = cb.closest('label');
if (!label || label.style.display !== 'none') cb.checked = state;
});
updateExportCount();
}
function filterExportProductSearch() {
const q = (document.getElementById('gen-product-search').value || '').toLowerCase().trim();
document.querySelectorAll('#gen-product-list label').forEach(l => {
l.style.display = (!q || (l.dataset.product || '').includes(q)) ? '' : 'none';
});
}
function getSelectedExportProducts() {
return new Set(Array.from(document.querySelectorAll('#gen-product-list input[type="checkbox"]:checked')).map(cb => cb.value));
}
function computeExportRows() {
const selected = getSelectedExportProducts();
const all = EXPORT_MODAL_CONFIG.getAllRows() || [];
return all.filter(row => {
const prods = getExportProducts(row);
return prods.some(p => selected.has(p));
});
}
function updateExportCount() {
const n = computeExportRows().length;
const el = document.getElementById('gen-count');
if (el) el.textContent = `${n} item${n === 1 ? '' : 's'} match`;
}
function submitExportModal() {
const rows = computeExportRows();
if (!rows.length) { alert('No items match the selected filters.'); return; }
const format = (document.querySelector('input[name="gen-format"]:checked') || {}).value || 'html';
closeExportModal();
EXPORT_MODAL_CONFIG.runExport(rows, format);
}
// ════════════════════════════════════════════════
// EXPORT
// ════════════════════════════════════════════════
function exportFabricRoadmapToHtml(customRows, format) {
const rows = (customRows && customRows.length) ? customRows : (currentFiltered || []);
if (!rows.length) { alert('No features to export with current filters.'); return; }
if (!window.ExportFormats || !window.OutlookExport) { alert('Export helper still loading. Please try again in a moment.'); return; }
const btn = document.getElementById('au-export-btn');
if (btn) { btn.disabled = true; btn.textContent = '…Exporting'; }
const tableRows = rows.map(u => {
return [
u.product || '—',
u.title || '—',
u.status || '—',
u.releaseType || '—',
u.releaseDate || '—',
u.releaseSemester || '—',
stripHtml(u.description) || '—',
];
});
const now = new Date().toLocaleString();
window.ExportFormats.download({
title: 'Microsoft Fabric Roadmap',
subtitle: 'Exported ' + now + ' • ' + rows.length + ' feature' + (rows.length !== 1 ? 's' : ''),
baseFilename: 'fabric-roadmap-export-' + new Date().toISOString().slice(0, 10),
columns: ['Product', 'Feature', 'Status', 'Release Type', 'Timeline', 'Release Wave', 'Description'],
rows: tableRows,
format: format || 'html',
});
if (btn) { btn.disabled = false; btn.textContent = '⬇ Export'; }
}
loadFabricRoadmap();
// ── AI insights ──────────────────────────────────────────────────────
if (window.CportalAi) {
window.CportalAi.init({
source: 'fabricroadmap',
panelMountSelector: '#au-cards-container',
onTopItemClick: (id) => openUpdate(id),
});
}
</script>
<!-- Generate Export modal -->
<div class="gen-modal" id="gen-modal" hidden>
<div class="gen-modal-backdrop" data-act="closeExportModal"></div>
<div class="gen-modal-dialog" role="dialog" aria-modal="true" aria-labelledby="gen-modal-title">
<header class="gen-modal-header">
<h3 class="gen-modal-title" id="gen-modal-title">Export</h3>
<button class="gen-modal-close" type="button" data-act="closeExportModal" aria-label="Close">×</button>
</header>
<div class="gen-modal-body">
<div class="gen-field">
<span class="gen-field-label">Format</span>
<div class="gen-format-group" role="radiogroup" aria-label="Export format">
<label><input type="radio" name="gen-format" value="html" checked> HTML</label>
<label><input type="radio" name="gen-format" value="md"> Markdown</label>
<label><input type="radio" name="gen-format" value="pdf"> PDF</label>
<label><input type="radio" name="gen-format" value="docx"> Word</label>
</div>
<p class="gen-format-note">PDF opens a print dialog (choose "Save as PDF"). Word export opens in Word / LibreOffice.</p>
</div>
<div class="gen-field">
<span class="gen-field-label">Products</span>
<div class="gen-product-controls">
<button type="button" class="gen-quick" data-act="selectAllExportProducts" data-state="1">Select all</button>
<button type="button" class="gen-quick" data-act="selectAllExportProducts" data-state="0">Clear</button>
<input type="search" id="gen-product-search" placeholder="Filter products…" data-act="filterExportProductSearch" data-on="input" aria-label="Filter products">
</div>
<div class="gen-product-list" id="gen-product-list"></div>
</div>
</div>
<footer class="gen-modal-footer">
<span class="gen-count" id="gen-count">0 items match</span>
<button type="button" class="gen-cancel-btn" data-act="closeExportModal">Cancel</button>
<button type="button" class="export-btn" id="gen-generate-btn" data-act="submitExportModal">Generate</button>
</footer>
</div>
</div>
<script src="/static/product-icons.js" defer></script>
<script src="/static/outlook-export.js" defer></script>
<script src="/static/export-formats.js" defer></script>
<script src="/static/ai-insights.js" defer></script>
<script src="/static/subscription-picker.js" defer></script>
</body>
</html>