-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidepanel.html
More file actions
273 lines (261 loc) · 15.1 KB
/
sidepanel.html
File metadata and controls
273 lines (261 loc) · 15.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ambient Code Platform</title>
<link rel="stylesheet" href="styles.css">
<style>
html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; }
.panel-body { flex: 1; overflow-y: auto; }
#chat-view { display: none; flex-direction: column; height: 100%; }
#chat-view.active { display: flex; }
#main-view { display: flex; flex-direction: column; height: 100%; }
#main-view.hidden { display: none; }
/* Overlay panels slide in over sessions list */
.overlay-panel { display: none; }
.overlay-panel.active { display: block; }
#sessions-panel { display: block; }
#sessions-panel.hidden { display: none; }
</style>
<script src="theme-init.js"></script>
</head>
<body>
<!-- ===== Main View ===== -->
<div id="main-view">
<div class="header-bar">
<span class="logo">Ambient Code</span>
<span class="workspace-label" id="workspace-label"></span>
<div class="header-actions">
<div class="connection-indicator" id="connection-indicator" title="Connection status">
<div class="connection-dot disconnected" id="connection-dot"></div>
<span class="timestamp" id="connection-timestamp">--</span>
</div>
<a class="github-link" href="https://github.com/ambient-code/browser-extension" target="_blank" rel="noopener noreferrer" title="GitHub">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/></svg>
</a>
<button class="header-icon-btn" id="new-session-toggle" title="New session">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
</button>
<button class="header-icon-btn" id="settings-toggle" title="Settings">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
</button>
<button class="header-icon-btn" id="theme-toggle" title="Toggle theme">☾</button>
</div>
</div>
<div class="panel-body">
<!-- Sessions list (default view) -->
<div id="sessions-panel">
<div id="sessions-list"></div>
<div id="sessions-loading" class="spinner" style="display:none;"></div>
<div id="sessions-empty" class="empty-state" style="display:none;">
<div class="icon">📋</div>
<div class="title">No sessions</div>
<div class="subtitle">Create a session or check your settings.</div>
</div>
</div>
<!-- Setup Wizard (overlay) -->
<div id="wizard-panel" class="overlay-panel" role="dialog" aria-modal="true" aria-labelledby="wizard-title-1">
<div class="wizard-container">
<div class="wizard-header">
<span class="wizard-logo">Ambient Code</span>
<div class="wizard-steps" id="wizard-step-indicator">
<span class="wizard-step active" data-step="1">1</span>
<span class="wizard-step-line"></span>
<span class="wizard-step" data-step="2">2</span>
</div>
</div>
<!-- Step 1: Connect -->
<div id="wizard-step-1" class="wizard-step-content active">
<h2 class="wizard-title" id="wizard-title-1">Connect to ACP</h2>
<p class="wizard-subtitle">Enter your server URL and API key to get started.</p>
<div class="form-group">
<label for="wizard-url">ACP Base URL</label>
<input type="text" id="wizard-url" placeholder="https://acp.example.com">
</div>
<div class="form-group">
<label for="wizard-apikey">API Key</label>
<input type="password" id="wizard-apikey" placeholder="Paste your ACP API key">
</div>
<button class="btn btn-primary btn-full" id="wizard-connect-btn">Connect</button>
<div id="wizard-connect-status" role="status" aria-live="polite" style="margin-top:12px; font-size:14px;"></div>
</div>
<!-- Step 2: Select / Create Workspace -->
<div id="wizard-step-2" class="wizard-step-content">
<h2 class="wizard-title">Select a Workspace</h2>
<p class="wizard-subtitle">Choose an existing workspace or create a new one.</p>
<div id="wizard-workspace-list" class="wizard-workspace-list"></div>
<div id="wizard-no-workspaces" style="display:none;">
<div class="empty-state" style="padding:24px 0;">
<div class="title">No workspaces found</div>
<div class="subtitle">Create your first workspace to get started.</div>
</div>
</div>
<button class="btn btn-secondary btn-full" id="wizard-show-create-btn" style="margin-top:12px;">Create New Workspace</button>
<div id="wizard-create-form" style="display:none; margin-top:16px;">
<div class="form-group">
<label>Workspace Name</label>
<input type="text" id="wizard-ws-name" placeholder="my-workspace">
<small style="color:var(--muted-foreground)">Lowercase, alphanumeric, hyphens only</small>
</div>
<div class="form-group">
<label>Display Name</label>
<input type="text" id="wizard-ws-display" placeholder="My Workspace">
</div>
<div class="form-group">
<label>Description (optional)</label>
<input type="text" id="wizard-ws-desc" placeholder="What is this workspace for?">
</div>
<button class="btn btn-primary btn-full" id="wizard-create-ws-btn">Create Workspace</button>
</div>
<div id="wizard-ws-status" role="status" aria-live="polite" style="margin-top:12px; font-size:14px;"></div>
</div>
</div>
</div>
<!-- New Session (overlay) -->
<div id="create-panel" class="overlay-panel">
<div class="overlay-header">
<button class="back-btn" id="create-back-btn">←</button>
<span class="overlay-title">New Session</span>
</div>
<div style="padding: 16px;">
<!-- Chat-style prompt area -->
<div class="create-chatbox">
<textarea id="new-session-prompt" class="create-chatbox-input" placeholder="Describe what you'd like to work on..." rows="3"></textarea>
<div class="create-chatbox-toolbar">
<div class="create-chatbox-selectors">
<select id="new-session-runner" class="toolbar-select" title="Runner type">
<option value="">Loading runners...</option>
</select>
<select id="new-session-model" class="toolbar-select" title="Model">
<option value="">Loading models...</option>
</select>
<select id="new-session-workflow" class="toolbar-select" title="Workflow">
<option value="">General chat</option>
</select>
</div>
<button class="create-send-btn" id="create-session-btn" title="Create session">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
</button>
</div>
</div>
<!-- Custom workflow fields (shown when "Custom..." selected) -->
<div id="custom-workflow-fields" style="display:none; margin-top:12px;">
<div class="form-group">
<label>Workflow Git URL</label>
<input type="text" id="new-session-workflow-url" placeholder="https://github.com/org/workflow-repo.git">
</div>
<div class="form-group">
<label>Workflow Branch</label>
<input type="text" id="new-session-workflow-branch" placeholder="main">
</div>
</div>
<!-- Advanced options (collapsible) -->
<details class="advanced-section">
<summary class="advanced-toggle">Advanced options</summary>
<div style="padding-top:12px;">
<div class="form-group">
<label>Display Name (optional)</label>
<input type="text" id="new-session-name" placeholder="e.g. Fix auth bug" maxlength="50">
</div>
<div class="form-group">
<label>Repository URL (optional)</label>
<input type="text" id="new-session-repo" placeholder="https://github.com/org/repo">
</div>
<div class="form-group">
<label>Branch (optional)</label>
<input type="text" id="new-session-branch" placeholder="main">
</div>
</div>
</details>
<div id="create-status" style="margin-top:12px; font-size:14px;"></div>
</div>
</div>
<!-- Settings (overlay) -->
<div id="settings-panel" class="overlay-panel">
<div class="overlay-header">
<button class="back-btn" id="settings-back-btn">←</button>
<span class="overlay-title">Settings</span>
</div>
<div style="padding: 16px;">
<div class="form-group">
<label>ACP Base URL</label>
<input type="text" id="settings-url" placeholder="https://acp.example.com">
</div>
<div class="form-group">
<label>API Key</label>
<input type="password" id="settings-apikey" placeholder="Paste your ACP API key">
</div>
<div class="form-group">
<label>Workspace</label>
<div class="workspace-selector-row">
<select id="settings-project">
<option value="">Loading workspaces...</option>
</select>
<button class="btn btn-secondary" id="refresh-workspaces-btn" title="Refresh workspace list">↻</button>
</div>
</div>
<div class="workspace-actions">
<button class="btn btn-secondary" id="settings-create-ws-btn">Create Workspace</button>
<button class="btn btn-destructive" id="settings-delete-ws-btn">Delete Workspace</button>
</div>
<!-- Create workspace form (inline, hidden by default) -->
<div id="settings-create-form" class="workspace-create-form" style="display:none;">
<div class="form-group">
<label>Workspace Name</label>
<input type="text" id="settings-ws-name" placeholder="my-workspace">
<small style="color:var(--muted-foreground)">Lowercase, alphanumeric, hyphens only</small>
</div>
<div class="form-group">
<label>Display Name</label>
<input type="text" id="settings-ws-display" placeholder="My Workspace">
</div>
<div class="form-group">
<label>Description (optional)</label>
<input type="text" id="settings-ws-desc" placeholder="What is this workspace for?">
</div>
<button class="btn btn-primary btn-full" id="settings-create-ws-submit">Create</button>
<div id="settings-create-ws-status" style="margin-top:8px; font-size:14px;"></div>
</div>
<!-- Delete confirmation (hidden by default) -->
<div id="settings-delete-confirm" class="delete-confirm" style="display:none;">
<div class="delete-confirm-warning">This will permanently delete workspace "<span id="delete-ws-name-label"></span>" and all its sessions. This cannot be undone.</div>
<div class="form-group">
<label>Type the workspace name to confirm</label>
<input type="text" id="delete-ws-confirm-input" placeholder="">
</div>
<div style="display:flex; gap:8px;">
<button class="btn btn-secondary" id="delete-ws-cancel" style="flex:1;">Cancel</button>
<button class="btn btn-destructive" id="delete-ws-confirm" style="flex:1;" disabled>Delete</button>
</div>
<div id="settings-delete-ws-status" style="margin-top:8px; font-size:14px;"></div>
</div>
<button class="btn btn-primary btn-full" id="save-settings-btn" style="margin-top:16px;">Save Settings</button>
<div id="settings-status" style="margin-top:12px; font-size:14px;"></div>
<div style="margin-top:24px; padding-top:16px; border-top:1px solid var(--border);">
<div style="font-size:13px; color:var(--muted-foreground); margin-bottom:8px; text-transform:uppercase; letter-spacing:0.5px; font-weight:500;">Diagnostics</div>
<button class="btn btn-secondary btn-full" id="test-connection-btn">Test Connection</button>
<div id="connection-status" style="margin-top:10px; font-size:14px;"></div>
</div>
</div>
</div>
</div>
</div>
<!-- ===== Chat View ===== -->
<div id="chat-view">
<div class="chat-header">
<button class="back-btn" id="chat-back-btn">←</button>
<span class="session-title" id="chat-session-title">Session</span>
<span class="phase-badge" id="chat-phase-badge">running</span>
</div>
<div class="chat-messages" id="chat-messages"></div>
<div class="chat-input-area">
<textarea class="chat-input" id="chat-input" placeholder="Send a message..." rows="1"></textarea>
<button class="send-btn" id="chat-send-btn">Send</button>
</div>
</div>
<script src="utils.js"></script>
<script src="sidepanel.js"></script>
</body>
</html>