feat(KB-086): complete Step 6 — create ActivityLogModal component with styles
This commit is contained in:
329
packages/dashboard/app/components/ActivityLogModal.tsx
Normal file
329
packages/dashboard/app/components/ActivityLogModal.tsx
Normal file
@@ -0,0 +1,329 @@
|
|||||||
|
import { useState, useEffect, useCallback, useRef } from "react";
|
||||||
|
import { X, History, Trash2, Filter, RefreshCw, CheckCircle, XCircle, ArrowRight, Plus, Settings, AlertCircle, Loader2 } from "lucide-react";
|
||||||
|
import { fetchActivityLog, clearActivityLog, type ActivityLogEntry, type ActivityEventType } from "../api";
|
||||||
|
import type { Task } from "@kb/core";
|
||||||
|
|
||||||
|
interface ActivityLogModalProps {
|
||||||
|
isOpen: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
tasks: Task[];
|
||||||
|
onOpenTaskDetail?: (taskId: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const EVENT_TYPE_LABELS: Record<ActivityEventType, string> = {
|
||||||
|
"task:created": "Task Created",
|
||||||
|
"task:moved": "Task Moved",
|
||||||
|
"task:updated": "Task Updated",
|
||||||
|
"task:deleted": "Task Deleted",
|
||||||
|
"task:merged": "Task Merged",
|
||||||
|
"task:failed": "Task Failed",
|
||||||
|
"settings:updated": "Settings Updated",
|
||||||
|
};
|
||||||
|
|
||||||
|
const EVENT_TYPE_ICONS: Record<ActivityEventType, React.ReactNode> = {
|
||||||
|
"task:created": <Plus size={14} className="activity-icon created" />,
|
||||||
|
"task:moved": <ArrowRight size={14} className="activity-icon moved" />,
|
||||||
|
"task:updated": <RefreshCw size={14} className="activity-icon updated" />,
|
||||||
|
"task:deleted": <X size={14} className="activity-icon deleted" />,
|
||||||
|
"task:merged": <CheckCircle size={14} className="activity-icon merged" />,
|
||||||
|
"task:failed": <XCircle size={14} className="activity-icon failed" />,
|
||||||
|
"settings:updated": <Settings size={14} className="activity-icon settings" />,
|
||||||
|
};
|
||||||
|
|
||||||
|
function formatTimestamp(timestamp: string): string {
|
||||||
|
const date = new Date(timestamp);
|
||||||
|
const now = new Date();
|
||||||
|
const diffMs = now.getTime() - date.getTime();
|
||||||
|
const diffMins = Math.floor(diffMs / 60000);
|
||||||
|
const diffHours = Math.floor(diffMs / 3600000);
|
||||||
|
const diffDays = Math.floor(diffMs / 86400000);
|
||||||
|
|
||||||
|
if (diffMins < 1) return "Just now";
|
||||||
|
if (diffMins < 60) return `${diffMins}m ago`;
|
||||||
|
if (diffHours < 24) return `${diffHours}h ago`;
|
||||||
|
if (diffDays < 7) return `${diffDays}d ago`;
|
||||||
|
|
||||||
|
return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ActivityLogModal({ isOpen, onClose, tasks, onOpenTaskDetail }: ActivityLogModalProps) {
|
||||||
|
const [entries, setEntries] = useState<ActivityLogEntry[]>([]);
|
||||||
|
const [filteredType, setFilteredType] = useState<ActivityEventType | "all">("all");
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [showConfirmClear, setShowConfirmClear] = useState(false);
|
||||||
|
const [hasMore, setHasMore] = useState(false);
|
||||||
|
const pollingRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
|
||||||
|
const loadActivityLog = useCallback(async (since?: string) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
setError(null);
|
||||||
|
const options: { limit: number; since?: string; type?: ActivityEventType } = {
|
||||||
|
limit: 100,
|
||||||
|
since,
|
||||||
|
};
|
||||||
|
if (filteredType !== "all") {
|
||||||
|
options.type = filteredType;
|
||||||
|
}
|
||||||
|
const data = await fetchActivityLog(options);
|
||||||
|
if (since) {
|
||||||
|
// Append older entries
|
||||||
|
setEntries((prev) => [...prev, ...data]);
|
||||||
|
} else {
|
||||||
|
// Replace with fresh entries
|
||||||
|
setEntries(data);
|
||||||
|
}
|
||||||
|
setHasMore(data.length === 100);
|
||||||
|
} catch (err) {
|
||||||
|
setError(err instanceof Error ? err.message : "Failed to load activity log");
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
}, [filteredType]);
|
||||||
|
|
||||||
|
// Initial load and filter change
|
||||||
|
useEffect(() => {
|
||||||
|
if (isOpen) {
|
||||||
|
loadActivityLog();
|
||||||
|
}
|
||||||
|
}, [isOpen, loadActivityLog]);
|
||||||
|
|
||||||
|
// Auto-refresh every 30 seconds when modal is open
|
||||||
|
useEffect(() => {
|
||||||
|
if (isOpen) {
|
||||||
|
pollingRef.current = setInterval(() => {
|
||||||
|
loadActivityLog();
|
||||||
|
}, 30000);
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
if (pollingRef.current) {
|
||||||
|
clearInterval(pollingRef.current);
|
||||||
|
pollingRef.current = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, [isOpen, loadActivityLog]);
|
||||||
|
|
||||||
|
const handleLoadMore = () => {
|
||||||
|
if (entries.length > 0) {
|
||||||
|
const lastEntry = entries[entries.length - 1];
|
||||||
|
loadActivityLog(lastEntry.timestamp);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClearLog = async () => {
|
||||||
|
try {
|
||||||
|
await clearActivityLog();
|
||||||
|
setEntries([]);
|
||||||
|
setShowConfirmClear(false);
|
||||||
|
} catch (err) {
|
||||||
|
setError(err instanceof Error ? err.message : "Failed to clear activity log");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleTaskClick = (taskId: string) => {
|
||||||
|
if (onOpenTaskDetail) {
|
||||||
|
onOpenTaskDetail(taskId);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle escape key to close
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isOpen) return;
|
||||||
|
const handleKey = (e: KeyboardEvent) => {
|
||||||
|
if (e.key === "Escape") {
|
||||||
|
if (showConfirmClear) {
|
||||||
|
setShowConfirmClear(false);
|
||||||
|
} else {
|
||||||
|
onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
document.addEventListener("keydown", handleKey);
|
||||||
|
return () => document.removeEventListener("keydown", handleKey);
|
||||||
|
}, [isOpen, onClose, showConfirmClear]);
|
||||||
|
|
||||||
|
if (!isOpen) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="modal-overlay open"
|
||||||
|
onClick={(e) => {
|
||||||
|
if (e.target === e.currentTarget) onClose();
|
||||||
|
}}
|
||||||
|
data-testid="activity-log-modal-overlay"
|
||||||
|
>
|
||||||
|
<div className="modal activity-log-modal" data-testid="activity-log-modal">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="activity-log-header">
|
||||||
|
<div className="activity-log-title">
|
||||||
|
<History size={18} />
|
||||||
|
<span>Activity Log</span>
|
||||||
|
</div>
|
||||||
|
<div className="activity-log-actions">
|
||||||
|
{/* Filter dropdown */}
|
||||||
|
<div className="activity-log-filter">
|
||||||
|
<Filter size={14} />
|
||||||
|
<select
|
||||||
|
value={filteredType}
|
||||||
|
onChange={(e) => setFilteredType(e.target.value as ActivityEventType | "all")}
|
||||||
|
className="activity-log-filter-select"
|
||||||
|
data-testid="activity-filter"
|
||||||
|
>
|
||||||
|
<option value="all">All Events</option>
|
||||||
|
{Object.entries(EVENT_TYPE_LABELS).map(([type, label]) => (
|
||||||
|
<option key={type} value={type}>
|
||||||
|
{label}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Refresh button */}
|
||||||
|
<button
|
||||||
|
className="activity-log-refresh"
|
||||||
|
onClick={() => loadActivityLog()}
|
||||||
|
disabled={isLoading}
|
||||||
|
title="Refresh"
|
||||||
|
data-testid="activity-refresh"
|
||||||
|
>
|
||||||
|
{isLoading ? <Loader2 size={14} className="spin" /> : <RefreshCw size={14} />}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{/* Clear button */}
|
||||||
|
{entries.length > 0 && (
|
||||||
|
<button
|
||||||
|
className="activity-log-clear"
|
||||||
|
onClick={() => setShowConfirmClear(true)}
|
||||||
|
title="Clear Log"
|
||||||
|
data-testid="activity-clear"
|
||||||
|
>
|
||||||
|
<Trash2 size={14} />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Close button */}
|
||||||
|
<button
|
||||||
|
className="activity-log-close"
|
||||||
|
onClick={onClose}
|
||||||
|
title="Close"
|
||||||
|
data-testid="activity-close"
|
||||||
|
>
|
||||||
|
<X size={18} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Content */}
|
||||||
|
<div className="activity-log-content" data-testid="activity-log-content">
|
||||||
|
{error && (
|
||||||
|
<div className="activity-log-error" data-testid="activity-error">
|
||||||
|
<AlertCircle size={16} />
|
||||||
|
<span>{error}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{entries.length === 0 && !isLoading && !error && (
|
||||||
|
<div className="activity-log-empty" data-testid="activity-empty">
|
||||||
|
<History size={48} className="activity-log-empty-icon" />
|
||||||
|
<p>No activity recorded yet</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="activity-log-list">
|
||||||
|
{entries.map((entry) => (
|
||||||
|
<div
|
||||||
|
key={entry.id}
|
||||||
|
className="activity-log-entry"
|
||||||
|
data-testid="activity-entry"
|
||||||
|
>
|
||||||
|
<div className="activity-log-entry-icon">
|
||||||
|
{EVENT_TYPE_ICONS[entry.type]}
|
||||||
|
</div>
|
||||||
|
<div className="activity-log-entry-content">
|
||||||
|
<div className="activity-log-entry-header">
|
||||||
|
<span className="activity-log-entry-type">
|
||||||
|
{EVENT_TYPE_LABELS[entry.type]}
|
||||||
|
</span>
|
||||||
|
<span className="activity-log-entry-time">
|
||||||
|
{formatTimestamp(entry.timestamp)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="activity-log-entry-details">
|
||||||
|
{entry.taskId && (
|
||||||
|
<button
|
||||||
|
className="activity-log-task-link"
|
||||||
|
onClick={() => handleTaskClick(entry.taskId!)}
|
||||||
|
data-testid="activity-task-link"
|
||||||
|
>
|
||||||
|
{entry.taskId}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{entry.taskTitle && (
|
||||||
|
<span className="activity-log-task-title">{entry.taskTitle}</span>
|
||||||
|
)}
|
||||||
|
<span className="activity-log-entry-text">{entry.details}</span>
|
||||||
|
</div>
|
||||||
|
{entry.metadata && Object.keys(entry.metadata).length > 0 && (
|
||||||
|
<div className="activity-log-entry-metadata">
|
||||||
|
{entry.metadata.from && entry.metadata.to && (
|
||||||
|
<span className="activity-log-metadata-item">
|
||||||
|
{entry.metadata.from} → {entry.metadata.to}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{entry.metadata.merged !== undefined && (
|
||||||
|
<span className={`activity-log-metadata-item ${entry.metadata.merged ? "success" : "error"}`}>
|
||||||
|
{entry.metadata.merged ? "Merged" : "Not merged"}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{hasMore && !isLoading && (
|
||||||
|
<button
|
||||||
|
className="activity-log-load-more"
|
||||||
|
onClick={handleLoadMore}
|
||||||
|
data-testid="activity-load-more"
|
||||||
|
>
|
||||||
|
Load More
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{isLoading && entries.length > 0 && (
|
||||||
|
<div className="activity-log-loading">
|
||||||
|
<Loader2 size={20} className="spin" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Confirmation dialog for clear */}
|
||||||
|
{showConfirmClear && (
|
||||||
|
<div className="activity-log-confirm-overlay">
|
||||||
|
<div className="activity-log-confirm-dialog">
|
||||||
|
<h3>Clear Activity Log?</h3>
|
||||||
|
<p>This will permanently delete all activity log entries. This action cannot be undone.</p>
|
||||||
|
<div className="activity-log-confirm-actions">
|
||||||
|
<button
|
||||||
|
className="activity-log-confirm-cancel"
|
||||||
|
onClick={() => setShowConfirmClear(false)}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="activity-log-confirm-clear"
|
||||||
|
onClick={handleClearLog}
|
||||||
|
>
|
||||||
|
Clear Log
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -8216,3 +8216,374 @@ html .column.drag-over * {
|
|||||||
border-top: 1px solid var(--border);
|
border-top: 1px solid var(--border);
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ── Activity Log Modal ─────────────────────────────────────────── */
|
||||||
|
|
||||||
|
.activity-log-modal {
|
||||||
|
max-width: 600px;
|
||||||
|
max-height: 80vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 16px 20px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border-radius: 12px 12px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-filter {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
background: var(--bg);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 6px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-filter-select {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 13px;
|
||||||
|
cursor: pointer;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-refresh,
|
||||||
|
.activity-log-clear,
|
||||||
|
.activity-log-close {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 6px;
|
||||||
|
transition: background var(--transition-fast), color var(--transition-fast);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-refresh:hover,
|
||||||
|
.activity-log-clear:hover {
|
||||||
|
background: var(--card-hover);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-close:hover {
|
||||||
|
background: var(--color-red, rgba(239, 68, 68, 0.1));
|
||||||
|
color: var(--color-red, #ef4444);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-content {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 16px 20px;
|
||||||
|
min-height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-empty {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 60px 20px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-empty-icon {
|
||||||
|
opacity: 0.3;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-empty p {
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-error {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
background: var(--color-red, rgba(239, 68, 68, 0.1));
|
||||||
|
color: var(--color-red, #ef4444);
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-icon {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: var(--bg);
|
||||||
|
border-radius: 6px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon {
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon.created {
|
||||||
|
color: var(--todo, #58a6ff);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon.moved {
|
||||||
|
color: var(--in-progress, #f0883e);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon.updated {
|
||||||
|
color: var(--info, #79c0ff);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon.deleted {
|
||||||
|
color: var(--color-red, #ef4444);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon.merged {
|
||||||
|
color: var(--done, #3fb950);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon.failed {
|
||||||
|
color: var(--color-red, #ef4444);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon.settings {
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-content {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-type {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-time {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-details {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-task-link {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--todo, #58a6ff);
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-task-link:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-task-title {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-text {
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-entry-metadata {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-metadata-item {
|
||||||
|
font-size: 11px;
|
||||||
|
padding: 2px 8px;
|
||||||
|
background: var(--bg);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-metadata-item.success {
|
||||||
|
color: var(--done, #3fb950);
|
||||||
|
background: rgba(63, 185, 80, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-metadata-item.error {
|
||||||
|
color: var(--color-red, #ef4444);
|
||||||
|
background: rgba(239, 68, 68, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-load-more {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
margin-top: 16px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 13px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background var(--transition-fast);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-load-more:hover {
|
||||||
|
background: var(--card-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-loading {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-loading .spin {
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Confirmation dialog */
|
||||||
|
.activity-log-confirm-overlay {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 100;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-dialog {
|
||||||
|
background: var(--bg);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 24px;
|
||||||
|
max-width: 360px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-dialog h3 {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-dialog p {
|
||||||
|
margin: 0 0 20px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-cancel,
|
||||||
|
.activity-log-confirm-clear {
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background var(--transition-fast);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-cancel {
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-cancel:hover {
|
||||||
|
background: var(--card-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-clear {
|
||||||
|
background: var(--color-red, #ef4444);
|
||||||
|
border: 1px solid var(--color-red, #ef4444);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-log-confirm-clear:hover {
|
||||||
|
background: #dc2626;
|
||||||
|
border-color: #dc2626;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user