feat: Add Notifications Component with WebSocket and Auto Refresh

- Implemented a Notifications component for real-time updates using WebSocket.
- Added silent refresh functionality to update data without notification bubbles.
- Introduced auto-refresh mechanism to periodically check for changes in workflow data.
- Enhanced data handling with session and task updates, ensuring UI reflects the latest state.

feat: Create Hook Manager View for Managing Hooks

- Developed a Hook Manager view to manage project and global hooks.
- Added functionality to create, edit, and delete hooks with a user-friendly interface.
- Implemented quick install templates for common hooks to streamline user experience.
- Included environment variables reference for hooks to assist users in configuration.

feat: Implement MCP Manager View for Server Management

- Created an MCP Manager view for managing MCP servers within projects.
- Enabled adding and removing servers from projects with a clear UI.
- Displayed available servers from other projects for easy access and management.
- Provided an overview of all projects and their associated MCP servers.

feat: Add Version Fetcher Utility for GitHub Releases

- Implemented a version fetcher utility to retrieve release information from GitHub.
- Added functions to fetch the latest release, recent releases, and latest commit details.
- Included functionality to download and extract repository zip files.
- Ensured cleanup of temporary directories after downloads to maintain system hygiene.
This commit is contained in:
catlog22
2025-12-07 15:48:39 +08:00
parent 724545ebd6
commit 43c962b48b
18 changed files with 4250 additions and 42 deletions

View File

@@ -5658,3 +5658,588 @@ code.ctx-meta-chip-value {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* ==========================================
MCP MANAGER STYLES
========================================== */
.mcp-manager {
width: 100%;
}
.mcp-section {
margin-bottom: 2rem;
width: 100%;
}
.mcp-server-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1rem;
width: 100%;
}
.mcp-server-card {
position: relative;
}
.mcp-server-card.opacity-60 {
opacity: 0.6;
}
.mcp-server-available {
border-style: dashed;
}
.mcp-server-available:hover {
border-style: solid;
}
/* MCP Toggle Switch */
.mcp-toggle {
position: relative;
display: inline-flex;
align-items: center;
}
.mcp-toggle input {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.mcp-toggle > div {
width: 36px;
height: 20px;
background: hsl(var(--muted));
border-radius: 10px;
position: relative;
transition: background 0.2s;
}
.mcp-toggle > div::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 16px;
height: 16px;
background: white;
border-radius: 50%;
transition: transform 0.2s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.mcp-toggle input:checked + div {
background: hsl(var(--success));
}
.mcp-toggle input:checked + div::after {
transform: translateX(16px);
}
.mcp-toggle input:focus + div {
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}
/* MCP Projects List */
.mcp-projects-list {
max-height: 400px;
overflow-y: auto;
}
.mcp-project-item {
transition: background 0.15s;
}
.mcp-project-item:hover {
background: hsl(var(--hover));
}
.mcp-project-item.bg-primary-light {
background: hsl(var(--primary-light));
}
/* MCP Empty State */
.mcp-empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 120px;
}
/* MCP Server Details */
.mcp-server-details {
font-size: 0.875rem;
}
.mcp-server-details .font-mono {
font-family: var(--font-mono);
}
/* MCP Create Modal */
.mcp-modal {
animation: fadeIn 0.15s ease-out;
}
.mcp-modal-backdrop {
animation: fadeIn 0.15s ease-out;
}
.mcp-modal-content {
animation: slideUp 0.2s ease-out;
}
.mcp-modal.hidden {
display: none;
}
.mcp-modal .form-group label {
display: block;
margin-bottom: 0.25rem;
}
.mcp-modal input,
.mcp-modal textarea {
transition: border-color 0.15s, box-shadow 0.15s;
}
.mcp-modal input:focus,
.mcp-modal textarea:focus {
border-color: hsl(var(--primary));
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
/* ==========================================
HOOK MANAGER STYLES
========================================== */
.hook-manager {
width: 100%;
}
.hook-section {
margin-bottom: 2rem;
width: 100%;
}
.hook-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1rem;
width: 100%;
}
.hook-card {
position: relative;
}
.hook-details {
font-size: 0.875rem;
}
.hook-details .font-mono {
font-family: var(--font-mono);
}
.hook-templates-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1rem;
}
.hook-template-card {
transition: all 0.2s ease;
}
.hook-template-card:hover {
box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
}
/* Hook Empty State */
.hook-empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 120px;
}
/* Hook Modal */
.hook-modal {
animation: fadeIn 0.15s ease-out;
}
.hook-modal-backdrop {
animation: fadeIn 0.15s ease-out;
}
.hook-modal-content {
animation: slideUp 0.2s ease-out;
}
.hook-modal.hidden {
display: none;
}
.hook-modal .form-group label {
display: block;
margin-bottom: 0.25rem;
}
.hook-modal input,
.hook-modal textarea,
.hook-modal select {
transition: border-color 0.15s, box-shadow 0.15s;
}
.hook-modal input:focus,
.hook-modal textarea:focus,
.hook-modal select:focus {
border-color: hsl(var(--primary));
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}
.hook-template-btn {
transition: all 0.15s ease;
}
.hook-template-btn:hover {
background: hsl(var(--hover));
border-color: hsl(var(--primary));
}
/* ==========================================
STATS SECTION & CAROUSEL
========================================== */
.stats-section {
min-height: 180px;
}
.stats-metrics {
width: 300px;
}
.stats-carousel {
position: relative;
}
.carousel-header {
height: 40px;
}
.carousel-btn {
transition: all 0.15s;
}
.carousel-btn:hover {
background: hsl(var(--hover));
}
/* Carousel dots indicator */
.carousel-dots {
display: flex;
align-items: center;
gap: 6px;
}
.carousel-dot {
cursor: pointer;
border: none;
padding: 0;
transition: all 0.2s ease;
}
.carousel-dot:focus {
outline: none;
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.3);
}
.carousel-footer {
flex-shrink: 0;
}
.carousel-content {
position: relative;
overflow: hidden;
}
.carousel-slide {
position: absolute;
inset: 0;
}
.carousel-empty {
position: absolute;
inset: 0;
}
/* Carousel slide animations */
.carousel-fade-in {
animation: carouselFadeIn 0.3s ease-out forwards;
}
.carousel-slide-left {
animation: carouselSlideLeft 0.35s ease-out forwards;
}
.carousel-slide-right {
animation: carouselSlideRight 0.35s ease-out forwards;
}
@keyframes carouselFadeIn {
from {
opacity: 0;
transform: scale(0.98);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes carouselSlideLeft {
from {
opacity: 0;
transform: translateX(100%);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes carouselSlideRight {
from {
opacity: 0;
transform: translateX(-100%);
}
to {
opacity: 1;
transform: translateX(0);
}
}
/* Task card in carousel */
.carousel-slide .task-card {
height: 100%;
display: flex;
flex-direction: column;
}
.carousel-slide .task-timestamps {
flex-grow: 1;
}
.carousel-slide .task-session-info {
margin-top: auto;
}
/* Task status badge pulse for in_progress */
.task-status-badge {
transition: all 0.2s;
}
.bg-warning-light .task-status-badge {
animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
/* Task highlight animation when navigating from carousel */
.task-highlight {
animation: taskHighlight 0.5s ease-out 3;
}
@keyframes taskHighlight {
0%, 100% {
background: transparent;
box-shadow: none;
}
50% {
background: hsl(var(--primary-light));
box-shadow: 0 0 0 3px hsl(var(--primary) / 0.3);
}
}
/* Line clamp utility */
.line-clamp-1 {
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.line-clamp-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* Highlight pulse effect */
.highlight-pulse {
animation: highlightPulse 0.5s ease-out 2;
}
@keyframes highlightPulse {
0%, 100% {
box-shadow: none;
}
50% {
box-shadow: 0 0 0 3px hsl(var(--primary) / 0.3);
}
}
/* ==========================================
NOTIFICATION BUBBLES
========================================== */
.notification-bubble {
position: fixed;
top: 70px;
right: 20px;
max-width: 360px;
padding: 12px 16px;
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
border-radius: 8px;
box-shadow: 0 8px 24px rgb(0 0 0 / 0.15);
z-index: 1000;
display: flex;
align-items: center;
gap: 8px;
opacity: 0;
transform: translateX(100%);
transition: all 0.3s ease-out;
}
.notification-bubble.show {
opacity: 1;
transform: translateX(0);
}
.notification-bubble.fade-out {
opacity: 0;
transform: translateX(100%);
}
.notification-bubble:nth-child(2) {
top: 130px;
}
.notification-bubble:nth-child(3) {
top: 190px;
}
.notification-content {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
}
.notification-icon {
font-size: 1.25rem;
}
.notification-message {
font-size: 0.875rem;
color: hsl(var(--foreground));
flex: 1;
}
.notification-action {
padding: 4px 12px;
background: hsl(var(--primary));
color: hsl(var(--primary-foreground));
border: none;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
cursor: pointer;
transition: opacity 0.15s;
}
.notification-action:hover {
opacity: 0.9;
}
.notification-close {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: none;
color: hsl(var(--muted-foreground));
font-size: 1.25rem;
cursor: pointer;
border-radius: 4px;
transition: all 0.15s;
}
.notification-close:hover {
background: hsl(var(--hover));
color: hsl(var(--foreground));
}
/* Notification types */
.notification-success {
border-left: 3px solid hsl(var(--success));
}
.notification-warning {
border-left: 3px solid hsl(var(--warning));
}
.notification-error {
border-left: 3px solid hsl(var(--destructive));
}
.notification-info {
border-left: 3px solid hsl(var(--primary));
}
/* Responsive stats section */
@media (max-width: 768px) {
.stats-section {
flex-direction: column;
}
.stats-metrics {
width: 100%;
grid-template-columns: repeat(4, 1fr);
}
.stats-carousel {
min-height: 160px;
}
}