feat(extension): Chrome/Edge only + side panel chat tabs (v0.9.0)
All checks were successful
Beta Release / beta (push) Successful in 1m25s

- Remove Firefox build support (CI, Makefile, wxt config)
- Fix chrome.alarms undefined error (add 'alarms' permission)
- Add Chat tab to side panel connected to Studio API (/api/chat)
- Streaming SSE, tool calls, code blocks, thinking display
- Shared chat history with desktop Studio
- New lib/api.js client for extension chat endpoints

💘 Generated with Crush

Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
Augustin
2026-04-27 18:48:04 +02:00
parent 31b1de1b0d
commit f4af63afec
11 changed files with 955 additions and 106 deletions

View File

@@ -30,17 +30,19 @@ body {
}
.panel {
width: 320px;
padding: 16px;
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
}
header {
.panel > header {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 16px;
padding-bottom: 12px;
padding: 12px 16px;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
header img {
@@ -54,6 +56,47 @@ header h1 {
letter-spacing: -0.3px;
}
.tabs {
display: flex;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
padding: 0 8px;
}
.tab {
flex: 1;
padding: 10px 8px;
background: none;
border: none;
border-bottom: 2px solid transparent;
color: var(--text-secondary);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: all 0.15s;
}
.tab:hover {
color: var(--text-primary);
}
.tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
.tab-content {
display: none;
flex: 1;
overflow-y: auto;
padding: 12px 16px;
}
.tab-content.active {
display: flex;
flex-direction: column;
}
.status-card {
background: var(--bg-secondary);
border: 1px solid var(--border);
@@ -189,12 +232,13 @@ header h1 {
}
.footer {
margin-top: 12px;
padding-top: 10px;
margin-top: auto;
padding: 10px 16px;
border-top: 1px solid var(--border);
text-align: center;
color: var(--text-secondary);
font-size: 10px;
flex-shrink: 0;
}
.footer span {
@@ -209,3 +253,351 @@ header h1 {
.loading {
animation: pulse 1.5s ease-in-out infinite;
}
.chat-offline {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
color: var(--text-secondary);
font-size: 13px;
}
.chat-area {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
gap: 0;
}
.chat-feed {
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 10px;
padding-bottom: 8px;
}
.chat-msg {
display: flex;
gap: 8px;
max-width: 100%;
}
.chat-msg.system {
align-items: center;
gap: 6px;
padding: 6px 0;
}
.chat-system-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-secondary);
flex-shrink: 0;
}
.chat-system-text {
color: var(--text-secondary);
font-size: 12px;
font-style: italic;
}
.chat-avatar {
width: 28px;
height: 28px;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 700;
flex-shrink: 0;
}
.chat-avatar.user {
background: rgba(255, 215, 64, 0.15);
color: #FFD740;
}
.chat-avatar.ai {
background: rgba(255, 145, 0, 0.15);
color: #FF9100;
}
.chat-body {
flex: 1;
min-width: 0;
overflow-wrap: break-word;
}
.chat-header {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
}
.chat-badge {
font-size: 10px;
font-weight: 700;
padding: 1px 5px;
border-radius: 3px;
border: 1px solid;
line-height: 1.3;
}
.chat-content {
font-size: 13px;
line-height: 1.5;
}
.chat-content h2 { font-size: 14px; margin: 8px 0 4px; }
.chat-content h3 { font-size: 13px; margin: 6px 0 3px; }
.chat-content h4 { font-size: 12px; margin: 4px 0 2px; }
.chat-content strong { color: #fff; }
.chat-bullet, .chat-step {
padding-left: 4px;
margin: 2px 0;
}
.chat-step-num {
display: inline-block;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--accent-dim);
text-align: center;
line-height: 18px;
font-size: 10px;
font-weight: 600;
margin-right: 4px;
}
.inline-code {
background: rgba(255, 255, 255, 0.08);
padding: 1px 5px;
border-radius: 3px;
font-family: var(--font-mono);
font-size: 12px;
}
.chat-code-block {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 6px;
margin: 6px 0;
overflow: hidden;
}
.chat-code-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 4px 8px;
background: rgba(255, 255, 255, 0.03);
border-bottom: 1px solid var(--border);
}
.chat-code-lang {
font-size: 10px;
color: var(--text-secondary);
text-transform: uppercase;
}
.chat-copy-btn {
background: none;
border: none;
color: var(--accent);
font-size: 10px;
cursor: pointer;
padding: 2px 6px;
border-radius: 3px;
}
.chat-copy-btn:hover {
background: var(--accent-dim);
}
.chat-code-block pre {
padding: 8px;
overflow-x: auto;
font-family: var(--font-mono);
font-size: 11px;
line-height: 1.4;
}
.chat-code-block code {
font-family: inherit;
}
.chat-tool {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 6px;
padding: 8px 10px;
margin: 6px 0;
font-size: 12px;
}
.chat-tool.error {
border-color: var(--red);
}
.chat-tool-header {
display: flex;
align-items: center;
gap: 6px;
}
.chat-tool-icon {
font-size: 14px;
}
.chat-tool-status {
margin-left: auto;
font-weight: 700;
}
.chat-tool-status.ok { color: var(--green); }
.chat-tool-status.err { color: var(--red); }
.chat-tool-args {
color: var(--text-secondary);
font-family: var(--font-mono);
font-size: 11px;
margin-top: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chat-tool-result {
margin-top: 6px;
padding-top: 6px;
border-top: 1px solid var(--border);
font-family: var(--font-mono);
font-size: 11px;
color: var(--text-secondary);
max-height: 120px;
overflow-y: auto;
}
.chat-thinking {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 8px;
background: rgba(255, 255, 255, 0.03);
border-radius: 6px;
margin-bottom: 6px;
font-size: 11px;
color: var(--text-secondary);
}
.chat-thinking-icon {
font-size: 13px;
}
@keyframes chatDotPulse {
0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
40% { opacity: 1; transform: scale(1); }
}
.chat-dots {
display: inline-flex;
gap: 4px;
padding: 4px 0;
}
.chat-dots span {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-secondary);
animation: chatDotPulse 1.2s ease-in-out infinite;
}
.chat-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cursorBlink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
.chat-cursor {
display: inline-block;
width: 2px;
height: 14px;
background: var(--accent);
margin-left: 2px;
vertical-align: text-bottom;
animation: cursorBlink 0.8s ease infinite;
}
.chat-input-row {
display: flex;
align-items: flex-end;
gap: 6px;
padding: 8px 0 0;
border-top: 1px solid var(--border);
flex-shrink: 0;
}
.chat-input-row textarea {
flex: 1;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 6px;
padding: 8px 10px;
color: var(--text-primary);
font-family: var(--font-sans);
font-size: 13px;
resize: none;
outline: none;
max-height: 100px;
line-height: 1.4;
}
.chat-input-row textarea:focus {
border-color: var(--accent);
}
.chat-send-btn, .chat-stop-btn {
width: 36px;
height: 36px;
border-radius: 8px;
border: 1px solid var(--accent);
background: var(--accent);
color: #fff;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: all 0.15s;
}
.chat-send-btn:hover, .chat-stop-btn:hover {
box-shadow: 0 0 12px var(--accent-glow);
}
.chat-stop-btn {
background: var(--bg-secondary);
border-color: var(--border);
color: var(--text-primary);
}
.chat-msg.user .chat-content {
background: var(--bg-tertiary);
padding: 8px 10px;
border-radius: 0 8px 8px 8px;
}
.chat-msg.assistant .chat-content {
padding: 2px 0;
}