feat: Implement recent chats feature with API endpoint and UI integration

This commit is contained in:
Andre Beging
2025-10-07 15:08:33 +02:00
parent 85094f8683
commit ddf29c1d36
7 changed files with 682 additions and 3 deletions

View File

@@ -68,6 +68,18 @@ main {
padding: 0 clamp(1rem, 6vw, 4rem) 4rem;
}
.helper-row {
display: flex;
justify-content: center;
align-items: center;
gap: 1rem;
}
.helper-button {
min-width: 14rem;
font-weight: 600;
}
.card {
background: linear-gradient(145deg, rgba(23, 30, 50, 0.92), rgba(10, 12, 22, 0.9));
border-radius: var(--border-radius);
@@ -402,6 +414,172 @@ button:active {
gap: 0.75rem;
}
.recent-chats-modal {
position: fixed;
inset: 0;
background: rgba(10, 13, 24, 0.78);
display: flex;
align-items: center;
justify-content: center;
padding: clamp(1rem, 6vw, 3rem);
z-index: 1000;
}
.modal-card {
background: linear-gradient(145deg, rgba(22, 28, 48, 0.95), rgba(9, 11, 22, 0.92));
border-radius: var(--border-radius);
border: 1px solid rgba(255, 255, 255, 0.08);
max-width: min(34rem, 100%);
width: 100%;
padding: clamp(1.25rem, 4vw, 2.5rem);
box-shadow: 0 28px 60px rgba(8, 12, 24, 0.55);
display: grid;
gap: 1.25rem;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
}
.modal-header h2 {
margin: 0;
font-size: 1.35rem;
}
.modal-close {
width: 2.5rem;
height: 2.5rem;
}
.recent-chats-description {
margin: 0;
color: var(--muted);
font-size: 0.95rem;
}
.recent-chats-search-wrapper {
display: flex;
}
.recent-chats-search {
width: 100%;
margin-top: 0.5rem;
}
.recent-chats-list {
display: grid;
gap: 1rem;
max-height: min(24rem, 60vh);
overflow-y: auto;
padding-right: 0.5rem;
}
.recent-chat-item {
background: rgba(255, 255, 255, 0.04);
border-radius: 14px;
border: 1px solid rgba(255, 255, 255, 0.06);
padding: 0.85rem clamp(0.75rem, 4vw, 1rem);
display: grid;
gap: 0.75rem;
}
.recent-chat-details {
display: grid;
gap: 0.35rem;
}
.recent-chat-name {
font-weight: 600;
font-size: 1rem;
}
.recent-chat-meta {
font-size: 0.85rem;
color: var(--muted);
}
.recent-chat-extra {
font-size: 0.85rem;
color: var(--muted);
opacity: 0.85;
}
.recent-chat-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
}
.recent-chat-label {
font-size: 0.85rem;
color: var(--muted);
flex: 0 0 auto;
min-width: 5.5rem;
}
.recent-chat-actions {
display: flex;
align-items: center;
flex: 1 1 auto;
}
.recent-chat-value-button {
display: inline-flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
padding: 0.35rem 0.55rem;
background: rgba(255, 255, 255, 0.05);
border-radius: 8px;
border: 1px solid rgba(255, 255, 255, 0.06);
font-size: 0.9rem;
font-family: inherit;
color: inherit;
min-height: 2.25rem;
width: 100%;
cursor: pointer;
transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.recent-chat-value-button:hover:not(:disabled),
.recent-chat-value-button:focus-visible {
background: rgba(79, 140, 255, 0.12);
border-color: rgba(79, 140, 255, 0.35);
box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
outline: none;
}
.recent-chat-value-button:disabled,
.recent-chat-value-button[aria-disabled="true"] {
cursor: not-allowed;
opacity: 0.65;
}
.recent-chat-value {
flex: 1 1 auto;
word-break: break-all;
user-select: all;
text-align: left;
}
.recent-chat-copy-icon {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
color: var(--muted);
}
.recent-chat-feedback {
min-height: 1rem;
font-size: 0.8rem;
color: var(--muted);
}
.hidden {
display: none !important;
}
@@ -416,6 +594,15 @@ button:active {
text-align: center;
}
.recent-chats-modal {
padding: 0.75rem;
}
.modal-card {
max-height: 90vh;
padding: 1rem;
}
.site-identity {
flex-direction: column;
gap: 1rem;