blob: 2ceaffc5deb398ff4b999c0708888b5c55126538 [file] [edit]
// Copyright (C) 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
@use "../../assets/theme" as *;
.pf-trace-info-page {
overflow-y: auto;
overflow-x: hidden;
padding: 16px;
display: flex;
justify-content: center;
// Inner container for better structure
&__inner {
width: 95%;
max-width: 1400px;
background: var(--pf-color-background);
border-radius: $border-radius-large * 3;
box-shadow: $box-shadow-1;
overflow: hidden;
}
// Header section
&__header {
padding: 24px 28px 20px;
border-bottom: 1px solid var(--pf-color-border);
}
&__header-title {
font-size: 28px;
font-weight: 700;
margin-bottom: 8px;
letter-spacing: -0.02em;
}
&__subtitle {
color: var(--pf-color-text-muted);
font-size: var(--pf-font-size-l);
line-height: 1.5;
}
// Tab content area
&__tab-content {
padding: 16px 28px 24px;
}
&__banner {
margin-bottom: 16px;
}
// Category section headings
&__category-heading {
font-size: var(--pf-font-size-xl);
font-weight: 600;
margin-top: 24px;
margin-bottom: 4px;
color: var(--pf-color-text);
word-break: break-word;
overflow-wrap: break-word;
}
&__category-description {
font-size: var(--pf-font-size-m);
color: var(--pf-color-text-muted);
margin-top: 2px;
margin-bottom: 12px;
line-height: 1.5;
}
// Cards (shared base styles)
&__metric-card,
&__status-card,
&__diagnostic-card {
padding: 12px;
min-height: 110px;
display: flex;
flex-direction: column;
background: var(--pf-color-background-secondary);
}
&__metric-card--wide {
grid-column: span 2;
}
// Status cards with states
&__status-card {
justify-content: center;
}
&__status-card--success {
border-left: 4px solid var(--pf-color-success);
}
&__status-card--warning {
border-left: 4px solid var(--pf-color-warning);
}
&__status-card--danger {
border-left: 4px solid var(--pf-color-danger);
}
&__status-card--notice {
border-left: 4px solid var(--pf-color-primary);
}
&__status-card--clickable {
cursor: pointer;
transition:
transform 0.1s ease-in-out,
box-shadow 0.1s ease-in-out;
&:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
&:active {
transform: translateY(0);
}
}
&__status-icon {
font-size: 28px;
}
&__status-card-main {
display: flex;
align-items: center;
gap: 12px;
}
&__status-content {
flex: 1;
min-width: 0;
}
// Card labels (titles)
&__status-title,
&__metric-label {
font-size: var(--pf-font-size-s);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--pf-color-text);
opacity: 0.7;
line-height: 1.3;
margin-bottom: 12px;
word-break: break-word;
overflow-wrap: break-word;
}
// Card values
&__status-value {
font-size: 36px;
font-weight: 600;
line-height: 1;
}
&__metric-value {
font-size: var(--pf-font-size-xl);
font-weight: 500;
line-height: 1.4;
word-break: break-word;
}
&__status-link {
display: flex;
align-items: center;
opacity: 0.7;
&:hover {
opacity: 1;
}
}
&__status-link-icon {
font-size: var(--pf-font-size-xxl);
}
// Args rendering (import errors detail)
&__args {
display: flex;
flex-direction: column;
gap: 4px;
font-size: var(--pf-font-size-s);
}
&__arg-item {
line-height: 1.4;
}
&__arg-key {
font-weight: 600;
color: var(--pf-color-text);
}
&__arg-value {
font-family: var(--pf-font-monospace);
color: var(--pf-color-text-muted);
white-space: pre-wrap;
overflow-wrap: anywhere;
}
// Logs grid with virtualization
&__logs-grid {
max-height: 500px;
// These logs render multi-line, variable-height content. The default cell
// content is styled for single-line text: its `height: 100%` mis-resolves
// to a fraction of the row and clips content with `overflow: hidden`. Let
// the content size to itself and center it so each entry renders in full
// with even padding within its (estimated) row height.
.pf-grid-cell,
.pf-grid-cell__content {
align-items: center;
}
.pf-grid-cell__content {
height: auto;
}
}
// Overview diagnostic card: severity shown via a coloured left border (colour
// set inline), no score.
&__diagnostic-card {
border-left: 4px solid transparent;
}
&__diagnostic-body {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
&__diagnostic-description {
font-weight: 500;
line-height: 1.4;
}
&__diagnostic-trace {
align-self: flex-start;
font-size: var(--pf-font-size-s);
color: var(--pf-color-text-muted);
background: var(--pf-color-background-secondary);
border-radius: 4px;
}
// Trace Doctor tab: two columns — the problem card on the left, an accented
// "Suggested fix" card on the right, both the same height.
&__diagnostic-row {
display: grid;
grid-template-columns: 1.6fr 1fr;
gap: 16px;
align-items: stretch;
margin-bottom: 12px;
}
&__diagnostic-problem {
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
padding: 12px;
background: var(--pf-color-background-secondary);
border-radius: 4px;
}
// Problem header: mini score bar first, then the title.
&__diagnostic-problem-head {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
}
&__diagnostic-fix {
padding: 12px;
border-radius: 4px;
background: color-mix(in srgb, var(--pf-color-accent) 12%, transparent);
border: 1px solid var(--pf-color-accent);
}
&__diagnostic-fix-head {
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
font-size: var(--pf-font-size-s);
color: var(--pf-color-accent);
margin-bottom: 6px;
}
// Help icon
&__help-icon {
font-size: var(--pf-font-size-m);
margin-left: 6px;
color: var(--pf-color-text-muted);
opacity: 0.6;
cursor: default;
&:hover {
opacity: 1;
}
}
// UI Loading errors
&__loading-errors {
display: flex;
flex-direction: column;
gap: 12px;
}
&__loading-error-item {
display: flex;
gap: 12px;
padding: 12px;
background: var(--pf-color-background-hover);
border-radius: 4px;
border-left: 3px solid var(--pf-color-danger);
font-family: var(--pf-font-monospace);
}
&__loading-error-number {
font-size: var(--pf-font-size-m);
font-weight: 600;
color: var(--pf-color-text-muted);
flex-shrink: 0;
}
&__loading-error-text {
font-size: var(--pf-font-size-s);
line-height: 1.5;
color: var(--pf-color-text);
word-break: break-word;
}
// Stats section wrapper
&__stats-section {
margin: 0;
padding: 0;
}
// ============================================================================
// External component overrides
// These styles override external components for consistent appearance
// ============================================================================
// Override pf-tabs styling
.pf-tabs {
border-bottom: 1px solid var(--pf-color-border);
padding: 0 28px;
.pf-tabs__tab {
font-size: var(--pf-font-size-l);
font-weight: 500;
padding: 14px 18px;
}
}
// Override pf-section styling within tab content
&__tab-content .pf-section {
border: none;
border-radius: 0;
margin-bottom: 28px;
&:last-child {
margin-bottom: 0;
}
header {
border-bottom: none;
margin-bottom: 8px;
padding: 0;
h1 {
font-size: var(--pf-font-size-xxl);
font-weight: 600;
color: var(--pf-color-text);
letter-spacing: -0.01em;
margin-bottom: 4px;
}
}
.pf-section__subtitle {
font-size: var(--pf-font-size-m);
color: var(--pf-color-text-muted);
line-height: 1.4;
margin: 0;
}
article {
padding: 0;
}
}
// Override pf-grid styling for larger fonts
&__tab-content .pf-grid {
font-size: var(--pf-font-size-m);
.pf-grid-header-cell {
font-size: var(--pf-font-size-m);
font-weight: 600;
.pf-grid-header-cell__title-wrapper {
padding: 10px 12px;
}
}
.pf-grid-cell {
font-size: var(--pf-font-size-m);
padding: 10px 12px;
}
}
// Dense key/value grids (metadata, stats), tightened back up from the
// larger-font pf-grid override above.
&__tab-content &__dense-grid.pf-grid {
font-size: var(--pf-font-size-s);
.pf-grid-header-cell {
font-size: var(--pf-font-size-s);
.pf-grid-header-cell__title-wrapper {
padding: 3px 8px;
}
}
.pf-grid-cell {
font-family: var(--pf-font-monospace);
font-size: var(--pf-font-size-s);
padding: 3px 8px;
}
.pf-grid-cell.pf-trace-info-page__grid-key {
font-weight: 700;
}
}
// Override pf-grid-layout for consistent card layout
&__tab-content .pf-grid-layout {
margin-bottom: 0;
gap: 16px;
}
// Override pf-code-snippet styling
&__tab-content .pf-code-snippet pre code {
font-size: var(--pf-font-size-m);
line-height: 1.5;
}
// Generic heading overrides for category sections
// These are used in utils.ts renderCategorySection
&__tab-content h3 {
font-size: var(--pf-font-size-xl);
font-weight: 600;
margin-top: 24px;
margin-bottom: 4px;
color: var(--pf-color-text);
word-break: break-word;
overflow-wrap: break-word;
}
&__tab-content p {
font-size: var(--pf-font-size-m);
color: var(--pf-color-text-muted);
margin-top: 2px;
margin-bottom: 12px;
line-height: 1.5;
}
}
// ============================================================================
// Shared Trace Doctor atoms: the small "Trace config issue" header and its
// mini score bar. Emitted by renderCardHeader()/renderMiniBar() and reused by
// the overview cards, the Trace Doctor tab and the details drawer, so they live
// in their own neutral namespace rather than any one surface's.
// ============================================================================
.pf-trace-doctor {
&__issue-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 12px;
}
&__issue-head-title {
font-size: var(--pf-font-size-s);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.3px;
color: var(--pf-color-text-muted);
white-space: nowrap;
}
&__mini-bar {
flex: 0 0 auto;
width: 48px;
height: 6px;
background: var(--pf-color-background);
border-radius: 3px;
overflow: hidden;
}
&__mini-bar-fill {
height: 100%;
border-radius: 3px;
}
}
// ============================================================================
// Trace Doctor details drawer (bottom tab panel): a compact union of trace
// health + diagnostics, as tiles. Rendered outside the overview page, so it has
// its own root rather than borrowing .pf-trace-info-page.
// ============================================================================
.pf-trace-info-doctor-details-tab {
padding: 12px;
overflow-y: auto;
&__intro {
margin-bottom: 12px;
color: var(--pf-color-text-muted);
font-size: var(--pf-font-size-m);
line-height: 1.4;
}
&__tiles {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 10px;
}
// All tiles are the same fixed height; the grid reflows them as needed.
&__tile {
display: flex;
flex-direction: column;
gap: 4px;
padding: 12px;
height: 100px;
background: var(--pf-color-background-secondary);
border-top: 3px solid transparent;
border-radius: 4px;
}
// Diagnostic tiles span two columns and give the description more room.
&__tile--wide {
grid-column: span 2;
}
&__tile--clickable {
cursor: pointer;
transition:
transform 0.1s ease-in-out,
box-shadow 0.1s ease-in-out;
&:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
&:active {
transform: translateY(0);
}
}
&__tile-title {
font-size: var(--pf-font-size-s);
font-weight: 600;
text-transform: uppercase;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__tile-value {
font-size: 22px;
font-weight: 600;
}
// Diagnostic tile body: the short title. Clamp to 2 lines just in case.
&__tile-desc {
flex: 1;
min-height: 0;
font-size: var(--pf-font-size-m);
line-height: 1.4;
color: var(--pf-color-text);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
}