asdasd
All checks were successful
Deploy / deploy-staging (push) Successful in 26s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-25 01:56:01 +02:00
parent 99ca2c401c
commit f2357d53b2
3 changed files with 120 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ $skinProfile = $desktopPayload['meta']['skin_profile'];
$wallpaper = $desktopPayload['desktop']['wallpaper'];
$debugShellApp = is_array($desktopPayload['shell']['debug_app'] ?? null) ? $desktopPayload['shell']['debug_app'] : null;
$debugShellLabel = trim((string) ($debugShellApp['label'] ?? 'Debug')) ?: 'Debug';
$sessionDisplayName = (string) ($desktopPayload['session']['display_name'] ?? 'Gast');
$assetVersion = static function (string $publicPath): string {
$filesystemPath = dirname(__DIR__, 2) . '/public' . $publicPath;
@@ -56,6 +57,42 @@ $renderStartIcon = static function (array $profile): string {
default => '<span class="start-glyph start-glyph-label" aria-hidden="true">' . htmlspecialchars((string) ($profile['taskbar_icon'] ?? 'OS'), ENT_QUOTES) . '</span>',
};
};
$buildInitials = static function (string $value): string {
$normalized = trim($value);
if ($normalized === '') {
return 'GU';
}
$parts = preg_split('/\s+/', $normalized) ?: [];
$parts = array_values(array_filter($parts, static fn ($part) => trim((string) $part) !== ''));
if (count($parts) <= 1) {
return strtoupper(substr((string) ($parts[0] ?? $normalized), 0, 2));
}
return strtoupper(substr((string) $parts[0], 0, 1) . substr((string) $parts[1], 0, 1));
};
$renderTrayVisual = static function (array $trayItem, string $displayName = '') use ($buildInitials): string {
$trayId = (string) ($trayItem['id'] ?? '');
$appId = (string) ($trayItem['app_id'] ?? '');
if ($trayId === 'account') {
$initials = htmlspecialchars($buildInitials($displayName), ENT_QUOTES);
return '<span class="tray-avatar" aria-hidden="true">' . $initials . '</span><span class="sr-only">Profil</span>';
}
if ($appId === 'fx-rates') {
return '<span class="tray-icon tray-icon--banknote" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><rect x="3" y="6" width="18" height="12" rx="3"></rect><circle cx="12" cy="12" r="2.5"></circle><path d="M7 9h.01M17 15h.01"></path></svg></span><span class="sr-only">FX</span>';
}
if ($trayId === 'gitea-deploy-status') {
return '<span class="tray-status-dot" aria-hidden="true"></span><span class="sr-only">Gitea Deploy Status</span>';
}
return htmlspecialchars((string) ($trayItem['label'] ?? ''), ENT_QUOTES);
};
?><!DOCTYPE html>
<html lang="de">
<head>
@@ -90,7 +127,7 @@ $renderStartIcon = static function (array $profile): string {
</div>
<div class="system-bar-right">
<?php if (($desktopPayload['session']['is_admin'] ?? false) === true): ?>
<button class="tray-pill tray-pill-button tray-pill-debug" id="debug-toggle-top" type="button" aria-expanded="false"><?= htmlspecialchars($debugShellLabel, ENT_QUOTES) ?></button>
<button class="tray-pill tray-pill-button tray-pill-debug" id="debug-toggle-top" type="button" aria-expanded="false" title="<?= htmlspecialchars($debugShellLabel, ENT_QUOTES) ?>"><span class="tray-icon tray-icon--bug" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M9 7.5V6a3 3 0 0 1 6 0v1.5"></path><path d="M8 10.5h8a2 2 0 0 1 2 2V15a6 6 0 0 1-12 0v-2.5a2 2 0 0 1 2-2Z"></path><path d="M4 13h3M17 13h3M5.5 8.5l2 1.5M18.5 8.5l-2 1.5M7 18l-2 1.5M17 18l2 1.5"></path></svg></span><span class="sr-only"><?= htmlspecialchars($debugShellLabel, ENT_QUOTES) ?></span></button>
<?php endif; ?>
<time id="clock-top"></time>
</div>
@@ -161,15 +198,15 @@ $renderStartIcon = static function (array $profile): string {
<div class="tray">
<?php foreach ($desktopPayload['tray'] as $trayItem): ?>
<button
class="tray-pill tray-pill-button<?= (($trayItem['id'] ?? '') === 'gitea-deploy-status') ? ' tray-pill-status tray-pill-status--idle' : '' ?>"
class="tray-pill tray-pill-button<?= (($trayItem['id'] ?? '') === 'gitea-deploy-status') ? ' tray-pill-status tray-pill-status--idle' : '' ?><?= (($trayItem['id'] ?? '') === 'account') ? ' tray-pill-account' : '' ?>"
type="button"
data-tray-id="<?= htmlspecialchars((string) $trayItem['id'], ENT_QUOTES) ?>"
<?php if (!empty($trayItem['app_id'])): ?>data-tray-app-id="<?= htmlspecialchars((string) $trayItem['app_id'], ENT_QUOTES) ?>" title="<?= htmlspecialchars((string) ($trayItem['title'] ?? $trayItem['label'] ?? ''), ENT_QUOTES) ?>"<?php endif; ?>
<?php if (empty($trayItem['app_id']) && !empty($trayItem['title'])): ?>title="<?= htmlspecialchars((string) $trayItem['title'], ENT_QUOTES) ?>"<?php endif; ?>
><?= htmlspecialchars($trayItem['label'], ENT_QUOTES) ?></button>
<?php if (($trayItem['id'] ?? '') === 'account'): ?>title="<?= htmlspecialchars($sessionDisplayName, ENT_QUOTES) ?>"<?php elseif (empty($trayItem['app_id']) && !empty($trayItem['title'])): ?>title="<?= htmlspecialchars((string) $trayItem['title'], ENT_QUOTES) ?>"<?php endif; ?>
><?= $renderTrayVisual($trayItem, $sessionDisplayName) ?></button>
<?php endforeach; ?>
<?php if (($desktopPayload['session']['is_admin'] ?? false) === true): ?>
<button class="tray-pill tray-pill-button tray-pill-debug" id="debug-toggle" type="button" aria-expanded="false"><?= htmlspecialchars($debugShellLabel, ENT_QUOTES) ?></button>
<button class="tray-pill tray-pill-button tray-pill-debug" id="debug-toggle" type="button" aria-expanded="false" title="<?= htmlspecialchars($debugShellLabel, ENT_QUOTES) ?>"><span class="tray-icon tray-icon--bug" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M9 7.5V6a3 3 0 0 1 6 0v1.5"></path><path d="M8 10.5h8a2 2 0 0 1 2 2V15a6 6 0 0 1-12 0v-2.5a2 2 0 0 1 2-2Z"></path><path d="M4 13h3M17 13h3M5.5 8.5l2 1.5M18.5 8.5l-2 1.5M7 18l-2 1.5M17 18l2 1.5"></path></svg></span><span class="sr-only"><?= htmlspecialchars($debugShellLabel, ENT_QUOTES) ?></span></button>
<?php endif; ?>
<time id="clock"></time>
</div>