From d0acfc2f540c9d7f138a2a4e1a75cab23ea8b849 Mon Sep 17 00:00:00 2001 From: cmliu Date: Fri, 31 Jul 2026 04:22:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AB=8B=E5=8D=B3=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E6=A0=B9=E8=8A=82=E7=82=B9=E4=BB=A5=E6=8F=90=E4=BE=9B=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E5=8F=8D=E9=A6=88=EF=BC=8C=E4=BC=98=E5=8C=96=E6=97=A0?= =?UTF-8?q?=E9=9A=9C=E7=A2=8D=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/file-tree.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/file-tree.ts b/frontend/src/file-tree.ts index 953764a..5840639 100644 --- a/frontend/src/file-tree.ts +++ b/frontend/src/file-tree.ts @@ -223,6 +223,13 @@ export class FileTree { setCwd(cwd: string): void { this.selectedPath = cwd; this.setCwdToken++; + // Kick off root expansion immediately for visual feedback so aria-expanded + // changes to "true" (or shows a spinner) without waiting for the async + // SFTP fetch. silent=true keeps the unavailable-path compatible with + // expandToPath. + if (this.root && this.root.state === 'collapsed') { + void this.expandNode(this.root, true); + } const token = this.setCwdToken; void this.expandToPath(cwd, token); } @@ -418,9 +425,9 @@ export class FileTree { row.append(retry); } - // ARIA expanded + // ARIA expanded: treat "loading" as expanded since the expand is in progress. if (expandable) { - row.setAttribute('aria-expanded', String(node.state === 'expanded')); + row.setAttribute('aria-expanded', String(node.state === 'expanded' || node.state === 'loading')); } else { row.removeAttribute('aria-expanded'); }