feat: admin settings page UI/UX pass with WordPress-native patterns

- Header: h1 + logo in a wrapping flex row, hr.wp-header-end before the tabs,
  aria-current on the active tab; own CSS/JS enqueued only on this screen.
- Verbindung: ordered "So verbindest du Claude" steps, copy button (core
  clipboard.js + wp.a11y.speak), Site-Health-style status list, German details.
- Zugriff: roles as form-table fieldset, connections with site date format,
  empty-state row, confirm on revoke; ConnectionUsage records last use via
  WP_Application_Passwords::record_application_password_usage (once a day).
- Tools: plain-language legend, counter as inline notice, groups as core
  postboxes (postbox.js toggles, per-user closed state, summary when closed),
  fixed column widths with new "Art" column, submit above and below.
- Protokoll: site-timezone times with UTC tooltip, result icons, filters with
  labels in the list table nav, retention link to Limits.
- Limits: short labels with units and descriptions; snapshot count hidden but
  preserved.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-26 16:50:58 +02:00
co-authored by Claude Opus 5.5
parent 5965e32acb
commit 843f45aeec
22 changed files with 1535 additions and 242 deletions
+17 -6
View File
@@ -24,24 +24,35 @@ final class LimitsTabTest extends TestCase
(new LimitsTab())->registerSettings();
}
public function testRendersThreeNumberFieldsWithCurrentValues(): void
public function testRendersVisibleNumberFieldsWithShortLabelsUnitsAndDescriptions(): void
{
Functions\stubEscapeFunctions();
Functions\stubTranslationFunctions();
Functions\when('settings_fields')->justReturn(null);
Functions\when('submit_button')->justReturn(null);
Functions\when('get_option')->justReturn(['upload_mb' => 8]);
Functions\when('get_option')->justReturn(['upload_mb' => 8, 'snapshot_count' => 42]);
Functions\when('wp_max_upload_size')->justReturn(64 * 1024 * 1024);
ob_start();
(new LimitsTab())->render();
$html = (string) ob_get_clean();
self::assertSame(3, substr_count($html, 'type="number"'));
self::assertSame(2, substr_count($html, 'type="number"'));
self::assertStringContainsString('<label for="lit-mcp-upload_mb">Maximale Dateigröße</label>', $html);
self::assertStringContainsString('<label for="lit-mcp-log_retention_days">Protokoll aufbewahren</label>', $html);
self::assertStringContainsString('class="small-text"', $html);
self::assertStringContainsString('<span class="lit-mcp-unit">MB</span>', $html);
self::assertStringContainsString('<span class="lit-mcp-unit">Tage</span>', $html);
self::assertStringContainsString('aria-describedby="lit-mcp-upload_mb-description"', $html);
self::assertStringContainsString('<p class="description" id="lit-mcp-upload_mb-description">Höchstens 32 MB; für Base64-Übertragungen höchstens 10 MB.</p>', $html);
// The snapshot setting is hidden until its feature exists, but its saved value survives a save.
self::assertStringNotContainsString('Designsystem', $html);
self::assertStringNotContainsString('Etappe', $html);
self::assertStringContainsString('<input type="hidden" name="lit_mcp_limits[snapshot_count]" value="42">', $html);
self::assertStringContainsString('name="lit_mcp_limits[upload_mb]" value="8"', $html);
self::assertStringContainsString('name="lit_mcp_limits[log_retention_days]" value="90"', $html);
self::assertStringContainsString('min="1" max="32"', $html);
self::assertStringContainsString('höchstens 32', $html);
self::assertStringContainsString('Höchstens 32', $html);
self::assertStringContainsString('10 MB', $html);
self::assertStringContainsString('min="1" max="3650"', $html);
}
@@ -59,7 +70,7 @@ final class LimitsTabTest extends TestCase
(new LimitsTab())->render();
$html = (string) ob_get_clean();
self::assertStringContainsString('class="description"', $html);
self::assertStringContainsString('notice-warning inline', $html);
self::assertMatchesRegularExpression('/20 MB.*2 MB/s', $html);
}
@@ -76,6 +87,6 @@ final class LimitsTabTest extends TestCase
(new LimitsTab())->render();
$html = (string) ob_get_clean();
self::assertStringNotContainsString('class="description"', $html);
self::assertStringNotContainsString('notice-warning', $html);
}
}