Enhance AI sidebar with skill and command sections, improve layout and styling

This commit is contained in:
acxtrilla 2026-04-29 12:56:07 +01:00
parent 1ef19eb998
commit 7ef29d1d3f
3 changed files with 28 additions and 13 deletions

File diff suppressed because one or more lines are too long

24
main.ts
View file

@ -732,16 +732,10 @@ class AISidebarView extends ItemView {
}
this.slashEl.removeClass("is-hidden");
for (const command of commands.slice(0, 6)) {
const item = this.slashEl.createDiv("ai-sidebar__slash-item");
item.createDiv({ cls: "ai-sidebar__slash-name", text: command.label });
item.createDiv({ cls: "ai-sidebar__slash-path", text: command.description });
item.addEventListener("mousedown", (event) => {
event.preventDefault();
this.insertSlashToken(command.insert);
});
if (skills.length > 0) {
this.slashEl.createDiv({ cls: "ai-sidebar__slash-section", text: "Skills" });
}
for (const skill of skills.slice(0, 10)) {
for (const skill of skills.slice(0, 12)) {
const item = this.slashEl.createDiv("ai-sidebar__slash-item");
item.createDiv({ cls: "ai-sidebar__slash-name", text: `/${skill.name}` });
item.createDiv({ cls: "ai-sidebar__slash-path", text: skill.path });
@ -750,6 +744,18 @@ class AISidebarView extends ItemView {
this.insertSlashToken(`/${skill.name}`);
});
}
if (commands.length > 0) {
this.slashEl.createDiv({ cls: "ai-sidebar__slash-section", text: "Controls" });
}
for (const command of commands.slice(0, 8)) {
const item = this.slashEl.createDiv("ai-sidebar__slash-item");
item.createDiv({ cls: "ai-sidebar__slash-name", text: command.label });
item.createDiv({ cls: "ai-sidebar__slash-path", text: command.description });
item.addEventListener("mousedown", (event) => {
event.preventDefault();
this.insertSlashToken(command.insert);
});
}
}
private hideSlashCommands() {

View file

@ -203,7 +203,7 @@
bottom: 122px;
box-shadow: var(--shadow-s);
left: 0;
max-height: 220px;
max-height: 360px;
overflow-y: auto;
padding: 6px;
position: absolute;
@ -225,6 +225,15 @@
background: var(--background-modifier-hover);
}
.ai-sidebar__slash-section {
color: var(--text-faint);
font-size: 10px;
font-weight: 700;
letter-spacing: 0.08em;
padding: 8px 8px 4px;
text-transform: uppercase;
}
.ai-sidebar__slash-name {
color: var(--text-normal);
font-size: 13px;