Skip to content

Commit a481f97

Browse files
committed
feat(chat): reach Sessions from the chat tab
v1.1.0 moved the chat out of the right-hand container and left Sessions there alone. That container is one VS Code hides by default, and `AI: Sessions` had no icon, no keybinding and no button anywhere — so the only route from a conversation to your own past conversations was knowing the palette entry existed. It joins the three actions already on the chat tab, between New Chat and Set API Key: per-conversation actions first, then "go somewhere else", then settings. navigation@0 Add Files $(new-file) navigation@1 New Chat $(add) navigation@2 Sessions $(history) <- new navigation@3 Set API Key $(key) The command also gains an icon. It never had one, because until now it was only ever invoked from the palette — and an editor/title action without an icon renders as literally nothing, a bug the suite already pins for the other three. No new keybinding: ⇧⌘I already opens the chat, and a second shortcut for a one-click button is a conflict looking for somewhere to happen. Guards, each bypass-verified by reverting the fix: - the button removed from the tab - the icon dropped, so the action renders as nothing - moved out of the navigation group, where it would only ever appear under the … overflow 23 tests in chatSurface, 34 suites green.
1 parent 8bc9af5 commit a481f97

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

extensions/levelcode-ai/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@
133133
{
134134
"command": "levelcode.ai.sessions",
135135
"title": "AI: Sessions",
136-
"category": "LevelCode"
136+
"category": "LevelCode",
137+
"icon": "$(history)"
137138
},
138139
{
139140
"command": "levelcode.ai.sketch",
@@ -218,10 +219,15 @@
218219
"group": "navigation@1"
219220
},
220221
{
221-
"command": "levelcode.ai.setApiKey",
222+
"command": "levelcode.ai.sessions",
222223
"when": "activeWebviewPanelId == 'levelcode.ai.chat'",
223224
"group": "navigation@2"
224225
},
226+
{
227+
"command": "levelcode.ai.setApiKey",
228+
"when": "activeWebviewPanelId == 'levelcode.ai.chat'",
229+
"group": "navigation@3"
230+
},
225231
{
226232
"command": "levelcode.ai.review.keepActive",
227233
"when": "levelcode.ai.reviewActive",

extensions/levelcode-ai/test/chatSurface.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ test('COMMAND: the chat TAB carries the actions the view title used to', () => {
189189
const onTab = (pkg.contributes.menus['editor/title'] || [])
190190
.filter((m) => m.when === "activeWebviewPanelId == 'levelcode.ai.chat'");
191191
const ids = onTab.map((m) => m.command);
192-
for (const id of ['levelcode.ai.newChat', 'levelcode.ai.addFileContext', 'levelcode.ai.setApiKey']) {
192+
// Sessions joined them: with the chat out of the right-hand bar, its container is one VS Code
193+
// hides by default, and `AI: Sessions` had no icon, no keybinding and no button anywhere — so the
194+
// only route to your own past conversations was knowing the palette entry existed.
195+
for (const id of ['levelcode.ai.newChat', 'levelcode.ai.addFileContext', 'levelcode.ai.setApiKey',
196+
'levelcode.ai.sessions']) {
193197
assert.ok(ids.includes(id), id + ' lost its button when the sidebar view was removed');
194198
const cmd = pkg.contributes.commands.find((c) => c.command === id);
195199
assert.ok(cmd && cmd.icon, id + ' has no icon — an editor/title action with no icon renders as nothing');
@@ -199,6 +203,11 @@ test('COMMAND: the chat TAB carries the actions the view title used to', () => {
199203
m.command + ' must be in navigation, so VS Code can overflow it into … on a narrow tab');
200204
}
201205

206+
// The one thing still living in the right-hand container must stay reachable FROM the chat, or it
207+
// is reachable only by knowing it is there.
208+
assert.ok(ids.includes('levelcode.ai.sessions'),
209+
'no way from the conversation to the list of past conversations except the command palette');
210+
202211
// And nothing may be scoped to the view that no longer exists — a stale `when` is a button that
203212
// never appears anywhere.
204213
const all = Object.values(pkg.contributes.menus).flat();

0 commit comments

Comments
 (0)