diff --git a/src/components/httprequestviewer/RequestRowDetails.tsx b/src/components/httprequestviewer/RequestRowDetails.tsx index 30ea7b2..ad683ac 100644 --- a/src/components/httprequestviewer/RequestRowDetails.tsx +++ b/src/components/httprequestviewer/RequestRowDetails.tsx @@ -8,7 +8,8 @@ import { getTotalResponseTimeColor, getQueueAnalysisIcon, getCDNIcon, - getCDNDisplayName + getCDNDisplayName, + getPriorityIcon } from './lib/colorUtils' interface RequestRowDetailsProps { @@ -27,7 +28,12 @@ const RequestRowDetails: React.FC = ({ request }) => {
Request ID: {request.requestId}
Method: {request.method}
-
Priority: {request.priority}
+
+ Priority: + + {getPriorityIcon(request.priority)} {request.priority || '-'} + +
MIME Type: {request.mimeType || '-'}
Content-Length: {request.contentLength ? formatSize(request.contentLength) : '-'}
From Cache: {request.fromCache ? 'Yes' : 'No'}
diff --git a/src/components/httprequestviewer/RequestRowSummary.module.css b/src/components/httprequestviewer/RequestRowSummary.module.css index 89565d1..018e882 100644 --- a/src/components/httprequestviewer/RequestRowSummary.module.css +++ b/src/components/httprequestviewer/RequestRowSummary.module.css @@ -19,11 +19,34 @@ td { padding: 2px 8px; border-radius: var(--radius-md); + border: 1px solid var(--color-bg); } tr { border: 1px solid #ffffff; } + +tr:hover, tr:hover td { + border: 1px dashed var(--color-bg-hover); +} +tr:hover { + filter: brightness(290%); +} a { color: var(--color-text); text-decoration: none; +} + +/* Priority cell styling to prevent wrapping */ +.priorityCell { + white-space: nowrap; + min-width: 120px; + width: 120px; + text-align: center; +} + +.priorityCell span { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 4px; } \ No newline at end of file diff --git a/src/components/httprequestviewer/RequestRowSummary.tsx b/src/components/httprequestviewer/RequestRowSummary.tsx index 640d2bb..c5c8c7a 100644 --- a/src/components/httprequestviewer/RequestRowSummary.tsx +++ b/src/components/httprequestviewer/RequestRowSummary.tsx @@ -13,7 +13,10 @@ import { getSizeClass, getQueueAnalysisIcon, getCDNIcon, - getCDNDisplayName, getProtocolClass, getConnectionClass + getCDNDisplayName, + getPriorityIcon, + getProtocolClass, + getConnectionClass } from './lib/colorUtils' import { truncateUrl } from './lib/urlUtils' @@ -47,8 +50,11 @@ const RequestRowSummary: React.FC = ({ {request.resourceType} - - {request.priority || '-'} + + + {getPriorityIcon(request.priority)} + {request.priority || '-'} + diff --git a/src/components/httprequestviewer/lib/colorUtils.ts b/src/components/httprequestviewer/lib/colorUtils.ts index 1d01492..8871e08 100644 --- a/src/components/httprequestviewer/lib/colorUtils.ts +++ b/src/components/httprequestviewer/lib/colorUtils.ts @@ -165,4 +165,18 @@ export const getCDNDisplayName = (provider: CDNAnalysis['provider']): string => case 'keycdn': return 'KeyCDN' default: return 'Unknown CDN' } +} + +export const getPriorityIcon = (priority?: string): string => { + if (!priority) return '➖' + + const upperPriority = priority.toUpperCase() + switch (upperPriority) { + case 'VERYHIGH': return '🔥' // Very high priority - fire/urgent + case 'HIGH': return '🔺' // High priority - red triangle up + case 'MEDIUM': return '🟡' // Medium priority - yellow circle + case 'LOW': return '🔹' // Low priority - red triangle down + case 'VERYLOW': return '🐢' // Very low priority - small blue diamond + default: return '➖' // Unknown/empty priority + } } \ No newline at end of file diff --git a/src/components/shared/Tooltip.tsx b/src/components/shared/Tooltip.tsx index 283d16f..d195da5 100644 --- a/src/components/shared/Tooltip.tsx +++ b/src/components/shared/Tooltip.tsx @@ -23,66 +23,23 @@ export function Tooltip({ children, type }: TooltipProps) { return ( <> -
+
{children} setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} - onClick={handleIconClick} - style={{ - marginLeft: '6px', - cursor: 'pointer', - color: '#007bff', - fontSize: '14px', - fontWeight: 'bold', - width: '16px', - height: '16px', - borderRadius: '50%', - backgroundColor: '#e3f2fd', - display: 'inline-flex', - alignItems: 'center', - justifyContent: 'center', - userSelect: 'none', - transition: 'all 0.2s ease', - border: '1px solid transparent' - }} - onMouseDown={(e) => { - e.currentTarget.style.backgroundColor = '#bbdefb' - e.currentTarget.style.borderColor = '#2196f3' - }} - onMouseUp={(e) => { - e.currentTarget.style.backgroundColor = '#e3f2fd' - e.currentTarget.style.borderColor = 'transparent' - }} - > + onClick={handleIconClick}> ? {/* Hover tooltip - only show when not modal open */} {isHovered && !isModalOpen && ( -
-
+
+
{title}
-
+
{description}
-
+
Click for detailed information
@@ -95,113 +52,45 @@ export function Tooltip({ children, type }: TooltipProps) { onClose={() => setIsModalOpen(false)} title={title} > -
-
+
+
{description}
{lighthouseRelation && ( -
-
+
+
🎯 Lighthouse Relationship
-
+
{lighthouseRelation}
)} {calculation && ( -
-
+
+
🧮 Calculation
-
+
{calculation}
)} {links && links.length > 0 && ( -
-
+
+
📚 Learn More
-
+
{links.map((link, index) => ( { - e.currentTarget.style.backgroundColor = '#e3f2fd' - e.currentTarget.style.borderColor = '#2196f3' - e.currentTarget.style.transform = 'translateY(-1px)' - e.currentTarget.style.boxShadow = '0 2px 4px rgba(0,0,0,0.1)' - }} - onMouseLeave={(e) => { - e.currentTarget.style.backgroundColor = 'white' - e.currentTarget.style.borderColor = '#e3f2fd' - e.currentTarget.style.transform = 'translateY(0)' - e.currentTarget.style.boxShadow = 'none' - }} - > + rel="noopener noreferrer"> 🔗 {link.text} ))} diff --git a/src/components/shared/tooltipDefinitions.ts b/src/components/shared/tooltipDefinitions.ts index 4fc5071..0ffba8e 100644 --- a/src/components/shared/tooltipDefinitions.ts +++ b/src/components/shared/tooltipDefinitions.ts @@ -85,7 +85,7 @@ export const TOOLTIP_DEFINITIONS: Record = [TooltipType.REQUEST_PRIORITY]: { title: "Request Priority", - description: "Browser's internal priority for this request: VeryHigh, High, Medium, Low, VeryLow. Determines resource loading order.", + description: "Browser's internal priority for this request. Icons: 🔥 VeryHigh, 🔺 High, 🟡 Medium, 🔹 Low, 🐢 VeryLow. Determines resource loading order.", lighthouseRelation: "High priority resources are critical for LCP and FCP. Low priority resources should not block critical content.", links: [ { text: "Resource Prioritization", url: "https://web.dev/articles/resource-prioritization" },