From 7766d6a7f4d0123933a9f60419e9015ff6407de4 Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Fri, 3 Jul 2026 20:07:01 +0800 Subject: [PATCH 1/3] feat(web-shell): show more slash commands with category headers The slash-command menu capped its visible height at exactly four rows, so with 40+ merged commands users had to scroll a thin list to find anything, and the built-in custom/skill/system grouping was only a faint 1px divider with no label. Raise the cap to min(12 rows, 40vh) and render the category name as a visible header at each group boundary (custom / skill / system), keeping the divider between groups. Sub-command menus are ungrouped and unchanged. --- .../client/components/ChatEditor.module.css | 16 ++++++++++------ .../web-shell/client/components/ChatEditor.tsx | 8 ++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/web-shell/client/components/ChatEditor.module.css b/packages/web-shell/client/components/ChatEditor.module.css index 0891125d391..0a0acf54863 100644 --- a/packages/web-shell/client/components/ChatEditor.module.css +++ b/packages/web-shell/client/components/ChatEditor.module.css @@ -181,12 +181,7 @@ .slashPanel { position: fixed; z-index: var(--web-shell-popover-z-index, 1000); - --slash-panel-max-height: min( - calc( - (22px + 10px) + (22px + 10px) + (22px + 10px) + (22px + 10px) + 6px + 12px - ), - 50vh - ); + --slash-panel-max-height: min(calc(12 * (22px + 10px) + 6px + 12px), 40vh); --slash-anchor-width: 620px; --slash-command-col: 20ch; --slash-desc-col: 32ch; @@ -262,6 +257,15 @@ background: var(--chat-editor-border-color); } +.slashSectionHeader { + padding: 4px 8px 2px; + color: var(--muted-foreground); + font-size: 11px; + font-weight: 500; + letter-spacing: 0.02em; + user-select: none; +} + .slashItem { position: relative; display: grid; diff --git a/packages/web-shell/client/components/ChatEditor.tsx b/packages/web-shell/client/components/ChatEditor.tsx index 32f579e5dd4..7925438d6ed 100644 --- a/packages/web-shell/client/components/ChatEditor.tsx +++ b/packages/web-shell/client/components/ChatEditor.tsx @@ -721,13 +721,17 @@ function SlashCommandPanel({ const section = item.section; const showSection = menu.kind === 'command' && - index > 0 && section !== undefined && section !== lastSection; lastSection = section ?? lastSection; return (
- {showSection &&
} + {showSection && ( + <> + {index > 0 &&
} +
{section}
+ + )}