v1.1.0
After a few weeks of dogfooding Codelegate at work every day, a couple of terminal paper cuts surfaced - and while mitigating a database incident I hit a much bigger problem: the Git subsystem ground to a halt on the large changeset involved. This release is primarily about fixing that by rebuilding the Git subsystem from the ground up.
Download Codelegate v1.1.0 here
Git Subsystem Rewrite
The previous implementation shelled out to git and tried to read and render every diff upfront. With a large number of changed files or a single massive diff, that meant runaway memory and CPU usage - often enough to freeze the whole app.
The new backend is written against the Rust-native git2 library while keeping the UI and UX unchanged. File diffs are now fetched lazily and asynchronously so the interface stays responsive, and @tanstack/react-virtual handles the heavy lifting for rendering large changesets.
A few related quality-of-life tweaks came along for the ride: only the first 10 files auto-expand when you open the Git pane, files with excessive changes stay collapsed by default, and syntax highlighting is skipped for very large files.
Terminal Improvements
- Scroll position memory: switching sessions no longer loses your place in the scrollback.
- Selection fix: terminal text selection was being dropped on state updates; this is now preserved.
- Switched to the default xterm.js renderer, which simplifies the rendering pipeline and fixes incorrect font rendering.
v1.1.0
在經過數個禮拜在工作上每日的實際使用後,除了發現一些關於終端機相關的易用性問題外,某次在進行資料庫相關的事件後續處理中我還發現了原有 Git 子系統設計的效能問題,這次的新版本主要的改動就在於將整個 Git 子系統重新設計並實作,增進對於大量檔案變動與大型檔案的反應速度。
完全重寫 Git 子系統
原本 Git 子系統在處理大量檔案更動或是大型檔案時會導致整個程式試圖透過系統本身的 git CLI 一次讀取並渲染 所有 的改變,導致程式本身使用過多的記憶體與 CPU 資源,進而讓整個系統當機。
這個版本的更動,在保留原有的使用者介面與體驗下,改用了 Rust 原生的 git2 函式庫完整重寫了 Git 子系統的後端,讀取每個檔案的實際改動時也採用非同步的讀取,避免使用者介面的卡頓,並且使用 @tanstack/react-virtual 讓大型更動的渲染更加高效。
同時在初次進入 Git 面板時,預設只會展開前 10 個檔案,變動過多的檔案會保持摺疊,同時對於過大的檔案會取消語法高亮以增進速度。
終端機改善
- 捲動位置記憶 :切換 session 時不再遺失終端機的捲動位置。
- 選取修正 :修正狀態更新時終端機文字選取遺失的問題。
- 切換至 xterm.js 預設渲染器,簡化渲染流程,避免字體不正確顯示。