feat: add notifications and project shares features
- Backend: notifications + shares routes, DB tables, SqliteAdapter methods - Frontend: NotificationPanel (bell icon + dropdown), ShareDialog, Dashboard integration - Styles: notification + share dialog CSS
This commit is contained in:
@@ -2010,3 +2010,109 @@ body.drawer-open { overflow: hidden; }
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
/* ─── Notification Panel ─────────────────────────────── */
|
||||
.dashboard-header-actions { display: flex; align-items: center; gap: 12px; }
|
||||
.notification-panel-wrapper { position: relative; }
|
||||
.notification-bell-btn {
|
||||
position: relative; background: none; border: none; cursor: pointer;
|
||||
color: var(--color-text-muted); padding: 6px; border-radius: 6px; transition: background 0.2s;
|
||||
}
|
||||
.notification-bell-btn:hover { background: var(--color-border); }
|
||||
.notification-badge {
|
||||
position: absolute; top: 0; right: 0; background: var(--color-primary); color: white;
|
||||
font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
|
||||
display: flex; align-items: center; justify-content: center; padding: 0 4px;
|
||||
}
|
||||
.notification-dropdown {
|
||||
position: absolute; top: 100%; right: 0; margin-top: 8px; width: 360px;
|
||||
background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 8px;
|
||||
box-shadow: 0 8px 24px rgba(0,0,0,0.3); z-index: 1000; max-height: 480px; overflow-y: auto;
|
||||
}
|
||||
.notification-dropdown-header {
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
padding: 12px 16px; border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.notification-dropdown-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
|
||||
.notification-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--color-text-muted); }
|
||||
.notification-loading, .notification-empty { padding: 16px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
|
||||
.notification-list { padding: 4px 0; }
|
||||
.notification-item {
|
||||
display: flex; justify-content: space-between; align-items: flex-start;
|
||||
padding: 10px 16px; border-bottom: 1px solid var(--color-border); gap: 8px;
|
||||
}
|
||||
.notification-item.unread { background: rgba(52, 152, 219, 0.08); }
|
||||
.notification-item-content { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
||||
.notification-type-badge {
|
||||
font-size: 10px; text-transform: uppercase; font-weight: 600; color: var(--color-text-muted);
|
||||
padding: 1px 6px; border-radius: 3px; background: var(--color-border); align-self: flex-start;
|
||||
}
|
||||
.notification-type-badge.type-share { color: #2ecc71; background: rgba(46, 204, 113, 0.15); }
|
||||
.notification-type-badge.type-info { color: #3498db; background: rgba(52, 152, 219, 0.15); }
|
||||
.notification-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
|
||||
.notification-message { font-size: 12px; color: var(--color-text-muted); line-height: 1.4; }
|
||||
.notification-time { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
|
||||
.notification-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
|
||||
.notification-action-btn {
|
||||
background: none; border: none; cursor: pointer; padding: 4px;
|
||||
color: var(--color-text-muted); border-radius: 4px; transition: background 0.2s;
|
||||
}
|
||||
.notification-action-btn:hover { background: var(--color-border); }
|
||||
.notification-action-btn.delete:hover { color: #e74c3c; }
|
||||
|
||||
/* ─── Share Dialog ────────────────────────────────────── */
|
||||
.share-dialog-overlay {
|
||||
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
|
||||
background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000;
|
||||
}
|
||||
.share-dialog {
|
||||
background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 12px;
|
||||
width: 440px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,0.4);
|
||||
}
|
||||
.share-dialog-header {
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
padding: 16px 20px; border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.share-dialog-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
|
||||
.share-dialog-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--color-text-muted); }
|
||||
.share-dialog-body { padding: 20px; }
|
||||
.share-form { display: flex; gap: 8px; margin-bottom: 16px; }
|
||||
.share-email-input {
|
||||
flex: 1; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 6px;
|
||||
background: var(--color-bg); color: var(--color-text); font-size: 13px;
|
||||
}
|
||||
.share-permission-select {
|
||||
padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 6px;
|
||||
background: var(--color-bg); color: var(--color-text); font-size: 13px;
|
||||
}
|
||||
.share-add-btn {
|
||||
padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer;
|
||||
background: var(--color-primary); color: white; font-size: 13px; font-weight: 600;
|
||||
}
|
||||
.share-add-btn:hover { opacity: 0.9; }
|
||||
.share-error { color: #e74c3c; font-size: 12px; margin: 8px 0; }
|
||||
.share-loading, .share-empty { padding: 16px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
|
||||
.share-list { display: flex; flex-direction: column; gap: 8px; }
|
||||
.share-item {
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 6px;
|
||||
}
|
||||
.share-item-info { display: flex; align-items: center; gap: 8px; }
|
||||
.share-email { font-size: 13px; color: var(--color-text); }
|
||||
.share-permission-badge {
|
||||
font-size: 10px; text-transform: uppercase; font-weight: 600; padding: 2px 8px;
|
||||
border-radius: 4px; background: var(--color-border); color: var(--color-text-muted);
|
||||
}
|
||||
.share-remove-btn {
|
||||
background: none; border: none; cursor: pointer; padding: 4px;
|
||||
color: var(--color-text-muted); border-radius: 4px; transition: color 0.2s;
|
||||
}
|
||||
.share-remove-btn:hover { color: #e74c3c; }
|
||||
|
||||
/* ─── Dashboard Share Button ──────────────────────────── */
|
||||
.dashboard-project-actions { display: flex; gap: 6px; }
|
||||
.dashboard-share-btn {
|
||||
padding: 4px 10px; border: 1px solid var(--color-border); border-radius: 4px;
|
||||
background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 12px;
|
||||
}
|
||||
.dashboard-share-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user