Add real-time file synchronization with watchdog, SSE notifications, and dynamic vault management API

This commit is contained in:
2026-03-23 14:16:45 -04:00
parent d8e5d0ef57
commit 757b72c549
9 changed files with 1365 additions and 8 deletions
+183
View File
@@ -2775,3 +2775,186 @@ body.resizing-v {
max-width: 150px;
}
}
/* ---------------------------------------------------------------------------
Sync Badge — real-time connection status indicator
--------------------------------------------------------------------------- */
.sync-badge {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-left: 8px;
cursor: pointer;
transition: background 300ms, box-shadow 300ms;
flex-shrink: 0;
vertical-align: middle;
}
.sync-badge--disconnected {
background: #ef4444;
box-shadow: 0 0 0 2px rgba(239,68,68,0.25);
}
.sync-badge--connecting {
background: #f59e0b;
box-shadow: 0 0 0 2px rgba(245,158,11,0.25);
animation: sync-pulse 1.5s ease-in-out infinite;
}
.sync-badge--connected {
background: #22c55e;
box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
}
.sync-badge--syncing {
background: #3b82f6;
box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
animation: sync-pulse 0.8s ease-in-out infinite;
}
@keyframes sync-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
/* ---------------------------------------------------------------------------
Sync Panel — event log overlay
--------------------------------------------------------------------------- */
.sync-panel {
position: fixed;
top: 52px;
left: 16px;
width: 340px;
max-height: 400px;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 10px;
box-shadow: 0 8px 32px rgba(0,0,0,0.3);
z-index: 9999;
overflow: hidden;
font-size: 0.82rem;
}
.sync-panel__header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 14px;
border-bottom: 1px solid var(--border);
}
.sync-panel__title {
font-weight: 600;
color: var(--text-primary);
}
.sync-panel__state {
font-size: 0.72rem;
padding: 2px 8px;
border-radius: 8px;
font-weight: 500;
}
.sync-panel__state--connected {
background: rgba(34,197,94,0.15);
color: #22c55e;
}
.sync-panel__state--disconnected {
background: rgba(239,68,68,0.15);
color: #ef4444;
}
.sync-panel__state--connecting {
background: rgba(245,158,11,0.15);
color: #f59e0b;
}
.sync-panel__state--syncing {
background: rgba(59,130,246,0.15);
color: #3b82f6;
}
.sync-panel__empty {
padding: 20px 14px;
text-align: center;
color: var(--text-muted);
}
.sync-panel__events {
max-height: 320px;
overflow-y: auto;
padding: 4px 0;
}
.sync-panel__event {
display: flex;
align-items: center;
gap: 8px;
padding: 7px 14px;
border-bottom: 1px solid var(--border);
}
.sync-panel__event:last-child {
border-bottom: none;
}
.sync-panel__event-type {
font-weight: 500;
color: var(--text-primary);
white-space: nowrap;
}
.sync-panel__event-detail {
color: var(--text-secondary);
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sync-panel__event-time {
font-size: 0.7rem;
color: var(--text-muted);
white-space: nowrap;
}
/* ---------------------------------------------------------------------------
Toast — info variant (blue)
--------------------------------------------------------------------------- */
.toast.toast-info {
background: #1e3a5f;
border-left: 4px solid #3b82f6;
color: #bfdbfe;
}
[data-theme="light"] .toast.toast-info {
background: #eff6ff;
border-left: 4px solid #3b82f6;
color: #1e40af;
}
/* ---------------------------------------------------------------------------
Config Toggle Switch
--------------------------------------------------------------------------- */
.config-toggle {
position: relative;
display: inline-block;
width: 40px;
height: 22px;
flex-shrink: 0;
}
.config-toggle input {
opacity: 0;
width: 0;
height: 0;
}
.config-toggle-slider {
position: absolute;
cursor: pointer;
inset: 0;
background: var(--bg-hover);
border: 1px solid var(--border);
border-radius: 22px;
transition: background 200ms, border-color 200ms;
}
.config-toggle-slider::before {
content: "";
position: absolute;
height: 16px;
width: 16px;
left: 2px;
bottom: 2px;
background: var(--text-muted);
border-radius: 50%;
transition: transform 200ms, background 200ms;
}
.config-toggle input:checked + .config-toggle-slider {
background: rgba(34,197,94,0.2);
border-color: #22c55e;
}
.config-toggle input:checked + .config-toggle-slider::before {
transform: translateX(18px);
background: #22c55e;
}