Files
x0x0b 4639cc7905 feat: show meta info (#30)
* feat: store prompt payload in metadata and show in viewer

* feat: enhance model parameter extraction for CheckpointLoader

* feat: improve metadata comparison by ignoring specific keys

* feat: remove tag

* lint

* feat: remove unused tag styles from CSS
2025-12-24 13:21:47 +09:00

887 lines
17 KiB
CSS

.phg-container {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.5rem;
font-size: 0.85rem;
color: var(--p-text-color);
}
.phg-message {
padding: 0.5rem;
border-radius: 0.5rem;
background: rgba(255, 255, 255, 0.04);
color: var(--p-text-color);
}
.phg-message--error {
color: var(--p-red-300, #fca5a5);
}
.phg-message--empty {
font-style: italic;
opacity: 0.8;
}
.phg-entries {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
/* --- Tabs --- */
.phg-tabs {
display: flex;
align-items: center;
gap: 0.25rem;
background: rgba(0, 0, 0, 0.2);
padding: 0.25rem;
border-radius: 9999px;
border: 1px solid rgba(255, 255, 255, 0.06);
}
.phg-tab-button {
appearance: none;
background: transparent;
border: none;
color: var(--p-text-color, #e5e7eb);
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.02em;
padding: 0.35rem 1rem;
border-radius: 9999px;
cursor: pointer;
opacity: 0.65;
transition: all 0.2s ease;
}
.phg-tab-button:hover {
opacity: 0.9;
background: rgba(255, 255, 255, 0.04);
}
.phg-tab-button[data-active="true"] {
background: var(--p-primary-color, #38bdf8);
color: #0f172a; /* Dark text on primary color for contrast */
opacity: 1;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* --- Settings Panel (Redesigned) --- */
.phg-settings-container {
display: flex;
flex-direction: column;
gap: 1.5rem;
padding: 1rem 1.5rem;
flex: 1;
min-height: 0;
overflow-y: auto;
max-width: 720px;
width: 100%;
margin: 0 auto;
}
.phg-settings-group {
display: flex;
flex-direction: column;
gap: 0; /* Items handle their own spacing/border */
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: 12px;
overflow: hidden;
flex-shrink: 0;
}
.phg-settings-group__content {
display: flex;
flex-direction: column;
}
.phg-settings-group__header {
padding: 1rem 1.25rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
background: rgba(255, 255, 255, 0.02);
}
.phg-settings-group__header--row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.75rem;
}
.phg-settings-group__title {
font-size: 0.95rem;
font-weight: 600;
color: var(--p-text-color, #e5e7eb);
letter-spacing: 0.01em;
}
.phg-settings-item {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
padding: 1rem 1.25rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.phg-settings-item:last-child {
border-bottom: none;
}
.phg-settings-item--col {
flex-direction: column;
align-items: stretch;
gap: 0.75rem;
}
.phg-settings-item__info {
display: flex;
flex-direction: column;
gap: 0.25rem;
flex: 1;
}
.phg-settings-item__label {
font-size: 0.9rem;
font-weight: 500;
color: var(--p-text-color, #e5e7eb);
}
.phg-settings-item__header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.phg-settings-control {
display: flex;
align-items: center;
flex-shrink: 0;
}
/* Custom Range Slider */
.phg-range-wrapper {
display: flex;
align-items: center;
gap: 1rem;
width: 100%;
}
.phg-range {
flex: 1;
appearance: none;
-webkit-appearance: none;
background: transparent;
height: 24px;
cursor: pointer;
margin: 0 0.5rem; /* Add horizontal margin to prevent thumb clipping */
}
.phg-range::-webkit-slider-runnable-track {
width: 100%;
height: 4px;
background: rgba(255, 255, 255, 0.2);
border-radius: 9999px;
border: none;
}
.phg-range::-webkit-slider-thumb {
-webkit-appearance: none;
height: 18px;
width: 18px;
border-radius: 50%;
background: var(--p-primary-color, #38bdf8);
margin-top: -7px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
transition: transform 0.1s ease;
position: relative; /* Ensure z-index works if needed */
z-index: 2;
}
.phg-range:hover::-webkit-slider-thumb {
transform: scale(1.1);
background: var(--p-primary-color, #7dd3fc);
}
.phg-range:focus::-webkit-slider-thumb {
box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}
.phg-range-value {
font-size: 0.85rem;
font-variant-numeric: tabular-nums;
color: var(--p-text-color, #e5e7eb);
min-width: 4.5ch;
text-align: right;
opacity: 1;
font-weight: 500;
padding-left: 0.5rem;
}
/* Custom Toggle Switch */
.phg-toggle {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
flex-shrink: 0;
}
.phg-toggle input {
opacity: 0;
width: 0;
height: 0;
}
.phg-toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(255, 255, 255, 0.15);
border-radius: 24px;
transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.phg-toggle-slider:before {
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 2px;
bottom: 2px;
background-color: white;
border-radius: 50%;
transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.phg-toggle input:checked + .phg-toggle-slider {
background-color: var(--p-primary-color, #38bdf8);
}
.phg-toggle input:checked + .phg-toggle-slider:before {
transform: translateX(20px);
}
.phg-settings-footer {
margin-top: 2rem;
padding-top: 1rem;
display: flex;
justify-content: center;
flex-shrink: 0;
}
.phg-entry {
border-radius: 0.75rem;
border: 1px solid rgba(255, 255, 255, 0.05);
background: rgba(0, 0, 0, 0.15);
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.phg-entry-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
font-size: 0.75rem;
letter-spacing: 0.01em;
text-transform: uppercase;
opacity: 0.7;
}
.phg-entry-actions {
display: flex;
gap: 0.25rem;
}
.phg-action-button {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
}
.phg-action-button .pi {
font-size: 0.95rem;
}
.phg-action-button:disabled .pi {
opacity: 0.6;
}
.phg-action-badge {
position: absolute;
top: -0.25rem;
right: -0.25rem;
transform: translate(40%, -40%);
font-size: 0.65rem;
pointer-events: none;
}
.phg-entry-prompt {
white-space: pre-wrap;
font-family: var(--p-font-family, inherit);
font-size: 0.85rem;
line-height: 1.4;
background: rgba(0, 0, 0, 0.2);
padding: 0.5rem;
border-radius: 0.5rem;
margin: 0;
}
.phg-entry-meta {
font-size: 0.75rem;
opacity: 0.8;
}
/* Ensure the Viewer.js lightbox sits above the Prompt History dialog */
.viewer-container {
z-index: 2147483700 !important;
}
/* Enlarge Viewer.js thumbnail strip for better visibility */
.viewer-container .viewer-navbar .viewer-list {
height: 8vh;
}
.viewer-container .viewer-navbar .viewer-list > li {
height: 100%;
width: clamp(64px, 7vh, 96px);
}
.viewer-container .viewer-canvas {
backdrop-filter: blur(2px);
}
.phg-preview-host {
position: fixed;
bottom: 1.25rem;
left: 1.25rem;
display: flex;
flex-direction: column;
gap: 0.65rem;
z-index: 2147483500;
pointer-events: none;
}
.phg-preview-card {
position: relative;
min-width: 240px;
max-width: min(96vw, 1200px);
width: fit-content;
padding: 0.65rem;
border-radius: 1rem;
border: 1px solid rgba(255, 255, 255, 0.14);
background: rgba(6, 6, 12, 0.92);
box-shadow: 0 20px 65px rgba(0, 0, 0, 0.45);
color: var(--p-text-color, #f8fafc);
display: flex;
flex-direction: column;
gap: 0.4rem;
align-items: flex-start;
pointer-events: auto;
animation: phgPreviewEnter 0.2s ease-out forwards;
}
.phg-preview-card--leaving {
animation: phgPreviewLeave 0.2s ease-in forwards;
}
.phg-preview-grid {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
width: auto;
align-items: flex-start;
}
.phg-preview-image {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
position: relative;
border: none;
padding: 0;
border-radius: 0.65rem;
overflow: hidden;
background: rgba(255, 255, 255, 0.02);
border: 1px solid rgba(255, 255, 255, 0.08);
cursor: pointer;
min-height: 96px;
font: inherit;
color: inherit;
transition:
transform 0.15s ease,
border-color 0.15s ease;
}
.phg-preview-image img {
display: block;
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
object-fit: contain;
pointer-events: none;
}
.phg-preview-image:focus-visible {
outline: 2px solid var(--p-primary-color, #38bdf8);
outline-offset: 2px;
}
.phg-preview-image:hover {
border-color: rgba(255, 255, 255, 0.25);
transform: translateY(-1px);
}
.phg-preview-dismiss {
position: absolute;
top: 0.25rem;
right: 0.35rem;
border: none;
background: transparent;
color: inherit;
font-size: 0.9rem;
cursor: pointer;
padding: 0.1rem;
opacity: 0.7;
}
.phg-preview-dismiss:hover {
opacity: 1;
}
@keyframes phgPreviewEnter {
from {
opacity: 0;
transform: translateY(10px) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@keyframes phgPreviewLeave {
from {
opacity: 1;
transform: translateY(0) scale(1);
}
to {
opacity: 0;
transform: translateY(10px) scale(0.96);
}
}
/* Node dialog overlay */
.phg-dialog-backdrop {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 1.5rem;
background:
radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.08), transparent 35%),
radial-gradient(circle at 80% 10%, rgba(94, 234, 212, 0.08), transparent 35%),
rgba(6, 8, 18, 0.8);
backdrop-filter: blur(2px);
z-index: 2147483650;
}
/* Ensure the Viewer.js lightbox sits above the Prompt History dialog */
.viewer-container {
z-index: 2147483700 !important;
}
.phg-hidden {
display: none !important;
}
.phg-dialog {
width: min(1080px, 94vw);
height: min(80vh, 1000px);
max-height: 80vh;
min-height: 80vh;
background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 18, 32, 0.95));
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
border-radius: 18px;
display: flex;
flex-direction: column;
overflow: hidden;
color: var(--p-text-color, #e5e7eb);
}
.phg-dialog__header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 0.75rem;
padding: 1rem 1.25rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.phg-dialog__titles {
display: flex;
flex-direction: column;
gap: 0.15rem;
}
.phg-dialog__title {
font-size: 1.05rem;
font-weight: 700;
letter-spacing: 0.02em;
}
.phg-dialog__subtitle {
font-size: 0.9rem;
opacity: 0.8;
}
.phg-dialog__actions {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
justify-content: flex-end;
}
.phg-dialog__body {
padding: 0.6rem 1.25rem 1.25rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
flex: 1;
min-height: 0;
overflow: hidden;
}
.phg-search {
display: flex;
align-items: center;
gap: 0.4rem;
padding: 0.35rem 0.6rem;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.08);
background: rgba(255, 255, 255, 0.03);
flex-shrink: 0;
margin-bottom: 0.5rem;
}
.phg-search__icon {
opacity: 0.75;
font-size: 0.95rem;
}
.phg-search__input {
flex: 1 1 auto;
background: transparent;
border: none;
color: inherit;
font-size: 0.95rem;
padding: 0.35rem 0.1rem;
outline: none;
-webkit-appearance: none;
}
.phg-search__input::-webkit-search-cancel-button,
.phg-search__input::-webkit-search-decoration {
-webkit-appearance: none;
appearance: none;
display: none;
}
.phg-search__mode {
font-size: 0.7rem;
letter-spacing: 0.08em;
padding: 0.2rem 0.6rem;
min-width: 3.2rem;
text-transform: uppercase;
}
.phg-search__clear {
padding: 0.15rem 0.55rem;
min-width: 0;
}
.phg-search__clear:hover {
transform: translateY(-1px);
}
.phg-dialog__status {
min-height: 1.25rem;
font-size: 0.9rem;
opacity: 0.9;
flex-shrink: 0;
}
.phg-dialog__status[data-tone="error"] {
color: var(--p-red-300, #fca5a5);
}
.phg-dialog__status[data-tone="warn"] {
color: var(--p-yellow-200, #fcd34d);
}
.phg-dialog__status[data-tone="success"] {
color: var(--p-green-200, #a7f3d0);
}
.phg-history-view {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
.phg-history-list {
display: flex;
flex-direction: column;
gap: 0.75rem;
overflow: auto;
padding-right: 0.35rem;
flex: 1 1 0;
min-height: 60vh;
}
.phg-entry-card {
border: 1px solid rgba(255, 255, 255, 0.07);
background: rgba(255, 255, 255, 0.02);
border-radius: 14px;
padding: 0.9rem;
display: grid;
grid-template-columns: 1fr;
gap: 0.85rem;
}
.phg-entry-card--popular {
--phg-usage-strength: var(--phg-usage-strength, 0.5);
--phg-usage-floor: 0.08;
border-color: rgba(56, 189, 248, calc(var(--phg-usage-floor) + 0.42 * var(--phg-usage-strength)));
background:
linear-gradient(
135deg,
rgba(125, 211, 252, calc(var(--phg-usage-floor) * 0.7 + 0.24 * var(--phg-usage-strength))),
rgba(45, 212, 191, calc(var(--phg-usage-floor) * 0.6 + 0.2 * var(--phg-usage-strength))),
rgba(255, 255, 255, 0.014)
),
rgba(255, 255, 255, 0.02);
box-shadow:
0 12px 30px
rgba(56, 189, 248, calc(var(--phg-usage-floor) * 0.9 + 0.18 * var(--phg-usage-strength))),
inset 0 0 0 1px
rgba(56, 189, 248, calc(var(--phg-usage-floor) + 0.22 * var(--phg-usage-strength)));
}
.phg-entry-card__header {
display: grid;
grid-template-columns: auto 1fr auto;
gap: 0.5rem 0.75rem;
align-items: center;
}
.phg-entry-card__stamp {
font-size: 0.9rem;
opacity: 0.78;
white-space: nowrap;
}
.phg-entry-card__badges {
display: flex;
gap: 0.35rem;
flex-wrap: wrap;
}
.phg-entry-card__actions {
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
justify-content: flex-end;
}
.phg-entry-card__body {
display: grid;
grid-template-columns: 180px 1fr;
gap: 0.75rem;
align-items: stretch;
}
.phg-entry-card__preview {
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.08);
background: rgba(255, 255, 255, 0.03);
min-height: 160px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.phg-entry-card__preview img {
width: 100%;
height: 100%;
object-fit: cover;
cursor: pointer;
transition:
transform 0.15s ease,
filter 0.2s ease;
}
.phg-entry-card__preview img:hover {
transform: scale(1.01);
filter: saturate(1.04);
}
.phg-entry-card__prompt pre {
margin: 0;
padding: 0.7rem;
border-radius: 12px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.06);
font-family: var(
--p-font-family,
ui-monospace,
SFMono-Regular,
Menlo,
Monaco,
Consolas,
"Liberation Mono",
"Courier New",
monospace
);
font-size: 0.9rem;
line-height: 1.45;
color: inherit;
white-space: pre-wrap;
}
.phg-entry-card__footer {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
}
.phg-button {
border: 1px solid rgba(255, 255, 255, 0.12);
background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.32));
color: var(--p-text-color, #e5e7eb);
border-radius: 9999px;
padding: 0.35rem 0.9rem;
font-size: 0.9rem;
cursor: pointer;
transition:
transform 0.12s ease,
border-color 0.12s ease,
background 0.15s ease;
}
.phg-button:hover {
transform: translateY(-1px);
border-color: rgba(255, 255, 255, 0.2);
}
.phg-button:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.phg-button--ghost {
background: transparent;
}
.phg-button--icon {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.2rem 0.6rem;
font-size: 1.2rem;
line-height: 1;
}
.phg-button--danger {
background: linear-gradient(135deg, rgba(248, 113, 113, 0.24), rgba(248, 113, 113, 0.38));
border-color: rgba(248, 113, 113, 0.35);
}
.phg-chip {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.25rem 0.65rem;
border-radius: 9999px;
font-size: 0.8rem;
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.06);
}
.phg-chip--muted {
opacity: 0.75;
}
.phg-chip--accent {
background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.4));
border-color: rgba(56, 189, 248, 0.35);
}
.phg-chip--popular {
--phg-usage-strength: var(--phg-usage-strength, 0.5);
--phg-usage-floor: 0.08;
background: linear-gradient(
135deg,
rgba(125, 211, 252, calc(var(--phg-usage-floor) + 0.24 * var(--phg-usage-strength))),
rgba(45, 212, 191, calc(var(--phg-usage-floor) + 0.19 * var(--phg-usage-strength)))
);
border-color: rgba(56, 189, 248, calc(var(--phg-usage-floor) + 0.25 * var(--phg-usage-strength)));
box-shadow: 0 6px 18px
rgba(56, 189, 248, calc(var(--phg-usage-floor) * 0.85 + 0.16 * var(--phg-usage-strength)));
}
.phg-chip--clickable {
cursor: pointer;
transition:
transform 0.1s ease,
border-color 0.12s ease,
background 0.12s ease;
}
.phg-chip--clickable:hover,
.phg-chip--clickable:focus-visible {
transform: translateY(-1px);
border-color: rgba(255, 255, 255, 0.22);
}
.phg-preview-placeholder {
font-size: 0.85rem;
opacity: 0.7;
}
.phg-message--muted {
opacity: 0.8;
}
@media (max-width: 900px) {
.phg-entry-card__body {
grid-template-columns: 1fr;
}
.phg-entry-card__header {
grid-template-columns: 1fr;
justify-items: flex-start;
}
.phg-entry-card__actions {
justify-content: flex-start;
}
}