feat(agent): add nested agents.md support across backend and webui (#309)

* feat(agent): add nested agents.md support across backend and webui

* fix(webui): update agentsmd route paths and unnest folder agentsmd route

* fix(agent): flush agents.md autosave on close and address review feedback

- Flush pending debounced AGENTS.md autosave on close/unmount so edits
  made within 750ms of navigating away are no longer silently lost
- Serialize autosaves through a promise chain so an older in-flight
  request can never overwrite newer content on the server
- Internationalize the hardcoded "Failed to save" and
  "Loading AGENTS.md..." strings (en + zh)
- Validate that AGENTS.md is only stored on folder/root assets in
  AssetService, preventing bogus virtual paths for file assets
- Cap updateAgentsMd content at 100k chars via Zod validation
- Remove unused getAgentsMd/updateAgentsMd response DTO schemas
- Drop unused teamId prop from AgentsMdEditor
- Add tests: non-folder asset rejection, oversized content 400,
  and agent-chat workflow assetId passthrough

* refactor(db): isolate AGENTS.md content in dedicated 1:1 AssetAgentMd table

* style(webui): unify top bar button hover styles and add wand icon to agentsmd button

* style(webui): update agentsmd button state colors and remove presence dot

* fix(webui): fix close button overflow and stabilize debounced autosave in agentsmd editor

* fix(webui): update debounce to 1s and await pending save before closing agentsmd editor

* feat(webui): add terminal AGENTS.md breadcrumb on agentsmd editor page

* fix(webui): use ScrollArea for markdown editor scrolling
This commit is contained in:
Yiling-J
2026-08-15 10:25:46 +08:00
committed by GitHub
parent 3c3b6880e4
commit 1cee103b1c
56 changed files with 3529 additions and 242 deletions
@@ -1,6 +1,8 @@
.shumai-editor-wrapper {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
border: 1px solid var(--border, #e2e8f0);
border-radius: 8px;
background-color: var(--background, #ffffff);
@@ -23,7 +25,7 @@
user-select: none;
}
.shumai-editor-toolbar button {
.shumai-editor-toolbar-left button {
display: inline-flex;
align-items: center;
justify-content: center;
@@ -38,17 +40,17 @@
padding: 0;
}
.shumai-editor-toolbar button:hover:not(:disabled) {
.shumai-editor-toolbar-left button:hover:not(:disabled) {
background-color: var(--accent, #e2e8f0);
color: var(--accent-foreground, #0f172a);
}
.shumai-editor-toolbar button:disabled {
.shumai-editor-toolbar-left button:disabled {
opacity: 0.35;
cursor: not-allowed;
}
.shumai-editor-toolbar button.active {
.shumai-editor-toolbar-left button.active {
background-color: var(--primary, #0f172a);
color: var(--primary-foreground, #ffffff);
}
@@ -74,14 +76,14 @@
.shumai-editor-content-area {
position: relative;
min-height: 240px;
min-height: 0;
flex: 1;
width: 100%;
box-sizing: border-box;
}
.editor-input {
min-height: 240px;
min-height: 100%;
padding: 16px;
outline: none;
font-size: 15px;