Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug] Windows 项目树"定位当前文件"间歇性失效:点击后有时不展开、不选中、不滚动(v0.6.5)

Aperta
#1,540 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@AACS111 ci sta già lavorando.

Dal 29/10/2026.

  • #1578 di @AACS111 — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
tauri, typescript
Ambito
desktop, tooling

Direzione di ricerca

Start by tracing the reveal button in windows/tauri/src/features/file-explorer/components/file-explorer-tree.tsx, then read use-file-explorer-sync.ts and file-system.store.ts to follow request IDs and ancestor expansion. Check how the visible row index is updated after expansion and whether the active pane supplies a path. Done means each click expands, selects, and scrolls to the current file; the report does not name a test or provide diagnostic logs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:project bug P1 platform:windows review: low
Platform / 平台

Windows

Area / 模块

Project and workspace / 项目与工作区

Lithe version / Lithe 版本

0.6.5

Priority / 优先级

P1 / 尽快处理:使用体验大幅下降,但通常仍可继续使用

OS and architecture / 操作系统与架构

Windows x64(具体系统版本未记录)

Environment / 环境信息

Lithe v0.6.5(Windows x64 安装包),本地项目(非 WSL / 远程)。

Steps to reproduce / 复现步骤
  1. 在 Windows 上打开一个较大的项目,等待项目树加载完成。
  2. 打开多个文件,并在编辑器标签之间来回切换,使当前活动文件发生变化。
  3. 点击 Project 侧边栏头部的“定位当前文件”按钮。
  4. 观察项目树:有时能正常展开祖先目录、选中并滚动到当前文件;有时点击后没有任何反应(目录不展开、没有选中、也不滚动)。

该问题不是每次必现,尚未找到稳定的最小复现路径。

Expected behavior / 预期行为

无论当前活动文件位于哪一层目录、项目树此前处于什么状态(目录折叠、之前滚动到别处、切换过标签),每次点击“定位当前文件”都应:

  1. 展开目标文件的所有祖先目录;
  2. 选中目标文件所在行;
  3. 把该行滚动到可视区域。
Actual behavior / 实际行为

间歇性失效。点击后有时正常定位,有时没有任何可见反馈:既不展开目录,也不改变选中项,也不滚动。界面没有报错提示或 toast,无法判断是请求失败还是被静默丢弃。

Logs or diagnostic output / 日志或诊断输出

未采集,暂无可提供的日志。

Screenshots or recordings / 截图或录屏

暂无。如有需要可以补充录屏。

补充线索(未验证,仅供定位参考)

以下为阅读代码后的猜测,未做实际调试,仅供排查方向参考:

  • Windows 侧入口在 windows/tauri/src/features/file-explorer/components/file-explorer-tree.tsx,按钮调用 requestRevealPath(activePath);若 activePath 未随活动标签更新,或当前活动 pane 不是常规编辑器类型,可能拿不到目标路径。
  • use-file-explorer-sync.ts 中每次定位都会递增 request id,旧请求完成会被丢弃;若短时间内有多个请求竞争,可能出现最后一次请求被更晚的无效请求覆盖的情况。
  • file-system.store.ts 的 revealPathInTree 会先展开祖先目录再返回;file-explorer-tree.tsx 的滚动逻辑在 visibleRowIndexByPath.get(revealRequest.path) 取不到索引时直接 return,不重试也不提示。若祖先目录展开后的行列表尚未更新,定位会被静默跳过。
  • getExplorerTargetPath 只对 editor / image / pdf / binary / externalEditor / markdownPreview / htmlPreview / csvPreview 返回路径,其他类型的 pane 会返回 undefined。

以上任何一处若与设计预期不符,可能即为问题所在。

Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
Lingua principale
TypeScript
Stelle
1.8k
Fork
151
Merge medio
11h 57m
PR unite (30g)
337

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di 1lck/Lithe-IDEA

Tutte le issue di 1lck/Lithe-IDEA

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.