Skip to content

Commit 37b60ac

Browse files
Remove redundant CSS and PHP logic, streamline grid layout, and declutter light theme styles for improved maintainability.
1 parent 04cf077 commit 37b60ac

1 file changed

Lines changed: 45 additions & 116 deletions

File tree

resources/views/error.php

Lines changed: 45 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
$verbose = $verbose ?? '';
1919
$aiModel = $aiModel ?? '';
2020
$fullTitle = trim(($title !== '' ? $title : 'Error') . ($where !== '' ? ' in ' . $where : ''));
21-
$copyText = json_encode($fullTitle, JSON_UNESCAPED_UNICODE);
2221

2322
// pick first available editor link (for toolbar action)
2423
$firstEditor = '';
@@ -43,11 +42,9 @@
4342
--panel-2: #0d1117;
4443
--text: #e6edf3;
4544
--muted: #9fb0c0;
46-
--primary: #0ea5e9; /* cyan-500 */
45+
--primary: #0ea5e9;
4746
--primary-600: #0284c7;
48-
--accent: #f59e0b; /* amber */
49-
--danger: #ef4444; /* red */
50-
--ok: #22c55e; /* green */
47+
--ok: #22c55e;
5148
--border: #263241;
5249
--code-bg: #0b0f14;
5350
--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
@@ -193,30 +190,6 @@
193190
}
194191
}
195192

196-
/* Remove old grid positioning */
197-
.grid > [aria-labelledby="sec-details"],
198-
.grid > [aria-labelledby="sec-suggestions"],
199-
.grid > [aria-labelledby="sec-env"] {
200-
/* No positioning needed with flexbox */
201-
}
202-
203-
.grid > [aria-labelledby="sec-stack"],
204-
.grid > [aria-labelledby="sec-env-details"] {
205-
/* No positioning needed with flexbox */
206-
}
207-
208-
/* Layout tweak when AI features are disabled: place Env details on the right, PHP Error Insight Info on the left,
209-
and make Stack trace span full width on top. This applies only when .no-ai is on the grid container. */
210-
.grid.no-ai > [aria-labelledby="sec-stack"] {
211-
grid-column: 1 / -1;
212-
}
213-
.grid.no-ai > [aria-labelledby="sec-env-details"] {
214-
grid-column: 2;
215-
}
216-
.grid.no-ai > [aria-labelledby="sec-env"] {
217-
grid-column: 1;
218-
}
219-
220193
.card {
221194
background: var(--panel-2);
222195
border: 1px solid var(--border);
@@ -246,7 +219,6 @@
246219
opacity: .95;
247220
}
248221

249-
/* Toolbar inside cards (e.g., Stack trace actions) */
250222
.card > .toolbar {
251223
padding: 8px 12px 0;
252224
}
@@ -336,7 +308,7 @@
336308

337309
.kv {
338310
display: grid;
339-
grid-template-columns: 180px 1fr;
311+
grid-template-columns: 95px 1fr;
340312
gap: 6px 12px;
341313
font-family: var(--mono);
342314
font-size: 12px;
@@ -409,24 +381,6 @@
409381
border-color: #94a3b8;
410382
}
411383

412-
/* Collapsible frames */
413-
.frame.collapsed .code {
414-
display: none;
415-
}
416-
417-
.chev {
418-
display: inline-block;
419-
transform: rotate(90deg);
420-
transition: transform .15s ease;
421-
margin-right: 6px;
422-
color: var(--muted);
423-
}
424-
425-
.frame.collapsed .chev {
426-
transform: rotate(0deg);
427-
}
428-
429-
/* Higher contrast for light theme section header and locations */
430384
.light .card h3 {
431385
background: #f8fafc;
432386
color: #334155;
@@ -436,36 +390,6 @@
436390
color: #334155;
437391
}
438392

439-
/* Copy feedback */
440-
.sr-only {
441-
position: absolute;
442-
width: 1px;
443-
height: 1px;
444-
padding: 0;
445-
margin: -1px;
446-
overflow: hidden;
447-
clip: rect(0 0 0 0);
448-
white-space: nowrap;
449-
border: 0;
450-
}
451-
452-
@keyframes pulseCopied {
453-
0% {
454-
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
455-
}
456-
100% {
457-
box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
458-
}
459-
}
460-
461-
.button.copied {
462-
background: var(--ok);
463-
border-color: #16a34a;
464-
color: #04130a;
465-
animation: pulseCopied .6s ease;
466-
}
467-
468-
/* Light theme code and table contrast tweaks */
469393
.light .code {
470394
background: #ffffff;
471395
}
@@ -494,44 +418,60 @@
494418
color: #0b1220;
495419
}
496420

497-
/* Extra styles for Renderer::renderCodeExcerpt() output */
498-
.code-excerpt {
499-
border-top: 1px solid var(--border);
421+
.light .tab:hover {
422+
background: #e2e8f0;
500423
}
501424

502-
.code-table {
503-
width: 100%;
504-
border-collapse: collapse;
425+
.light .tab.is-active {
426+
background: #ffffff;
427+
border-color: #cbd5e1;
428+
border-bottom-color: #ffffff;
505429
}
506430

507-
.code-table td {
508-
padding: 6px 10px;
431+
/* Collapsible frames */
432+
.frame.collapsed .code {
433+
display: none;
509434
}
510435

511-
.line-number {
512-
width: 1%;
513-
white-space: nowrap;
514-
text-align: right;
515-
color: #9fb0c0;
436+
.chev {
437+
display: inline-block;
438+
transform: rotate(90deg);
439+
transition: transform .15s ease;
440+
margin-right: 6px;
441+
color: var(--muted);
516442
}
517443

518-
.code-content {
519-
width: 99%;
520-
color: #dbe7f3;
444+
.frame.collapsed .chev {
445+
transform: rotate(0deg);
521446
}
522447

523-
.error-line .line-number, .error-line .code-content {
524-
background: rgba(239, 68, 68, .15);
525-
color: #fecaca;
526-
font-weight: 700;
448+
/* Copy feedback */
449+
.sr-only {
450+
position: absolute;
451+
width: 1px;
452+
height: 1px;
453+
padding: 0;
454+
margin: -1px;
455+
overflow: hidden;
456+
clip: rect(0 0 0 0);
457+
white-space: nowrap;
458+
border: 0;
527459
}
528460

529-
.light .line-number {
530-
color: #64748b;
461+
@keyframes pulseCopied {
462+
0% {
463+
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
464+
}
465+
100% {
466+
box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
467+
}
531468
}
532469

533-
.light .code-content {
534-
color: #0b1220;
470+
.button.copied {
471+
background: var(--ok);
472+
border-color: #16a34a;
473+
color: #04130a;
474+
animation: pulseCopied .6s ease;
535475
}
536476

537477
/* Tabs for Environment Details */
@@ -580,16 +520,6 @@
580520
.tabpanel .code {
581521
border: 0;
582522
}
583-
584-
.light .tab:hover {
585-
background: #e2e8f0;
586-
}
587-
588-
.light .tab.is-active {
589-
background: #ffffff;
590-
border-color: #cbd5e1;
591-
border-bottom-color: #ffffff;
592-
}
593523
</style>
594524
<style>
595525
/* tiny icons via CSS only */
@@ -639,8 +569,7 @@
639569
</div>
640570
</header>
641571

642-
<?php $noAi = ($details === '' && empty($suggestions)); ?>
643-
<main class="grid<?= $noAi ? ' no-ai' : '' ?>" aria-live="polite">
572+
<main class="grid" aria-live="polite">
644573
<div class="grid-col-left">
645574
<?php if ($details !== ''): ?>
646575
<section class="card" aria-labelledby="sec-details">
@@ -1002,4 +931,4 @@ function activate(index) {
1002931
})();
1003932
</script>
1004933
</body>
1005-
</html>
934+
</html>

0 commit comments

Comments
 (0)