diff --git a/public/css/branches.css b/public/css/branches.css index 268d39e..d7bc86b 100644 --- a/public/css/branches.css +++ b/public/css/branches.css @@ -353,3 +353,242 @@ font-size: 10px; } } + +/* --- Compare Mode Styles --- */ + +/* Compare mode indicator on branches content */ +.branches-content.compare-mode .branch-item { + cursor: pointer; +} + +.branches-content.compare-mode .branch-item:hover { + border-color: var(--accent); +} + +.branches-content.compare-mode .branch-item.compare-selected { + background: var(--accent-alpha-15); + border-color: var(--accent); + box-shadow: 0 0 0 2px var(--accent-alpha-30); +} + +/* Compare overlay */ +.branches-compare { + position: absolute; + inset: 0; + background: var(--bg); + z-index: 10; + display: flex; + flex-direction: column; +} + +.branches-compare.hidden { + display: none; +} + +.compare-header { + padding: 12px 16px; + padding-top: calc(12px + var(--safe-top)); + background: var(--glass-bg); + backdrop-filter: blur(20px) saturate(1.4); + -webkit-backdrop-filter: blur(20px) saturate(1.4); + border-bottom: 1px solid var(--glass-border); + display: flex; + justify-content: space-between; + align-items: center; + font-weight: 600; + font-size: 15px; +} + +.compare-close-btn { + background: none; + border: none; + font-size: 24px; + color: var(--text-secondary); + cursor: pointer; + padding: 8px 12px; + border-radius: 8px; + line-height: 1; + transition: background 0.15s, color 0.15s; +} + +.compare-close-btn:hover { + background: var(--surface); + color: var(--text); +} + +.compare-body { + flex: 1; + overflow: auto; + -webkit-overflow-scrolling: touch; +} + +.compare-loading, +.compare-error { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + color: var(--text-secondary); + padding: 24px; + text-align: center; +} + +.compare-error { + color: var(--danger); +} + +/* Side-by-side view (desktop) */ +.compare-split { + display: grid; + grid-template-columns: 1fr 1fr; + height: 100%; +} + +.compare-column { + display: flex; + flex-direction: column; + border-right: 1px solid var(--border); + min-width: 0; +} + +.compare-column:last-child { + border-right: none; +} + +.compare-column-header { + padding: 10px 12px; + background: var(--surface); + border-bottom: 1px solid var(--border); + font-weight: 600; + font-size: 13px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + flex-shrink: 0; +} + +.compare-messages { + flex: 1; + overflow-y: auto; + padding: 12px; +} + +.compare-msg { + padding: 10px 14px; + margin-bottom: 10px; + border-radius: 10px; + font-size: 13px; + line-height: 1.5; + word-break: break-word; +} + +.compare-msg.user { + background: var(--accent-alpha-15); + color: var(--text); + margin-left: 20%; +} + +.compare-msg.assistant { + background: var(--surface); + color: var(--text); + margin-right: 20%; +} + +.compare-msg.empty { + background: var(--bg-tertiary); + opacity: 0.3; + min-height: 40px; +} + +/* Unified diff view (mobile) */ +.compare-unified-header { + display: flex; + gap: 12px; + padding: 10px 12px; + background: var(--surface); + border-bottom: 1px solid var(--border); +} + +.unified-legend { + font-size: 11px; + font-weight: 600; + padding: 3px 8px; + border-radius: 4px; +} + +.unified-legend.parent { + background: var(--bg-tertiary); + color: var(--text-secondary); +} + +.unified-legend.fork { + background: var(--accent-alpha-20); + color: var(--accent); +} + +.compare-unified { + padding: 12px; +} + +.unified-row { + display: flex; + gap: 10px; + margin-bottom: 10px; + align-items: flex-start; +} + +.unified-row.fork { + padding-left: 20px; +} + +.unified-source { + width: 32px; + min-width: 32px; + padding: 4px 6px; + border-radius: 4px; + font-size: 9px; + font-weight: 600; + text-align: center; + text-transform: uppercase; + flex-shrink: 0; +} + +.unified-source.parent { + background: var(--bg-tertiary); + color: var(--text-secondary); +} + +.unified-source.fork { + background: var(--accent-alpha-20); + color: var(--accent); +} + +.unified-content { + flex: 1; + padding: 10px 14px; + background: var(--surface); + border-radius: 8px; + font-size: 13px; + line-height: 1.5; + word-break: break-word; + min-width: 0; +} + +.unified-row.fork .unified-content { + background: var(--accent-alpha-10); + border: 1px solid var(--accent-alpha-30); +} + +/* Responsive: mobile uses unified view */ +@media (max-width: 767px) { + .compare-split { + display: none; + } +} + +@media (min-width: 768px) { + .compare-unified-header, + .compare-unified { + display: none; + } +} diff --git a/public/css/layout.css b/public/css/layout.css index d064e37..b655977 100644 --- a/public/css/layout.css +++ b/public/css/layout.css @@ -191,6 +191,23 @@ color: var(--accent); } +/* Message highlight animation for jump-to-fork */ +.message-highlight, +.message-wrapper.message-highlight { + animation: message-highlight-pulse 2s ease-out; +} + +@keyframes message-highlight-pulse { + 0% { + box-shadow: 0 0 0 3px var(--accent); + background: var(--accent-alpha-15); + } + 100% { + box-shadow: 0 0 0 0 transparent; + background: transparent; + } +} + .status-dot { width: 10px; height: 10px; diff --git a/public/index.html b/public/index.html index 1debc6f..5129de5 100644 --- a/public/index.html +++ b/public/index.html @@ -416,8 +416,19 @@