fix: UX audit improvements - dark theme, structured errors, heartbeat, health check

Phase 1 - UI Theme Consistency:
- Chat messages now use consistent dark theme (removed jarring white bg)
- Plan cards restyled with rounded borders, fills, colored status badges
- Timeline entries use humanist sans-serif instead of monospace
- Error messages now structured (icon + title + detail + action link)
- Input area unified with dark theme cohesion

Phase 2 - UX Flow:
- Added contextual placeholder text per agent mode in textarea
- Added visual mode indicator badge (Chat/Planning/Writing)
- Simplified welcome screen (single 'Continue' + collapsible history)
- Added slash command/mention discovery hint in empty input
- Added write confirmation when editor has existing content
- Added 30s streaming heartbeat (reassurance when model is slow)

Phase 3 - Error Handling:
- Added DB table health check on sidebar init
- Improved 'no API key' error with settings link
- Shows in-chat warning when provider fallback triggers
- Auto-fallback to registry fallback model on unavailability
- isLoading always resets via try/finally pattern
This commit is contained in:
Dwindi Ramadhana
2026-06-06 00:43:10 +07:00
parent ae70e4aea9
commit f7bf1f5153
5 changed files with 588 additions and 202 deletions

View File

@@ -144,10 +144,10 @@
display: flex;
flex-direction: column;
overflow: hidden;
background: #ffffff;
background: #1a1d23;
border-radius: 0;
min-height: 0;
border: 1px solid #dcdcde;
border: 1px solid #2d3139;
}
.wpaw-messages-inner {
@@ -163,24 +163,24 @@
}
.wpaw-messages-inner::-webkit-scrollbar-track {
background: #f0f0f1;
background: #1a1d23;
border-radius: 0;
}
.wpaw-messages-inner::-webkit-scrollbar-thumb {
background: #c3c4c7;
border-radius: 0;
background: #3d4450;
border-radius: 3px;
}
.wpaw-messages-inner::-webkit-scrollbar-thumb:hover {
background: #8c8f94;
background: #525b6b;
}
.wpaw-input-area {
background: #f6f7f7;
background: #1e2128;
padding: 12px;
border-radius: 0;
border: 1px solid #dcdcde;
border: 1px solid #2d3139;
border-top: none;
margin-top: auto;
}
@@ -194,7 +194,7 @@
.wpaw-input-label {
font-size: 12px;
color: #5f6b7a;
color: #8b95a5;
font-weight: 600;
letter-spacing: 0.02em;
text-transform: uppercase;
@@ -202,24 +202,24 @@
.wpaw-mode-select {
padding: 6px 8px;
border-radius: 2px;
border: 1px solid #8c8f94;
background: #fff;
border-radius: 6px;
border: 1px solid #3d4450;
background: #252830;
font-size: 13px;
font-weight: 400;
color: #1d2227;
color: #c8cdd5;
cursor: pointer;
transition: border-color 0.1s ease;
}
.wpaw-mode-select:hover {
border-color: #2271b1;
border-color: #5b8def;
}
.wpaw-mode-select:focus {
outline: none;
border-color: #2271b1;
box-shadow: 0 0 0 1px #2271b1;
border-color: #5b8def;
box-shadow: 0 0 0 1px #5b8def;
}
#agentMode {
@@ -239,9 +239,10 @@
.wpaw-message {
margin-bottom: 12px;
padding: 10px 12px;
border-radius: 0;
background: #fff;
border: 1px solid #dcdcde;
border-radius: 8px;
background: #252830;
border: 1px solid #2d3139;
color: #e0e4ea;
animation: messageSlide 0.2s ease;
}
@@ -258,32 +259,71 @@
}
.wpaw-message-user {
background: #fff;
border-left: 3px solid #2271b1;
background: #2a3040;
border-left: none;
margin-left: 0;
max-width: 80%;
margin-left: auto;
border-radius: 8px;
border: 1px solid #4c4c4c;
}
.dark-theme .wpaw-message-user {
background: #252830;
border-radius: 12px 12px 4px 12px;
border: 1px solid #3b4560;
color: #e8ecf2;
}
.wpaw-message-error {
background: rgb(214, 54, 56, 0.05);
/* border-left: 3px solid #d63638; */
/* border-color: #8a1e1e; */
border: unset;
color: #d63638;
background: rgba(220, 38, 38, 0.08);
border: 1px solid rgba(220, 38, 38, 0.25);
border-left: 3px solid #ef4444;
border-radius: 8px;
color: #fca5a5;
padding: 12px 14px;
}
.wpaw-message-error .wpaw-error-title {
font-weight: 600;
font-size: 13px;
color: #fca5a5;
margin-bottom: 4px;
display: flex;
align-items: center;
gap: 6px;
}
.wpaw-message-error .wpaw-error-detail {
font-size: 12px;
color: #d4a0a0;
line-height: 1.5;
margin-top: 6px;
}
.wpaw-message-error details {
margin-top: 8px;
}
.wpaw-message-error details summary {
font-size: 11px;
color: #e87171;
cursor: pointer;
user-select: none;
}
.wpaw-message-error details[open] summary {
margin-bottom: 6px;
}
.wpaw-message-error button.is-secondary {
background: #8a1e1e;
color: white;
border: unset !important;
box-shadow: unset !important;
background: rgba(220, 38, 38, 0.15);
color: #fca5a5;
border: 1px solid rgba(220, 38, 38, 0.4) !important;
box-shadow: none !important;
border-radius: 6px;
margin-top: 8px;
font-size: 12px;
padding: 6px 14px;
transition: background 0.15s;
}
.wpaw-message-error button.is-secondary:hover {
background: rgba(220, 38, 38, 0.25);
}
/* Research message styling */
@@ -384,39 +424,48 @@
.wpaw-plan-card,
.wpaw-edit-plan {
border: 2px dashed #4c4c4c;
padding: 12px;
border-radius: 0;
background: #1e2530;
border: 1px solid #2d3a4a;
padding: 14px;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.wpaw-plan-card:hover {
border-color: #8c8f94;
border-color: #3d5070;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.wpaw-plan-title {
font-weight: 600;
font-size: 14px;
margin-bottom: 8px;
color: #e8ecf2;
}
.wpaw-plan-config-summary {
margin-bottom: 12px;
padding: 8px 10px;
background: #1a1a1a;
border: 1px solid #3c3c3c;
border-radius: 4px;
font-size: 12px;
line-height: 1.6;
.wpaw-plan-section-status {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.05em;
padding: 2px 8px;
border-radius: 10px;
margin-top: 2px;
font-weight: 600;
}
.wpaw-config-summary-item {
color: #b0b0b0;
font-family: ui-monospace, monospace;
margin-bottom: 4px;
.wpaw-plan-section.pending .wpaw-plan-section-status {
color: #94a3b8;
background: rgba(148, 163, 184, 0.1);
}
.wpaw-config-summary-item:last-child {
margin-bottom: 0;
.wpaw-plan-section.done .wpaw-plan-section-status {
color: #4ade80;
background: rgba(74, 222, 128, 0.1);
}
.wpaw-plan-section.in_progress .wpaw-plan-section-status {
color: #60a5fa;
background: rgba(96, 165, 250, 0.1);
}
.wpaw-plan-sections,
@@ -449,25 +498,6 @@ input.wpaw-plan-section-check:checked::before {
flex: 1;
}
.wpaw-plan-section-title {
font-weight: 600;
margin-bottom: 4px;
}
.wpaw-plan-section-desc {
color: #6c6c6c;
font-size: 13px;
line-height: 1.5;
}
.wpaw-plan-section-status {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #94a3b8;
margin-top: 2px;
}
.wpaw-clear-context {
margin-left: auto;
background: #f6f7f7;
@@ -584,20 +614,22 @@ input.wpaw-plan-section-check:checked::before {
}
.wpaw-ai-response pre {
background: #f1f5f9;
padding: 10px;
background: #1a1d23;
padding: 12px;
border-radius: 8px;
overflow-x: auto;
font-family: "Courier New", monospace;
font-family: ui-monospace, 'SF Mono', Menlo, monospace;
font-size: 12px;
border: 1px solid #2d3139;
color: #c8cdd5;
}
.wpaw-ai-response code {
background: #e2e8f0;
color: #1f2937;
padding: 2px 4px;
background: #2d3139;
color: #a5d6ff;
padding: 2px 5px;
border-radius: 4px;
font-family: "Courier New", monospace;
font-family: ui-monospace, 'SF Mono', Menlo, monospace;
font-size: 12px;
}
@@ -614,14 +646,6 @@ input.wpaw-plan-section-check:checked::before {
pointer-events: all;
}
.wpaw-plan-section.done .wpaw-plan-section-status {
color: #15803d;
}
.wpaw-plan-section.in_progress .wpaw-plan-section-status {
color: #2563eb;
}
/* Outline Version Tracking & Inline Editing */
.wpaw-plan-header {
display: flex;
@@ -857,12 +881,12 @@ input.wpaw-plan-section-check:checked::before {
.wpaw-response {
margin: 0 0 12px 0;
border-left: 2px solid #e0e6ed;
color: #1f2937;
border-left: 2px solid #3d4450;
color: #dce0e8;
}
.dark-theme .wpaw-response {
color: #cecece;
color: #dce0e8;
}
.wpaw-ai-response .wpaw-response {
@@ -943,70 +967,6 @@ input.wpaw-plan-section-check:checked::before {
}
}
.wpaw-response-content {
line-height: 1.6;
word-wrap: break-word;
white-space: normal;
}
.wpaw-response-content>* {
padding: 1rem;
}
.wpaw-response-content p {
margin: 0 0 8px;
}
.wpaw-response-content p:last-child {
margin-bottom: 0;
}
.wpaw-response-content h1,
.wpaw-response-content h2,
.wpaw-response-content h3,
.wpaw-response-content h4,
.wpaw-response-content h5,
.wpaw-response-content h6 {
margin: 12px 0 6px;
line-height: 1.4;
}
.wpaw-response-content ul,
.wpaw-response-content ol {
margin: 6px 0 10px 18px;
padding: 0;
}
.wpaw-response-content ul li {
list-style: square;
}
.wpaw-response-content li {
margin: 4px 0;
}
.wpaw-response-content li p {
margin: 4px 0 6px;
}
.dark-theme .wpaw-response-content *:is(h1, h2, h3, h4, h5, h6) {
color: #cecece;
font-weight: bold;
}
.wpaw-response-content table {
border: 1px solid;
border-collapse: collapse;
margin-bottom: 10px;
}
.wpaw-response-content table th,
.wpaw-response-content table td {
border: 1px solid;
padding: 5px;
text-align: left;
}
/* Timeline Progress */
.wpaw-timeline-entry {
display: flex;
@@ -1133,19 +1093,19 @@ input.wpaw-plan-section-check:checked::before {
.wpaw-timeline-content {
flex: 1;
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
color: #334155;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
color: #c8cdd5;
}
.wpaw-timeline-message {
font-size: 12px;
color: #334155;
font-size: 12.5px;
color: #c8cdd5;
margin-bottom: 5px;
line-height: 1.5;
}
.dark-theme .wpaw-timeline-message {
color: white;
color: #e0e4ea;
}
.wpaw-timeline-complete {
@@ -4589,3 +4549,237 @@ input.wpaw-plan-section-check:checked::before {
.wpaw-provider-info:has(.wpaw-fallback) {
color: #f59e0b;
}
/* ===========================
AUDIT FIXES: Mode Indicator Badge
=========================== */
.wpaw-mode-badge {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 3px 10px;
border-radius: 12px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
margin-bottom: 8px;
}
.wpaw-mode-badge.mode-chat {
background: rgba(96, 165, 250, 0.12);
color: #60a5fa;
border: 1px solid rgba(96, 165, 250, 0.25);
}
.wpaw-mode-badge.mode-planning {
background: rgba(251, 191, 36, 0.12);
color: #fbbf24;
border: 1px solid rgba(251, 191, 36, 0.25);
}
.wpaw-mode-badge.mode-writing {
background: rgba(74, 222, 128, 0.12);
color: #4ade80;
border: 1px solid rgba(74, 222, 128, 0.25);
}
/* ===========================
AUDIT FIXES: Streaming Heartbeat
=========================== */
.wpaw-heartbeat-notice {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
margin: 8px 0;
background: rgba(251, 191, 36, 0.08);
border: 1px solid rgba(251, 191, 36, 0.2);
border-radius: 8px;
font-size: 12px;
color: #fbbf24;
animation: fadeIn 0.3s ease;
}
.wpaw-heartbeat-notice .wpaw-heartbeat-icon {
animation: pulse-ring 2s infinite;
}
/* ===========================
AUDIT FIXES: Slash Command Hint
=========================== */
.wpaw-input-hint {
position: absolute;
bottom: 100%;
left: 12px;
right: 12px;
padding: 6px 10px;
background: #252830;
border: 1px solid #3d4450;
border-bottom: none;
border-radius: 8px 8px 0 0;
font-size: 11px;
color: #6b7a8d;
display: flex;
align-items: center;
gap: 6px;
}
.wpaw-input-hint kbd {
background: #3d4450;
color: #a0aec0;
padding: 1px 5px;
border-radius: 3px;
font-size: 10px;
font-family: inherit;
}
/* ===========================
AUDIT FIXES: Provider Fallback Warning
=========================== */
.wpaw-provider-warning {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 10px 12px;
margin: 8px 0;
background: rgba(251, 146, 60, 0.08);
border: 1px solid rgba(251, 146, 60, 0.2);
border-left: 3px solid #fb923c;
border-radius: 8px;
font-size: 12px;
color: #fdba74;
line-height: 1.5;
}
.wpaw-provider-warning a {
color: #fb923c;
text-decoration: underline;
}
/* ===========================
AUDIT FIXES: DB Health Notice
=========================== */
.wpaw-health-notice {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 12px;
margin: 8px 0;
background: rgba(220, 38, 38, 0.06);
border: 1px solid rgba(220, 38, 38, 0.2);
border-radius: 8px;
font-size: 12px;
color: #fca5a5;
}
.wpaw-health-notice a {
color: #ef4444;
text-decoration: underline;
}
/* ===========================
AUDIT FIXES: Confirm Modal for Writing
=========================== */
.wpaw-write-confirm-overlay {
position: absolute;
inset: 0;
z-index: 1200;
background: rgba(10, 16, 27, 0.75);
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
animation: fadeIn 0.2s ease;
}
.wpaw-write-confirm-modal {
width: 100%;
max-width: 380px;
background: #1e2530;
color: #e5e7eb;
border: 1px solid #334155;
border-radius: 12px;
padding: 20px;
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.wpaw-write-confirm-title {
font-size: 15px;
font-weight: 700;
margin-bottom: 8px;
display: flex;
align-items: center;
gap: 8px;
}
.wpaw-write-confirm-body {
font-size: 13px;
line-height: 1.6;
color: #94a3b8;
margin-bottom: 16px;
}
.wpaw-write-confirm-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
}
/* ===========================
AUDIT FIXES: Response content dark theme
=========================== */
.wpaw-response-content {
line-height: 1.6;
word-wrap: break-word;
white-space: normal;
color: #dce0e8;
}
.wpaw-response-content>* {
padding: 1rem;
}
.wpaw-response-content p {
margin: 0 0 8px;
}
.wpaw-response-content p:last-child {
margin-bottom: 0;
}
/* Plan section title in dark theme */
.wpaw-plan-section-title {
font-weight: 600;
margin-bottom: 4px;
color: #e0e4ea;
}
.wpaw-plan-section-desc {
color: #8b95a5;
font-size: 13px;
line-height: 1.5;
}
/* Config summary dark */
.wpaw-plan-config-summary {
margin-bottom: 12px;
padding: 10px 12px;
background: #161a20;
border: 1px solid #2d3a4a;
border-radius: 8px;
font-size: 12px;
line-height: 1.6;
}
.wpaw-config-summary-item {
color: #9aa5b4;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
margin-bottom: 4px;
font-size: 11.5px;
}
.wpaw-config-summary-item:last-child {
margin-bottom: 0;
}