Skip to content

Commit da27c4c

Browse files
lordsplinecapyai
andauthored
Enable demo interactions by adding a built-in AI Agent sidebar and stubbed chat webview; improves UX with toolbar and persistent history (#9)
Co-authored-by: capy <capy@capy.ai>
1 parent 5085816 commit da27c4c

3 files changed

Lines changed: 346 additions & 60 deletions

File tree

Lines changed: 171 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,171 @@
1-
:root{--ai-accent:#0aa}
2-
body{margin:0;padding:0;font-family:var(--vscode-font-family);color:var(--vscode-foreground);background:var(--vscode-sideBar-background)}
3-
.ai-header{padding:.6rem .8rem;font-weight:600;border-bottom:1px solid var(--vscode-panel-border);background:var(--vscode-sideBarSectionHeader-background);color:var(--vscode-sideBarTitle-foreground)}
4-
.ai-main{display:flex;flex-direction:column;height:calc(100vh - 2.2rem)}
5-
.ai-messages{flex:1;overflow:auto;padding:.75rem;display:flex;flex-direction:column;gap:.5rem}
6-
.ai-msg{padding:.5rem .6rem;border-radius:.4rem;max-width:90%}
7-
.ai-msg.user{align-self:flex-end;background:var(--ai-accent);color:#002b2b}
8-
.ai-msg.assistant{align-self:flex-start;background:var(--vscode-editor-inactiveSelectionBackground);color:var(--vscode-foreground)}
9-
.ai-input{display:flex;gap:.5rem;border-top:1px solid var(--vscode-panel-border);padding:.5rem}
10-
.ai-input textarea{flex:1;resize:vertical;min-height:2.5rem;border:1px solid var(--vscode-input-border);background:var(--vscode-input-background);color:var(--vscode-input-foreground);border-radius:.3rem;padding:.5rem}
11-
.ai-send{border:none;padding:.6rem .9rem;background:var(--ai-accent);color:#002b2b;border-radius:.3rem;cursor:pointer}
12-
.ai-send:hover{filter:brightness(0.95)}
1+
:root {
2+
--ai-accent: #0aa;
3+
--ai-accent-2: #0a8;
4+
--ai-bg: var(--vscode-sideBar-background);
5+
--ai-fg: var(--vscode-foreground);
6+
--ai-muted: var(--vscode-descriptionForeground);
7+
--ai-border: var(--vscode-panel-border);
8+
--ai-bubble-user: var(--ai-accent);
9+
--ai-bubble-ai: var(--vscode-editor-inactiveSelectionBackground);
10+
}
11+
12+
html, body {
13+
height: 100%;
14+
}
15+
16+
body {
17+
margin: 0;
18+
padding: 0;
19+
font-family: var(--vscode-font-family);
20+
color: var(--ai-fg);
21+
background: var(--ai-bg);
22+
}
23+
24+
.ai-header {
25+
display: flex;
26+
align-items: center;
27+
gap: .6rem;
28+
padding: .6rem .8rem;
29+
font-weight: 600;
30+
border-bottom: 1px solid var(--ai-border);
31+
background: var(--vscode-sideBarSectionHeader-background);
32+
color: var(--vscode-sideBarTitle-foreground);
33+
}
34+
35+
.ai-logo {
36+
filter: saturate(0.8);
37+
}
38+
39+
.ai-title {
40+
flex: 1;
41+
}
42+
43+
.ai-tools {
44+
display: flex;
45+
gap: .35rem;
46+
}
47+
48+
.ai-tool {
49+
appearance: none;
50+
border: 1px solid var(--ai-border);
51+
background: transparent;
52+
color: var(--ai-fg);
53+
padding: .25rem .5rem;
54+
border-radius: .3rem;
55+
cursor: pointer;
56+
}
57+
58+
.ai-tool:hover {
59+
border-color: var(--ai-accent);
60+
color: var(--ai-accent);
61+
}
62+
63+
.ai-main {
64+
display: flex;
65+
flex-direction: column;
66+
height: calc(100vh - 2.6rem);
67+
}
68+
69+
.ai-messages {
70+
flex: 1;
71+
overflow: auto;
72+
padding: .75rem;
73+
display: flex;
74+
flex-direction: column;
75+
gap: .5rem;
76+
}
77+
78+
.ai-msg {
79+
display: grid;
80+
grid-template-rows: auto auto;
81+
gap: .25rem;
82+
max-width: 92%;
83+
}
84+
85+
.ai-msg.user {
86+
align-self: flex-end;
87+
}
88+
89+
.ai-msg.assistant {
90+
align-self: flex-start;
91+
}
92+
93+
.ai-bubble {
94+
padding: .55rem .7rem;
95+
border-radius: .6rem;
96+
line-height: 1.42;
97+
white-space: pre-wrap;
98+
word-wrap: break-word;
99+
}
100+
101+
.ai-msg.user .ai-bubble {
102+
background: var(--ai-bubble-user);
103+
color: #002b2b;
104+
}
105+
106+
.ai-msg.assistant .ai-bubble {
107+
background: var(--ai-bubble-ai);
108+
color: var(--ai-fg);
109+
}
110+
111+
.ai-meta {
112+
font-size: 12px;
113+
color: var(--ai-muted);
114+
padding: 0 .2rem;
115+
}
116+
117+
.ai-input {
118+
display: flex;
119+
flex-direction: column;
120+
gap: .45rem;
121+
border-top: 1px solid var(--ai-border);
122+
padding: .6rem .6rem .7rem .6rem;
123+
}
124+
125+
.ai-input textarea {
126+
flex: 1;
127+
resize: vertical;
128+
min-height: 2.6rem;
129+
max-height: 40vh;
130+
border: 1px solid var(--vscode-input-border);
131+
background: var(--vscode-input-background);
132+
color: var(--vscode-input-foreground);
133+
border-radius: .4rem;
134+
padding: .55rem .6rem;
135+
}
136+
137+
.ai-input textarea:focus {
138+
outline: none;
139+
border-color: var(--ai-accent);
140+
box-shadow: 0 0 0 1px var(--ai-accent) inset;
141+
}
142+
143+
.ai-input-actions {
144+
display: flex;
145+
align-items: center;
146+
gap: .6rem;
147+
}
148+
149+
.ai-hint {
150+
flex: 1;
151+
color: var(--ai-muted);
152+
font-size: 12px;
153+
}
154+
155+
.ai-send {
156+
border: none;
157+
padding: .55rem 1rem;
158+
background: linear-gradient(180deg, var(--ai-accent), var(--ai-accent-2));
159+
color: #002b2b;
160+
border-radius: .35rem;
161+
cursor: pointer;
162+
}
163+
164+
.ai-send:hover {
165+
filter: brightness(.96);
166+
}
167+
168+
@media (max-width: 750px) {
169+
.ai-main { height: calc(100vh - 3.2rem); }
170+
.ai-tool { padding: .2rem .45rem; }
171+
}

extensions/ai-agent/package.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
"name": "ai-agent",
33
"displayName": "AI Agent",
44
"description": "Built-in demo: AI activity bar and chat sidebar.",
5-
"version": "0.0.1",
5+
"version": "0.1.0",
66
"publisher": "vscode",
77
"license": "MIT",
88
"engines": {
99
"vscode": "^1.80.0"
1010
},
1111
"icon": "media/icon.png",
12+
"keywords": ["ai", "chat", "sidebar", "demo"],
1213
"activationEvents": [
1314
"onView:aiAgent.chat",
1415
"onCommand:aiAgent.open",
15-
"onCommand:aiAgent.sendMessage"
16+
"onCommand:aiAgent.sendMessage",
17+
"onCommand:aiAgent.clear"
1618
],
1719
"main": "./out/extension",
1820
"capabilities": {
@@ -47,6 +49,27 @@
4749
"command": "aiAgent.sendMessage",
4850
"title": "AI: Send Message",
4951
"category": "AI"
52+
},
53+
{
54+
"command": "aiAgent.clear",
55+
"title": "AI: Clear Chat",
56+
"category": "AI"
57+
}
58+
],
59+
"menus": {
60+
"view/title": [
61+
{
62+
"command": "aiAgent.clear",
63+
"when": "view == aiAgent.chat",
64+
"group": "navigation@99"
65+
}
66+
]
67+
},
68+
"viewsWelcome": [
69+
{
70+
"view": "aiAgent.chat",
71+
"contents": "Welcome to AI Chat. Type a message below to start.",
72+
"when": "true"
5073
}
5174
]
5275
},

0 commit comments

Comments
 (0)