Refactor card components for improved layout and functionality
- Updated card styles in viewer.html and viewer-template.html to enhance padding, margins, and overall layout. - Introduced new header structure with left-aligned type and project name, and added view mode toggle buttons for facts and narrative. - Simplified content rendering logic in ObservationCard, allowing for toggling between facts and narrative. - Updated metadata display in ObservationCard, PromptCard, and SummaryCard to include formatted date and improved layout. - Removed unnecessary verbose content sections and streamlined the presentation of facts and narrative.
This commit is contained in:
File diff suppressed because one or more lines are too long
+98
-163
@@ -482,7 +482,7 @@
|
|||||||
|
|
||||||
.card {
|
.card {
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
padding: 20px 24px;
|
padding: 24px;
|
||||||
background: var(--color-bg-card);
|
background: var(--color-bg-card);
|
||||||
border: 1px solid var(--color-border-primary);
|
border: 1px solid var(--color-border-primary);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -510,13 +510,19 @@
|
|||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
justify-content: space-between;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 14px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--color-text-muted);
|
color: var(--color-text-muted);
|
||||||
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-header-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.card-type {
|
.card-type {
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
background: var(--color-type-badge-bg);
|
background: var(--color-type-badge-bg);
|
||||||
@@ -530,214 +536,142 @@
|
|||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 14px;
|
||||||
color: var(--color-text-title);
|
color: var(--color-text-title);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
letter-spacing: -0.01em;
|
letter-spacing: -0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-subtitle {
|
.view-mode-toggles {
|
||||||
font-size: 14px;
|
display: flex;
|
||||||
color: var(--color-text-subtitle);
|
gap: 8px;
|
||||||
margin-bottom: 8px;
|
flex-shrink: 0;
|
||||||
line-height: 1.6;
|
}
|
||||||
}
|
|
||||||
|
.view-mode-toggle {
|
||||||
.card-meta {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--color-text-tertiary);
|
|
||||||
margin-top: 8px;
|
|
||||||
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
gap: 4px;
|
||||||
|
background: var(--color-bg-tertiary);
|
||||||
/* Expanded card state */
|
border: 1px solid var(--color-border-primary);
|
||||||
.card-expanded {
|
|
||||||
/* Increased shadow when expanded */
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Expand toggle button */
|
|
||||||
.expand-toggle {
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
color: var(--color-text-secondary);
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--color-text-secondary);
|
||||||
transition: all 0.15s ease;
|
transition: all 0.15s ease;
|
||||||
font-family: inherit;
|
font-size: 11px;
|
||||||
|
font-weight: 500;
|
||||||
|
text-transform: lowercase;
|
||||||
|
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.expand-toggle:hover {
|
.view-mode-toggle svg {
|
||||||
background: var(--color-bg-secondary);
|
flex-shrink: 0;
|
||||||
|
opacity: 0.7;
|
||||||
|
transition: opacity 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-mode-toggle:hover {
|
||||||
|
background: var(--color-bg-card-hover);
|
||||||
|
border-color: var(--color-border-hover);
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verbose content container (narrative and facts - collapsible) */
|
.view-mode-toggle:hover svg {
|
||||||
.card-verbose-content {
|
opacity: 1;
|
||||||
margin-top: 16px;
|
|
||||||
padding-top: 16px;
|
|
||||||
border-top: 1px solid var(--color-border-primary);
|
|
||||||
animation: expandDown 0.2s ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes expandDown {
|
.view-mode-toggle.active {
|
||||||
from {
|
background: var(--color-accent-primary);
|
||||||
opacity: 0;
|
border-color: var(--color-accent-primary);
|
||||||
transform: translateY(-8px);
|
color: var(--color-text-button);
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Metadata grid (concepts, files, session info - always visible) */
|
.view-mode-toggle.active svg {
|
||||||
.card-metadata-grid {
|
opacity: 1;
|
||||||
margin-top: 16px;
|
|
||||||
padding-top: 16px;
|
|
||||||
border-top: 1px solid var(--color-border-primary);
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
gap: 16px;
|
|
||||||
grid-auto-flow: dense;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Files section spans full width */
|
.view-mode-content {
|
||||||
.card-metadata-grid .card-section.files-section {
|
margin-bottom: 12px;
|
||||||
grid-column: 1 / -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Responsive: stack on smaller screens */
|
.view-mode-content .card-subtitle {
|
||||||
@media (max-width: 768px) {
|
|
||||||
.card-metadata-grid {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-metadata-grid .card-section.files-section {
|
|
||||||
grid-column: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Compact section styling for grid items */
|
|
||||||
.card-section.compact {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-section.compact .section-header {
|
.view-mode-content .facts-list {
|
||||||
font-size: 12px;
|
list-style: disc;
|
||||||
margin-bottom: 6px;
|
margin: 0;
|
||||||
}
|
|
||||||
|
|
||||||
.card-section.compact .section-content {
|
|
||||||
padding-left: 0;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Section styling */
|
|
||||||
.card-section {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-section:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-header {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--color-text-primary);
|
|
||||||
margin-bottom: 8px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-content {
|
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.6;
|
line-height: 1.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Narrative styling */
|
.view-mode-content .facts-list li {
|
||||||
.narrative {
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-mode-content .narrative {
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
color: var(--color-text-secondary);
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Facts list styling */
|
.card-subtitle {
|
||||||
.facts-list {
|
font-size: 14px;
|
||||||
list-style: disc;
|
color: var(--color-text-subtitle);
|
||||||
margin: 0;
|
line-height: 1.7;
|
||||||
padding-left: 20px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.facts-list li {
|
.card-subtitle:last-child {
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Concepts tags */
|
|
||||||
.concepts {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.concept-tag {
|
|
||||||
background: var(--color-type-badge-bg);
|
|
||||||
color: var(--color-type-badge-text);
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 12px;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* File paths */
|
|
||||||
.file-group {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.file-group:last-child {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-group-label {
|
|
||||||
font-weight: 500;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
color: var(--color-text-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.file-path {
|
.card-meta {
|
||||||
font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
|
font-size: 11px;
|
||||||
font-size: 12px;
|
color: var(--color-text-tertiary);
|
||||||
padding: 4px 8px;
|
margin-top: 18px;
|
||||||
background: var(--color-bg-secondary);
|
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
||||||
border-radius: 4px;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
overflow-x: auto;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Session info */
|
|
||||||
.session-info {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16px;
|
flex-wrap: wrap;
|
||||||
font-size: 12px;
|
gap: 6px;
|
||||||
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.session-id {
|
.meta-date {
|
||||||
font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
|
|
||||||
color: var(--color-text-tertiary);
|
color: var(--color-text-tertiary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.meta-concepts {
|
||||||
|
font-style: italic;
|
||||||
|
color: var(--color-text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-files {
|
||||||
|
color: var(--color-text-muted);
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-files .file-label {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--color-text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Stack single column on narrow screens (removed - no longer using card-files) */
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Project badge styling */
|
/* Project badge styling */
|
||||||
.card-project {
|
.card-project {
|
||||||
color: var(--color-text-muted);
|
color: var(--color-text-muted);
|
||||||
@@ -864,8 +798,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.card-content {
|
.card-content {
|
||||||
margin-top: 12px;
|
margin-top: 14px;
|
||||||
line-height: 1.6;
|
margin-bottom: 12px;
|
||||||
|
line-height: 1.7;
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
|||||||
+98
-163
@@ -482,7 +482,7 @@
|
|||||||
|
|
||||||
.card {
|
.card {
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
padding: 20px 24px;
|
padding: 24px;
|
||||||
background: var(--color-bg-card);
|
background: var(--color-bg-card);
|
||||||
border: 1px solid var(--color-border-primary);
|
border: 1px solid var(--color-border-primary);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -510,13 +510,19 @@
|
|||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
justify-content: space-between;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 14px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--color-text-muted);
|
color: var(--color-text-muted);
|
||||||
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-header-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.card-type {
|
.card-type {
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
background: var(--color-type-badge-bg);
|
background: var(--color-type-badge-bg);
|
||||||
@@ -530,214 +536,142 @@
|
|||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 14px;
|
||||||
color: var(--color-text-title);
|
color: var(--color-text-title);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
letter-spacing: -0.01em;
|
letter-spacing: -0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-subtitle {
|
.view-mode-toggles {
|
||||||
font-size: 14px;
|
display: flex;
|
||||||
color: var(--color-text-subtitle);
|
gap: 8px;
|
||||||
margin-bottom: 8px;
|
flex-shrink: 0;
|
||||||
line-height: 1.6;
|
}
|
||||||
}
|
|
||||||
|
.view-mode-toggle {
|
||||||
.card-meta {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--color-text-tertiary);
|
|
||||||
margin-top: 8px;
|
|
||||||
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
gap: 4px;
|
||||||
|
background: var(--color-bg-tertiary);
|
||||||
/* Expanded card state */
|
border: 1px solid var(--color-border-primary);
|
||||||
.card-expanded {
|
|
||||||
/* Increased shadow when expanded */
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Expand toggle button */
|
|
||||||
.expand-toggle {
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
color: var(--color-text-secondary);
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--color-text-secondary);
|
||||||
transition: all 0.15s ease;
|
transition: all 0.15s ease;
|
||||||
font-family: inherit;
|
font-size: 11px;
|
||||||
|
font-weight: 500;
|
||||||
|
text-transform: lowercase;
|
||||||
|
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.expand-toggle:hover {
|
.view-mode-toggle svg {
|
||||||
background: var(--color-bg-secondary);
|
flex-shrink: 0;
|
||||||
|
opacity: 0.7;
|
||||||
|
transition: opacity 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-mode-toggle:hover {
|
||||||
|
background: var(--color-bg-card-hover);
|
||||||
|
border-color: var(--color-border-hover);
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verbose content container (narrative and facts - collapsible) */
|
.view-mode-toggle:hover svg {
|
||||||
.card-verbose-content {
|
opacity: 1;
|
||||||
margin-top: 16px;
|
|
||||||
padding-top: 16px;
|
|
||||||
border-top: 1px solid var(--color-border-primary);
|
|
||||||
animation: expandDown 0.2s ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes expandDown {
|
.view-mode-toggle.active {
|
||||||
from {
|
background: var(--color-accent-primary);
|
||||||
opacity: 0;
|
border-color: var(--color-accent-primary);
|
||||||
transform: translateY(-8px);
|
color: var(--color-text-button);
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Metadata grid (concepts, files, session info - always visible) */
|
.view-mode-toggle.active svg {
|
||||||
.card-metadata-grid {
|
opacity: 1;
|
||||||
margin-top: 16px;
|
|
||||||
padding-top: 16px;
|
|
||||||
border-top: 1px solid var(--color-border-primary);
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
gap: 16px;
|
|
||||||
grid-auto-flow: dense;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Files section spans full width */
|
.view-mode-content {
|
||||||
.card-metadata-grid .card-section.files-section {
|
margin-bottom: 12px;
|
||||||
grid-column: 1 / -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Responsive: stack on smaller screens */
|
.view-mode-content .card-subtitle {
|
||||||
@media (max-width: 768px) {
|
|
||||||
.card-metadata-grid {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-metadata-grid .card-section.files-section {
|
|
||||||
grid-column: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Compact section styling for grid items */
|
|
||||||
.card-section.compact {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-section.compact .section-header {
|
.view-mode-content .facts-list {
|
||||||
font-size: 12px;
|
list-style: disc;
|
||||||
margin-bottom: 6px;
|
margin: 0;
|
||||||
}
|
|
||||||
|
|
||||||
.card-section.compact .section-content {
|
|
||||||
padding-left: 0;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Section styling */
|
|
||||||
.card-section {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-section:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-header {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--color-text-primary);
|
|
||||||
margin-bottom: 8px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-content {
|
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.6;
|
line-height: 1.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Narrative styling */
|
.view-mode-content .facts-list li {
|
||||||
.narrative {
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-mode-content .narrative {
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
color: var(--color-text-secondary);
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Facts list styling */
|
.card-subtitle {
|
||||||
.facts-list {
|
font-size: 14px;
|
||||||
list-style: disc;
|
color: var(--color-text-subtitle);
|
||||||
margin: 0;
|
line-height: 1.7;
|
||||||
padding-left: 20px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.facts-list li {
|
.card-subtitle:last-child {
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Concepts tags */
|
|
||||||
.concepts {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.concept-tag {
|
|
||||||
background: var(--color-type-badge-bg);
|
|
||||||
color: var(--color-type-badge-text);
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 12px;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* File paths */
|
|
||||||
.file-group {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.file-group:last-child {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-group-label {
|
|
||||||
font-weight: 500;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
color: var(--color-text-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.file-path {
|
.card-meta {
|
||||||
font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
|
font-size: 11px;
|
||||||
font-size: 12px;
|
color: var(--color-text-tertiary);
|
||||||
padding: 4px 8px;
|
margin-top: 18px;
|
||||||
background: var(--color-bg-secondary);
|
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
||||||
border-radius: 4px;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
overflow-x: auto;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Session info */
|
|
||||||
.session-info {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16px;
|
flex-wrap: wrap;
|
||||||
font-size: 12px;
|
gap: 6px;
|
||||||
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.session-id {
|
.meta-date {
|
||||||
font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
|
|
||||||
color: var(--color-text-tertiary);
|
color: var(--color-text-tertiary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.meta-concepts {
|
||||||
|
font-style: italic;
|
||||||
|
color: var(--color-text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-files {
|
||||||
|
color: var(--color-text-muted);
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-files .file-label {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--color-text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Stack single column on narrow screens (removed - no longer using card-files) */
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Project badge styling */
|
/* Project badge styling */
|
||||||
.card-project {
|
.card-project {
|
||||||
color: var(--color-text-muted);
|
color: var(--color-text-muted);
|
||||||
@@ -864,8 +798,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.card-content {
|
.card-content {
|
||||||
margin-top: 12px;
|
margin-top: 14px;
|
||||||
line-height: 1.6;
|
margin-bottom: 12px;
|
||||||
|
line-height: 1.7;
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ function stripProjectRoot(filePath: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ObservationCard({ observation }: ObservationCardProps) {
|
export function ObservationCard({ observation }: ObservationCardProps) {
|
||||||
const [isExpanded, setIsExpanded] = useState(false);
|
const [showFacts, setShowFacts] = useState(false);
|
||||||
|
const [showNarrative, setShowNarrative] = useState(false);
|
||||||
const date = formatDate(observation.created_at_epoch);
|
const date = formatDate(observation.created_at_epoch);
|
||||||
|
|
||||||
// Parse JSON fields
|
// Parse JSON fields
|
||||||
@@ -40,117 +41,94 @@ export function ObservationCard({ observation }: ObservationCardProps) {
|
|||||||
const filesRead = observation.files_read ? JSON.parse(observation.files_read).map(stripProjectRoot) : [];
|
const filesRead = observation.files_read ? JSON.parse(observation.files_read).map(stripProjectRoot) : [];
|
||||||
const filesModified = observation.files_modified ? JSON.parse(observation.files_modified).map(stripProjectRoot) : [];
|
const filesModified = observation.files_modified ? JSON.parse(observation.files_modified).map(stripProjectRoot) : [];
|
||||||
|
|
||||||
// Check if there's verbose content to expand
|
// Show summary when both are off
|
||||||
const hasVerboseContent = observation.narrative || facts.length > 0;
|
const showSummary = !showFacts && !showNarrative;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card">
|
<div className="card">
|
||||||
{/* Header - always visible */}
|
{/* Header with toggle buttons in top right */}
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<span className={`card-type type-${observation.type}`}>
|
<div className="card-header-left">
|
||||||
{observation.type}
|
<span className={`card-type type-${observation.type}`}>
|
||||||
</span>
|
{observation.type}
|
||||||
<span className="card-project">{observation.project}</span>
|
</span>
|
||||||
</div>
|
<span className="card-project">{observation.project}</span>
|
||||||
|
</div>
|
||||||
{/* Title/Subtitle - always visible */}
|
<div className="view-mode-toggles">
|
||||||
<div className="card-title">{observation.title || 'Untitled'}</div>
|
|
||||||
{observation.subtitle && (
|
|
||||||
<div className="card-subtitle">{observation.subtitle}</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Metadata + Expand button - always visible */}
|
|
||||||
<div className="card-meta">
|
|
||||||
<span>#{observation.id} • {date}</span>
|
|
||||||
{hasVerboseContent && (
|
|
||||||
<button
|
|
||||||
className="expand-toggle"
|
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
|
||||||
>
|
|
||||||
{isExpanded ? '▲ Less' : '▼ More'}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Collapsible verbose content - Narrative and Facts */}
|
|
||||||
{isExpanded && hasVerboseContent && (
|
|
||||||
<div className="card-verbose-content">
|
|
||||||
{/* Narrative Section */}
|
|
||||||
{observation.narrative && (
|
|
||||||
<div className="card-section">
|
|
||||||
<div className="section-header">📝 Narrative</div>
|
|
||||||
<div className="section-content narrative">
|
|
||||||
{observation.narrative}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Facts Section */}
|
|
||||||
{facts.length > 0 && (
|
{facts.length > 0 && (
|
||||||
<div className="card-section">
|
<button
|
||||||
<div className="section-header">📌 Key Facts</div>
|
className={`view-mode-toggle ${showFacts ? 'active' : ''}`}
|
||||||
<ul className="section-content facts-list">
|
onClick={() => {
|
||||||
{facts.map((fact: string, i: number) => (
|
setShowFacts(!showFacts);
|
||||||
<li key={i}>{fact}</li>
|
if (!showFacts) setShowNarrative(false); // Turn off narrative when turning on facts
|
||||||
))}
|
}}
|
||||||
</ul>
|
>
|
||||||
</div>
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||||
|
<polyline points="9 11 12 14 22 4"></polyline>
|
||||||
|
<path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path>
|
||||||
|
</svg>
|
||||||
|
<span>facts</span>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{observation.narrative && (
|
||||||
|
<button
|
||||||
|
className={`view-mode-toggle ${showNarrative ? 'active' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setShowNarrative(!showNarrative);
|
||||||
|
if (!showNarrative) setShowFacts(false); // Turn off facts when turning on narrative
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||||
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
||||||
|
<polyline points="14 2 14 8 20 8"></polyline>
|
||||||
|
<line x1="16" y1="13" x2="8" y2="13"></line>
|
||||||
|
<line x1="16" y1="17" x2="8" y2="17"></line>
|
||||||
|
</svg>
|
||||||
|
<span>narrative</span>
|
||||||
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
|
|
||||||
{/* Always visible metadata grid - Concepts, Files, Session Info */}
|
{/* Title */}
|
||||||
<div className="card-metadata-grid">
|
<div className="card-title">{observation.title || 'Untitled'}</div>
|
||||||
{/* Concepts Section */}
|
|
||||||
{concepts.length > 0 && (
|
{/* Content based on toggle state */}
|
||||||
<div className="card-section compact">
|
<div className="view-mode-content">
|
||||||
<div className="section-header">Concepts</div>
|
{showSummary && observation.subtitle && (
|
||||||
<div className="section-content concepts">
|
<div className="card-subtitle">{observation.subtitle}</div>
|
||||||
{concepts.map((concept: string, i: number) => (
|
)}
|
||||||
<span key={i} className="concept-tag">{concept}</span>
|
{showFacts && facts.length > 0 && (
|
||||||
))}
|
<ul className="facts-list">
|
||||||
</div>
|
{facts.map((fact: string, i: number) => (
|
||||||
|
<li key={i}>{fact}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
{showNarrative && observation.narrative && (
|
||||||
|
<div className="narrative">
|
||||||
|
{observation.narrative}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Session Info Section */}
|
{/* Metadata with concepts and files inline */}
|
||||||
<div className="card-section compact">
|
<div className="card-meta">
|
||||||
<div className="section-header">Session Info</div>
|
<span className="meta-date">#{observation.id} • {date}</span>
|
||||||
<div className="section-content session-info">
|
{concepts.length > 0 && (
|
||||||
{observation.prompt_number && (
|
<span className="meta-concepts">
|
||||||
<span>Prompt #{observation.prompt_number}</span>
|
• {concepts.join(', ')}
|
||||||
)}
|
</span>
|
||||||
{observation.sdk_session_id && (
|
)}
|
||||||
<span className="session-id">
|
{filesRead.length > 0 && (
|
||||||
Session: {observation.sdk_session_id.substring(0, 8)}...
|
<span className="meta-files">
|
||||||
</span>
|
• <span className="file-label">read:</span> {filesRead.join(', ')}
|
||||||
)}
|
</span>
|
||||||
</div>
|
)}
|
||||||
</div>
|
{filesModified.length > 0 && (
|
||||||
|
<span className="meta-files">
|
||||||
{/* Files Section - spans full width */}
|
• <span className="file-label">modified:</span> {filesModified.join(', ')}
|
||||||
{(filesRead.length > 0 || filesModified.length > 0) && (
|
</span>
|
||||||
<div className="card-section compact files-section">
|
|
||||||
<div className="section-header">Files</div>
|
|
||||||
<div className="section-content files">
|
|
||||||
{filesRead.length > 0 && (
|
|
||||||
<div className="file-group">
|
|
||||||
<div className="file-group-label">Read:</div>
|
|
||||||
{filesRead.map((file: string, i: number) => (
|
|
||||||
<div key={i} className="file-path">{file}</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{filesModified.length > 0 && (
|
|
||||||
<div className="file-group">
|
|
||||||
<div className="file-group-label">Modified:</div>
|
|
||||||
{filesModified.map((file: string, i: number) => (
|
|
||||||
<div key={i} className="file-path">{file}</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,17 +7,21 @@ interface PromptCardProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PromptCard({ prompt }: PromptCardProps) {
|
export function PromptCard({ prompt }: PromptCardProps) {
|
||||||
|
const date = formatDate(prompt.created_at_epoch);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card prompt-card">
|
<div className="card prompt-card">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<span className="card-type">Prompt</span>
|
<div className="card-header-left">
|
||||||
<span>{prompt.project}</span>
|
<span className="card-type">Prompt</span>
|
||||||
|
<span className="card-project">{prompt.project}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-content">
|
<div className="card-content">
|
||||||
{prompt.prompt_text}
|
{prompt.prompt_text}
|
||||||
</div>
|
</div>
|
||||||
<div className="card-meta">
|
<div className="card-meta">
|
||||||
{formatDate(prompt.created_at_epoch)}
|
<span className="meta-date">#{prompt.id} • {date}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ export function SummaryCard({ summary }: SummaryCardProps) {
|
|||||||
return (
|
return (
|
||||||
<div className="card summary-card">
|
<div className="card summary-card">
|
||||||
<div className="card-header">
|
<div className="card-header">
|
||||||
<span className="card-type">SUMMARY</span>
|
<div className="card-header-left">
|
||||||
<span>{summary.project}</span>
|
<span className="card-type">SUMMARY</span>
|
||||||
|
<span className="card-project">{summary.project}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{summary.request && (
|
{summary.request && (
|
||||||
<div className="card-title">Request: {summary.request}</div>
|
<div className="card-title">Request: {summary.request}</div>
|
||||||
@@ -27,7 +29,9 @@ export function SummaryCard({ summary }: SummaryCardProps) {
|
|||||||
{summary.next_steps && (
|
{summary.next_steps && (
|
||||||
<div className="card-subtitle">Next: {summary.next_steps}</div>
|
<div className="card-subtitle">Next: {summary.next_steps}</div>
|
||||||
)}
|
)}
|
||||||
<div className="card-meta">#{summary.id} • {date}</div>
|
<div className="card-meta">
|
||||||
|
<span className="meta-date">#{summary.id} • {date}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user