From: Javier Sagredo Date: Sun, 3 May 2026 16:41:35 +0000 (+0200) Subject: viewer: search bar, pin/mute/filter panels, splitter, equality preds, clean type... X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=fb9e4e8da9a2b84393d0078495e96f52929f533f;p=classgraph.git viewer: search bar, pin/mute/filter panels, splitter, equality preds, clean type printing --- diff --git a/data/viewer.css b/data/viewer.css index 840e544..1bfaf41 100644 --- a/data/viewer.css +++ b/data/viewer.css @@ -45,6 +45,67 @@ body { display: flex; } #back-button:hover { background: #f3f4f6; } #back-button[hidden] { display: none; } +#pin-chips { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 6px; + flex: 1 1 auto; + min-width: 0; +} +#pin-chips[hidden] { display: none; } +#pin-label { + font-size: 11px; + text-transform: uppercase; + letter-spacing: 0.04em; + color: #6b7280; + font-weight: 600; +} +#pin-list { + display: contents; +} +.pin-chip { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 2px 4px 2px 10px; + background: #dbeafe; + color: #1e40af; + font-size: 12px; + font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; + border-radius: 12px; + max-width: 220px; +} +.pin-chip .chip-name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.pin-chip button { + appearance: none; + border: 0; + background: transparent; + padding: 0 4px; + margin: 0; + font-size: 14px; + line-height: 1; + cursor: pointer; + color: #1e3a8a; + border-radius: 50%; +} +.pin-chip button:hover { background: rgba(30, 58, 138, 0.15); } +#pin-clear { + appearance: none; + border: 1px solid #cbd5e1; + background: #fff; + color: #475569; + font-size: 11px; + padding: 2px 8px; + border-radius: 4px; + cursor: pointer; +} +#pin-clear:hover { background: #f1f5f9; } + #search-wrap { position: relative; margin-left: auto; @@ -94,6 +155,66 @@ body { display: flex; } #search-results li:hover, #search-results li.active { background: #eff6ff; } +#search-results li { + /* override defaults for the new two-column layout */ + flex-direction: row; + justify-content: space-between; + align-items: center; + gap: 8px; +} +#search-results .row-content { + display: flex; + flex-direction: column; + gap: 2px; + min-width: 0; + flex: 1 1 auto; +} +#search-results .pin-add { + appearance: none; + border: 1px solid transparent; + background: transparent; + color: #64748b; + font-size: 14px; + cursor: pointer; + padding: 2px 6px; + border-radius: 4px; + flex-shrink: 0; +} +#search-results .pin-add:hover { + background: #dbeafe; + color: #1e40af; + border-color: #bfdbfe; +} +#search-results .pin-add.pinned { + color: #1e40af; + background: #dbeafe; +} +#search-results .mute-add { + appearance: none; + border: 1px solid transparent; + background: transparent; + color: #92400e; + font-size: 14px; + cursor: pointer; + padding: 2px 6px; + border-radius: 4px; + flex-shrink: 0; +} +#search-results .mute-add:hover { + background: #fed7aa; + color: #7c2d12; + border-color: #fdba74; +} +#search-results .mute-add.muted { + color: #7c2d12; + background: #fed7aa; +} +#search-results .row-actions { + display: inline-flex; + align-items: center; + gap: 2px; + flex-shrink: 0; +} #search-results .name { font-weight: 600; color: #111827; @@ -129,6 +250,27 @@ body { display: flex; } min-height: 0; } +#splitter { + flex: 0 0 6px; + height: 100vh; + background: #e5e7eb; + cursor: ew-resize; + position: relative; + user-select: none; +} +#splitter:hover, #splitter.dragging { background: #93c5fd; } +#splitter::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + width: 2px; + height: 32px; + background: #94a3b8; + border-radius: 1px; + transform: translate(-50%, -50%); +} + #panel { width: 340px; flex: 0 0 auto; @@ -153,3 +295,151 @@ body { display: flex; } #selected li { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; } footer { margin-top: 24px; padding-top: 12px; border-top: 1px solid #eee; font-size: 11px; color: #999; } + +#mute-filter { + margin: 0 0 12px; + border: 1px solid #e5e7eb; + border-radius: 6px; + background: #fff7ed; +} +#mute-filter summary { + padding: 8px 12px; + font-size: 12px; + font-weight: 600; + color: #7c2d12; + cursor: pointer; + outline: none; + user-select: none; +} +.mute-hint { + margin: 0 12px 8px; + font-size: 11px; + color: #92400e; + line-height: 1.5; +} +.mute-hint code { + background: #fde68a; + padding: 0 4px; + border-radius: 3px; +} +#mute-list { + margin: 0 0 8px; + padding: 0 12px; + list-style: none; + display: flex; + flex-wrap: wrap; + gap: 4px; +} +.mute-chip { + display: inline-flex; + align-items: center; + gap: 2px; + padding: 2px 4px 2px 8px; + background: #fed7aa; + color: #7c2d12; + font-size: 11px; + font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; + border-radius: 10px; + max-width: 100%; +} +.mute-chip .chip-name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.mute-chip button { + appearance: none; + border: 0; + background: transparent; + padding: 0 4px; + font-size: 13px; + cursor: pointer; + color: #7c2d12; + border-radius: 50%; +} +.mute-chip button:hover { background: rgba(124, 45, 18, 0.15); } + +#instance-filter { + margin: 0 0 16px; + border: 1px solid #e5e7eb; + border-radius: 6px; + background: #f9fafb; +} +#instance-filter[hidden] { display: none; } +#instance-filter summary { + padding: 8px 12px; + font-size: 12px; + font-weight: 600; + color: #1f2937; + cursor: pointer; + outline: none; + user-select: none; +} +#instance-filter summary::-webkit-details-marker { color: #6b7280; } +#filter-summary { color: inherit; } +.filter-controls { + display: flex; + flex-wrap: wrap; + gap: 6px; + padding: 0 12px 8px; +} +.filter-controls button { + appearance: none; + border: 1px solid #d1d5db; + background: #fff; + color: #374151; + font-size: 11px; + padding: 3px 8px; + border-radius: 3px; + cursor: pointer; +} +.filter-controls button:hover { background: #f3f4f6; } +#filter-search { + flex: 1 1 auto; + min-width: 100px; + padding: 3px 8px; + font-size: 11px; + border: 1px solid #d1d5db; + border-radius: 3px; + outline: none; + background: #fff; + color: #111827; +} +#filter-search:focus { border-color: #3b82f6; } +#filter-list { + margin: 0; + padding: 4px 6px 8px; + list-style: none; + max-height: 40vh; + overflow-y: auto; +} +#filter-list li { + display: flex; + align-items: flex-start; + gap: 6px; + padding: 4px 6px; + font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; + font-size: 12px; + cursor: pointer; + border-radius: 3px; +} +#filter-list li.hidden-row { display: none; } +#filter-list li:hover { background: #eef2ff; } +#filter-list label { + display: flex; + align-items: flex-start; + gap: 6px; + flex: 1 1 auto; + cursor: pointer; + min-width: 0; +} +#filter-list label .head { + /* Wrap long instance heads onto multiple lines so the user can read + them even when the panel is narrow. */ + white-space: normal; + word-break: break-word; + line-height: 1.4; + color: #111827; +} +#filter-list label.unchecked .head { color: #9ca3af; text-decoration: line-through; } +#filter-list input[type="checkbox"] { margin: 3px 0 0; flex-shrink: 0; } diff --git a/data/viewer.html b/data/viewer.html index 98f851f..2ef7b8f 100644 --- a/data/viewer.html +++ b/data/viewer.html @@ -11,13 +11,19 @@

classgraph

+
- +
+