Skip to content

Fix/macos file open rendering lag - #173

Closed
ElvisLin101 wants to merge 109 commits into
1lck:mainfrom
ElvisLin101:fix/macos-file-open-rendering-lag
Closed

ElvisLin101 wants to merge 109 commits into
1lck:mainfrom
ElvisLin101:fix/macos-file-open-rendering-lag

Conversation

@ElvisLin101

Copy link
Copy Markdown
Contributor

1. 避免 SwiftUI 重复刷新

问题: 编辑器刷新界面时,会同步发布光标、选区和查找状态,再次触发 SwiftUI 刷新。日志中出现的 66 次以下错误与该调用链吻合:

Publishing changes from within view updates is not allowed

处理:

  • 将状态更新延迟到当前界面刷新结束后。
  • 合并连续更新,只保留最后一次结果。
  • 切换文件后丢弃旧编辑器排队的状态。
  • 保留右侧分屏编辑器的状态更新能力。

2. 语法高亮改为按需处理

问题: 原实现显示首屏后,仍会在主线程分块扫描全文,执行多组正则并修改文本样式。文件越大,主线程被持续占用的时间越长。

处理:

  • 打开文件时只高亮当前可见区域。
  • 缓存已经高亮的字符范围。
  • 滚动时只处理新进入视口的内容。
  • 文本或主题变化时清除旧缓存,避免颜色错误。
  • 移除打开文件后遍历全文的高亮任务。

3. Java 分析移出主线程

问题: 打开 Java 文件时,需要分析代码折叠区域和实现标记。原流程在主线程执行,而且同一份源码可能被重复解析。

处理:

  • 将 Java 结构分析移到后台线程。
  • 一次解析结果同时用于折叠区域和实现标记。
  • 输入后等待 80 毫秒再解析,避免每次按键都立即计算。
  • 新输入会取消旧任务;完成后再次核对文件和内容,防止应用过期结果。
  • 非 Java 文件不执行这项分析。

另外,编辑器初始化时移除了一次不必要的全文装饰刷新,并增加了高亮范围缓存测试。
本轮没有缓存完整编辑器页面,是否需要该能力将在本轮效果实测后决定。缓存全部编辑器页面虽然可能提升标签切回速度,但会增加内存占用和状态管理复杂度。
截屏2026-08-19 10 32 16

arkleselect and others added 30 commits August 14, 2026 11:52
- qualify git_checkout, git_checkout_preflight, and git_delete_branch
  references with refs/heads/ and pass referenceKind: local, matching the
  shared core contract that rejects short branch names
- translate git_checkout_preflight to git.checkoutPreflight and adapt its
  blocking paths plus git_checkout results for the branch manager UI
- run checkout preflight from checkoutBranch so blocked switches surface
  hasChanges and reuse the existing stash-and-retry flow, and propagate
  real git error output on failure
- translate git_diff_file and git_status_diff_stats filePath into the
  git.diff pathspecs contract instead of the unrelated paths field, and
  fall back to ["."] so whole-tree stat requests are not rejected
- derive diff stat staged flags from the request instead of hardcoding
  false, and fetch staged and unstaged stats so both groups show counts
- open diffs in split view like the macOS reference product and IDEA
  instead of a hardcoded unified default
- persist the unified/split preference in a zustand store so the choice
  survives reopening diffs and restarting the app
…ut-contract

fix(windows): align local branch checkout and deletion refs
…y-pagination

fix(windows): improve Git diff viewing and history pagination
…ispatcher

- translate git_merge and git_rebase into git.write with qualified
  refs/heads references, mirroring the checkout translations
- add git_integration_preflight, git_operation_state,
  git_operation_continue/abort/skip, and git_conflict_markers
  translations so the frontend can drive the shared core's conflict
  machinery
- map git.operationState responses into a UI-ready shape and collapse
  the no-operation case to null, matching the macOS model
- pass through integration preflight blocking paths and conflict
  marker paths for the upcoming banner and commit guard
- add git-integration-api with preflight-first merge/rebase that
  distinguishes conflict stops from real failures via operation state
- store operationState in the workspace git store and refresh it on
  every status pass so banner state stays true to the repository
- mirror the macOS banner: in-progress title, rebase step counters,
  conflict count, and Continue/Skip/Abort actions
- keep Continue disabled while conflicts remain and re-run resolution
  through the shared core, refreshing state after every attempt
- add a per-branch action menu with Merge into Current Branch and
  Rebase Current Branch onto This behind one confirmation each
- surface clean, conflict-stop, blocked-by-dirty, and failure outcomes
  with the shared core's preflight and operation state
- refuse to commit while the operation state still lists conflicted
  paths or staged files contain conflict markers, with the file names
  surfaced instead of Git's raw refusal
The action wrapper only stopped pointer-down propagation, so the click
that opened the menu also bubbled to the row's checkout handler, which
disabled the trigger and closed the menu instantly. Stop click
propagation like the retired delete button did.
…menu

Button wraps itself in a Tooltip component when given a tooltip prop,
so Base UI's render prop attached the menu trigger handlers to the
tooltip wrapper instead of the real button and clicks never opened the
menu. Pass only aria-label, like the working diff header trigger.
在活动栏左下角增加运行入口,配置由 Rust Core 生成并写入 .lithe,Windows 宿主负责发现本机 JDK/Maven 并拉起进程。打开项目不会自动生成配置。
feat(windows): 支持在桌面端运行 Java、Maven 与 Spring Boot 项目
行尾 Git Blame 注入文本会挡住最后一个字符,CRLF 残留和等宽宽度缓存也会让光标停在行尾前。改为浮动 Blame、规范化换行,并在拖选时避免打断选区。

Co-authored-by: Cursor <cursoragent@cursor.com>
1lck and others added 25 commits August 17, 2026 13:58
…preflight

Add safe Windows pull preflight workflow
feat(windows): restore project opening and title menu workflows
Stop caret, find, diagnostics, and project-tree updates from rebuilding
the whole window. Keep file watching and Git refresh, but apply them to
the surfaces that actually change. Add a status-bar FPS readout so
typing jank is visible.
Button and context-menu closures are not MainActor-isolated under the
CI Swift 6 check. Hop back to AppModel from nonisolated action methods
instead of marking the helper class itself MainActor.
perf(macOS): scope workbench refresh and add FPS monitor
…se-controls

feat(windows): add project tab close controls
Apply CREATE_NO_WINDOW to language-server launches and registry font queries so IDE background work cannot create visible console windows. Add focused Windows regression coverage while leaving explicit ConPTY terminals unchanged.
WebView2 会把滚轮锁在 overflow:hidden 的树节点上,侧栏拖拽条也会挡住滚动条。将滚轮交给真正的滚动容器,避免必须先点击滚动条才能滑动。

Co-authored-by: Cursor <cursoragent@cursor.com>
…h-picker

Fix/issue 130 macos run path picker
…shes

fix(windows): suppress console flashes and align project tabs
fix(windows): 修复项目目录和 Git 面板鼠标滚轮偶发无法滚动
@ElvisLin101
ElvisLin101 requested a review from 1lck as a code owner August 19, 2026 02:36
xiaoyumuxi added a commit that referenced this pull request Nov 22, 2026
- 读取托管在 GitHub 的插件市场索引时,先匿名查索引分支的最新提交,再读该提交下的固定地址,
  绕过 raw.githubusercontent.com 对分支地址约 5 分钟的缓存;查询 5 秒超时,失败记
  plugin_marketplace_pin 并改读原地址
- 设置窗口回到插件页或窗口回到前台时,数据超过一分钟就在后台静默刷新,列表照常显示
- 已安装插件详情在“版本与来源”后新增“更新日志”页签,打开时通过 Core 的 listReleases
  读取市场登记仓库的 Releases:最新在前,标出预发布和已安装版本,正文按 Markdown 显示,
  只打开网页链接;失败可重试并记 plugin_releases;同一窗口内按仓库缓存
- 详情过窄时页签换行,英文最窄窗口下不再被截断
- 固定 Core main 4430719(#172、#173)
@xiaoyumuxi xiaoyumuxi mentioned this pull request Nov 23, 2026
8 of 11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants