Skip to content

Speedup2#142

Merged
skerbis merged 5 commits into
mainfrom
speedup2
Jul 16, 2026
Merged

Speedup2#142
skerbis merged 5 commits into
mainfrom
speedup2

Conversation

@skerbis

@skerbis skerbis commented Jul 16, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 16, 2026 14:28
@skerbis
skerbis merged commit acc7ff0 into main Jul 16, 2026

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.

Pull request overview

This PR extends the statistics/structure_insights backend page by adding a graphical sitemap (SVG-based) with modal zoom/export controls, while also refactoring parts of the data fetching and date handling for structure insights and export functionality.

Changes:

  • Added a graphical sitemap panel + modal, rendered client-side from the existing structure table.
  • Refactored date parsing to consistently handle SQL datetime strings and UNIX timestamps via DateTimeImmutable.
  • Improved export handling by adding an XLS fallback path for the XLSX (ExcelJS) export flow and switched ExcelJS to a bundled asset.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pages/structure_insights.php Refactors metainfo lookup + date resolution, changes age/latest-edit calculation approach, adds graph panel/modal markup, and enhances export link data attributes.
lang/en_gb.lang Adds i18n strings for the new graphical sitemap UI.
lang/de_de.lang Adds i18n strings for the new graphical sitemap UI.
boot.php Registers new CSS/JS assets for the structure insights graph and switches ExcelJS to a local asset.
assets/structure_insights_graph.js Implements SVG sitemap rendering, modal view, zoom controls, and SVG export.
assets/structure_insights_graph.css Adds styling for the sitemap frame and modal canvas.
assets/structure_insights_export.js Adds XLS fallback download behavior when ExcelJS is unavailable for XLSX export.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

parts.push('<g>');
parts.push('<rect x="' + x + '" y="' + y + '" width="' + w + '" height="' + h + '" rx="12" ry="12" fill="' + fill + '" stroke="#223961" stroke-width="3"/>');
parts.push('<circle cx="' + (x + 14) + '" cy="' + (y + 14) + '" r="6" fill="' + statusColor + '" stroke="#223961" stroke-width="2"/>');
parts.push('<text x="' + (x + 28) + '" y="' + (y + 24) + '" fill="#203556" font-family="Aptos, Segoe UI, sans-serif" font-size="12" font-weight="700">' + escapeXml(kind === 'article' ? 'Artikel' : (kind === 'category' ? 'Kategorie' : 'Root')) + '</text>');
Comment on lines +330 to +331
var emptyText = $container.attr('data-empty-text') || 'Keine Daten vorhanden';
$container.html('<div class="alert alert-info" style="margin-bottom:0;">' + escapeXml(emptyText) + '</div>');
Comment on lines +272 to 277
$cutoff = new DateTimeImmutable('-2 years');
$sql = rex_sql::factory();

$oldCategoryCount = (int) $sql->getValue(
'SELECT COUNT(*) FROM ' . rex::getTable('article')
. ' WHERE clang_id = :clang AND startarticle = 1'
. ' AND COALESCE(NULLIF(updatedate, ""), createdate) <> ""'
. ' AND COALESCE(NULLIF(updatedate, ""), createdate) < :cutoff',
['clang' => $clangId, 'cutoff' => $cutoff],
$ageRows = $sql->getArray(
'SELECT startarticle, updatedate, createdate FROM ' . rex::getTable('article') . ' WHERE clang_id = :clang',
['clang' => $clangId],
);
Comment on lines 471 to +475
$xlsxUrl = '#';

echo '<div style="margin-bottom:10px;display:flex;gap:8px;">';
echo '<a class="btn btn-default js-statistics-structure-export" data-pjax="false" href="' . $csvUrl . '">' . rex_escape($addon->i18n('statistics_structure_export_csv')) . '</a>';
echo '<a class="btn btn-default js-statistics-structure-export" data-export-format="xlsx" data-pjax="false" href="' . $xlsxUrl . '">' . rex_escape($addon->i18n('statistics_structure_export_xlsx')) . '</a>';
echo '<a class="btn btn-default js-statistics-structure-export" data-export-format="xlsx" data-export-fallback-url="' . $xlsUrl . '" data-pjax="false" href="' . $xlsxUrl . '">' . rex_escape($addon->i18n('statistics_structure_export_xlsx')) . '</a>';
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