Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
a7816ee
feat(desktop): add Excel/spreadsheet file viewer with diff support
MocA-Love Mar 27, 2026
ed0f764
Merge pull request #1 from MocA-Love/feat/excel-viewer
MocA-Love Mar 27, 2026
d261b13
Merge branch 'superset-sh:main' into main
MocA-Love Mar 27, 2026
1e2cfea
fix(desktop): prevent browser webview reload on tab switch
MocA-Love Mar 27, 2026
5c520d8
fix(desktop): prevent browser webview reload on workspace switch
MocA-Love Mar 27, 2026
18389a6
fix(desktop): fix workspace context leaks and hotkey conflicts in kee…
MocA-Love Mar 27, 2026
5bd896e
feat(desktop): support mouse back/forward buttons inside browser webview
MocA-Love Mar 27, 2026
afc8023
fix(desktop): support mouse back/forward buttons on macOS in webview
MocA-Love Mar 27, 2026
6d73a23
fix(desktop): limit keep-alive to webview tabs and evict deleted work…
MocA-Love Mar 27, 2026
34226dd
merge: resolve conflict with main in ChangesView.tsx
MocA-Love Mar 27, 2026
39df932
fix(desktop): disable auto-update and redirect to fork releases
MocA-Love Mar 27, 2026
8dd0a8e
fix: point fork URL to repo root instead of releases page
MocA-Love Mar 27, 2026
d2d1670
Merge pull request #3 from MocA-Love/fix/disable-auto-update
MocA-Love Mar 27, 2026
0ef6124
refactor(desktop): address CodeRabbit review feedback
MocA-Love Mar 27, 2026
5d39b15
Merge pull request #2 from MocA-Love/fix/desktop-browser-tab-reload
MocA-Love Mar 27, 2026
b5efb79
docs: add fork-specific changes section to README
MocA-Love Mar 27, 2026
bb48c8b
docs: add browser webview reload fix and mouse nav to fork changes
MocA-Love Mar 27, 2026
0db0947
docs: add PR numbers and dates to fork changes table
MocA-Love Mar 27, 2026
07c8f28
docs: add fork build instructions for macOS
MocA-Love Mar 27, 2026
62ab504
feat(desktop): AI-powered commit message generation
MocA-Love Mar 27, 2026
cd9b325
refactor(desktop): use hierarchical summarization for commit message …
MocA-Love Mar 27, 2026
30deac5
docs: add AI commit message generation to fork changes table
MocA-Love Mar 27, 2026
a625f09
Merge pull request #4 from MocA-Love/feat/desktop-ai-commit-message
MocA-Love Mar 27, 2026
c4de90e
feat(desktop): add CodeMirror-based diff viewer for large files
MocA-Love Mar 27, 2026
634e0df
fix: increase diff scanLimit to handle large files correctly
MocA-Love Mar 28, 2026
672ef87
fix: wrap CodeMirrorDiffViewer in DiffViewerContextMenu
MocA-Love Mar 28, 2026
39f9377
docs: add large file diff viewer to fork changes table
MocA-Love Mar 28, 2026
3abd79f
Merge pull request #5 from MocA-Love/feat/codemirror-diff-viewer
MocA-Love Mar 28, 2026
424baf1
feat(desktop): resizable ports list and ports.json filter toggle
MocA-Love Mar 28, 2026
42737e5
docs: add ports resize and filter to fork changes table
MocA-Love Mar 28, 2026
e99a6cc
Merge pull request #6 from MocA-Love/feat/desktop-ports-resize-filter
MocA-Love Mar 28, 2026
621112d
docs: ビルド手順を修正し、環境変数の注意事項を追記
MocA-Love Mar 28, 2026
22a48e7
feat(desktop): ports.json 定義ポートをプロセス検出有無にかかわらず常に表示
MocA-Love Mar 28, 2026
30f273d
Merge pull request #7 from MocA-Love/feat/desktop-ports-static-always…
MocA-Love Mar 28, 2026
a309772
feat(desktop): Ports セクションのワークスペース名をワークツリーパスのbasenameに改善
MocA-Love Mar 28, 2026
e0bce47
Merge pull request #8 from MocA-Love/feat/desktop-ports-worktree-name
MocA-Love Mar 28, 2026
48ab79e
feat(desktop): ブラウザタブにズーム倍率表示と操作ボタンを追加
MocA-Love Mar 28, 2026
afa9d21
feat(desktop): ブラウザタブ機能強化 — ズーム同期・新タブリンク・URLコピー
MocA-Love Mar 28, 2026
eed2e92
fix(desktop): clipboard 書き込み失敗時のエラーハンドリング追加
MocA-Love Mar 28, 2026
eff3348
Merge pull request #10 from MocA-Love/feat/desktop-browser-zoom-v2
MocA-Love Mar 28, 2026
9fed59e
merge: upstream/main を取り込み(behind 0 にする)
MocA-Love Mar 28, 2026
8d37a1f
feat(desktop): ペインのポップアウト(別ウィンドウ分離)機能を実装
MocA-Love Mar 29, 2026
7c31e76
feat(desktop): ポップアウトウィンドウのUI調整
MocA-Love Mar 29, 2026
f6e152c
feat(desktop): ポップアウトウィンドウのドラッグ領域をタブバー右側に移動
MocA-Love Mar 29, 2026
09b6e73
fix(desktop): ポップアウトウィンドウclose時の全タブ返却と重複防止
MocA-Love Mar 29, 2026
b38002f
fix(desktop): ティアオフウィンドウのWindowIdを"main"から"tearoff"に変更
MocA-Love Mar 29, 2026
a69a06e
feat(desktop): タブの右クリックメニューにカラー設定を追加
MocA-Love Mar 29, 2026
2767350
fix(desktop): tearoffレビュー指摘3件を修正
MocA-Love Mar 29, 2026
042d2ce
docs: README にタブポップアウト機能を追記
MocA-Love Mar 29, 2026
c6db537
Merge pull request #11 from MocA-Love/feat/desktop-tab-tearoff
MocA-Love Mar 29, 2026
dff3532
merge: mainブランチを取り込み(READMEコンフリクト解消)
MocA-Love Mar 29, 2026
bd18070
Merge pull request #12 from MocA-Love/feat/desktop-tab-color
MocA-Love Mar 29, 2026
112da6f
fix(desktop): クラッシュリカバリーとエラーハンドリングを強化
MocA-Love Mar 29, 2026
42c7a62
docs: README にクラッシュリカバリー強化を追記
MocA-Love Mar 29, 2026
ec1471a
Merge pull request #13 from MocA-Love/fix/desktop-crash-recovery
MocA-Love Mar 29, 2026
7f9b4f6
feat(desktop): Excel描画オブジェクト(線・矩形)とセル斜線の表示に対応
MocA-Love Mar 29, 2026
d27be6d
fix(desktop): フォーク版の自動アップデートをGitHub APIベースに変更
MocA-Love Mar 29, 2026
7d8e059
docs: README のフォーク変更テーブルを更新
MocA-Love Mar 29, 2026
6aa3003
feat(desktop): Chrome Web Store からブラウザ拡張機能をインストール可能に
MocA-Love Mar 29, 2026
8277938
Merge pull request #17 from MocA-Love/feat/desktop-fork-update-check
MocA-Love Mar 29, 2026
b8da7e6
docs: README の PR 番号を #14 → #16 に修正
MocA-Love Mar 29, 2026
d16c67c
Merge pull request #16 from MocA-Love/feat/desktop-excel-shapes
MocA-Love Mar 29, 2026
d4b48cd
Merge remote-tracking branch 'origin/main' into feat/chrome-extension…
MocA-Love Mar 29, 2026
cd0840e
fix(desktop): LuLoader2 → LuLoaderCircle に修正(react-icons互換)
MocA-Love Mar 29, 2026
a5de20a
feat(desktop): Excelセルのインラインdiff表示を追加
MocA-Love Mar 29, 2026
ea1e13d
feat(desktop): 変更セルにホバーTooltipでフルdiff表示
MocA-Love Mar 29, 2026
8aa5e4f
feat(desktop): ツールチップサイズ調整 & README更新
MocA-Love Mar 29, 2026
a05a180
Merge pull request #19 from MocA-Love/feat/desktop-excel-inline-diff
MocA-Love Mar 29, 2026
bb8f304
feat(desktop): 拡張機能ツールバーUI(アイコン表示 + ポップアップウィンドウ)
MocA-Love Mar 29, 2026
fb7a611
fix(desktop): ポップアップの sandbox:false + file:// フォールバック対応
MocA-Love Mar 29, 2026
0b9369b
fix(desktop): ポップアップウィンドウの背景色をテーマに合わせて設定
MocA-Love Mar 29, 2026
fc19184
fix(desktop): Electron割当IDをchrome-extension:// URLに使用
MocA-Love Mar 29, 2026
ec8a259
fix(desktop): 拡張機能カードのレイアウトはみ出しを修正
MocA-Love Mar 29, 2026
efa8a7b
docs: README にChrome拡張機能インストール機能を追記
MocA-Love Mar 29, 2026
b949fa4
Merge branch 'main' into feat/chrome-extension-install
MocA-Love Mar 29, 2026
4f0227f
Merge pull request #20 from MocA-Love/feat/chrome-extension-install
MocA-Love Mar 29, 2026
e710aed
Merge remote-tracking branch 'upstream/main'
MocA-Love Mar 29, 2026
ea8a3fd
feat(desktop): Filesタブにファイル名ツールチップ機能を追加
MocA-Love Mar 29, 2026
f2bed29
docs: README に Files タブツールチップ機能(PR #22)を追記
MocA-Love Mar 29, 2026
ba7ce3d
Merge pull request #22 from MocA-Love/feat/files-tab-tooltip
MocA-Love Mar 29, 2026
412083f
feat(desktop): ブラウザペインの右クリックメニューに「Inspect Element」を追加
MocA-Love Mar 29, 2026
87010a5
docs: README に Inspect Element 機能(PR #23)を追記
MocA-Love Mar 29, 2026
ecd6b43
Merge pull request #23 from MocA-Love/feat/desktop-inspect-element
MocA-Love Mar 29, 2026
0aafa91
feat(desktop): シェル履歴ベースのターミナルサジェスト機能
MocA-Love Mar 30, 2026
7224de0
feat(desktop): branch ワークスペースで PR 情報を表示可能に
MocA-Love Mar 30, 2026
302c58c
feat(desktop): サジェストリストをスクロール方式に変更、README更新
MocA-Love Mar 30, 2026
87fe5e9
feat(desktop): ゴーストテキスト廃止、ドロップダウンのみに変更、zsh-autosuggestions無効化
MocA-Love Mar 30, 2026
53b52ef
feat(desktop): ゴーストテキスト廃止、ドロップダウンのみに変更、zsh-autosuggestions無効化
MocA-Love Mar 30, 2026
f3c554f
fix(desktop): zsh-autosuggestions無効化を公式APIに修正
MocA-Love Mar 30, 2026
17f9387
feat(desktop): ゴーストテキスト廃止、ドロップダウンのみに変更、zsh-autosuggestions無効化
MocA-Love Mar 30, 2026
c62f33c
fix: SuggestionsSetting をフォルダ構成に変更、README PR番号を追記
MocA-Love Mar 30, 2026
19f3b7b
Merge pull request #24 from MocA-Love/feat/desktop-terminal-suggestions
MocA-Love Mar 30, 2026
062015d
fix: 重複した SuggestionsSetting.tsx を削除(フォルダ構成に移行済み)
MocA-Love Mar 30, 2026
aabe193
merge: upstream/main を取り込み(14コミット behind 解消)
MocA-Love Mar 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,75 @@ Works with any CLI agent. Built for local worktree-based development.

</div>

## Fork 固有の変更点

このリポジトリは [superset-sh/superset](https://github.com/superset-sh/superset) のフォークです。以下の独自変更が含まれています。

| 変更 | 概要 | PR | 追加日 |
|:-----|:-----|:--:|:------:|
| **Excel/スプレッドシート ビューア** | .xlsx/.xls/.ods ファイルを書式付きで表示。罫線・結合セル・テーマカラー・リッチテキスト対応。複数シートタブ切り替え、コンテナ幅への自動フィット | [#1](https://github.com/MocA-Love/superset/pull/1) | 2026-03-27 |
| **Excel diff ビューア** | スプレッドシートのサイドバイサイド差分表示。セル単位の変更ハイライト、Prev/Next ナビゲーション、左右同期スクロール | [#1](https://github.com/MocA-Love/superset/pull/1) | 2026-03-27 |
| **フォーク版アップデート通知** | 本家 electron-updater を無効化し、GitHub API でフォークリリースをチェックする方式に変更。新バージョン検出時にトースト通知を表示し「Open releases」からダウンロードページへ遷移。4時間ごと+起動時に自動チェック | [#3](https://github.com/MocA-Love/superset/pull/3) [#17](https://github.com/MocA-Love/superset/pull/17) | 2026-03-29 |
| **ブラウザ webview リロード防止** | タブ/ワークスペース切り替え時に Electron の webview がリロードされる問題を修正。webview を含むタブを keep-alive し、ワークスペースページをルーター上位で保持。WorkspaceIdContext による正しいコンテキスト分離、ホットキーの active-only 制御も実装 | [#2](https://github.com/MocA-Love/superset/pull/2) | 2026-03-28 |
| **マウス戻る/進むボタン対応** | ブラウザ webview 内でマウスの戻る/進むボタンが動作するように対応。macOS は guest ページへのスクリプト注入、Windows/Linux は app-command イベントで処理 | [#2](https://github.com/MocA-Love/superset/pull/2) | 2026-03-28 |
| **AI コミットメッセージ生成** | コミットメッセージ入力欄のスパークルボタンで AI が conventional commit メッセージを日本語で自動生成。階層的要約方式(gptcommit 式)により大量差分でも高精度。staged/unstaged/untracked 全対応、lock ファイル・バイナリ自動スキップ | [#4](https://github.com/MocA-Love/superset/pull/4) | 2026-03-28 |
| **ポートリストのリサイズ・フィルタ** | サイドバーの Ports セクションの高さをドラッグでリサイズ可能に(80–600px、永続化)。フィルタトグルで ports.json に定義されたポートのみ表示し、自動検出ポートを非表示にできる | [#6](https://github.com/MocA-Love/superset/pull/6) | 2026-03-28 |
| **大規模ファイル diff 高速化** | 2000行超のファイルで CodeMirror 6 ベースの仮想化 diff ビューアに自動切替。ビューポート分のDOMのみ描画し、15000行でもスムーズ表示。既存テーマ・シンタックスハイライト再利用、未変更領域の自動折りたたみ | [#5](https://github.com/MocA-Love/superset/pull/5) | 2026-03-28 |
| **ports.json ポートの常時表示** | ports.json に定義されたポートをプロセス検出の有無にかかわらず常にサイドバーに表示。Docker 等で検知できないポートもラベル付きで一覧に出る。検出済みポートは従来通りアクティブ表示、未検出は グレー表示で区別 | [#7](https://github.com/MocA-Love/superset/pull/7) | 2026-03-28 |
| **Ports ワークスペース名の改善** | Ports セクションのワークスペース名をワークツリーのディレクトリ名ベースに変更。同名ワークスペースが複数ある場合でもどのワークツリーか一目で区別可能 | [#8](https://github.com/MocA-Love/superset/pull/8) | 2026-03-28 |
| **ブラウザタブ機能強化** | ズーム倍率表示と [-]/[+] ボタン(Cmd+/- と同期)、target="_blank" リンクや Cmd+click を新しいブラウザタブで開く機能、URL コピーボタンを追加。タブが非表示中でもリンクイベントを正しく処理するグローバルハンドラ実装 | [#10](https://github.com/MocA-Love/superset/pull/10) | 2026-03-29 |
| **タブのポップアウト** | ペインツールバーの Pop out ボタンでタブを独立ウィンドウとして分離。閉じるとメインウィンドウに自動返却。ターミナルセッション維持、preload 同期注入方式で Zustand persist との競合を排除 | [#11](https://github.com/MocA-Love/superset/pull/11) | 2026-03-29 |
| **タブカラー設定** | タブを右クリック → Set Color で13色から背景色を設定可能。ワークスペースセクションと同じカラーパレットを再利用。アクティブ/非アクティブで濃淡が変化し、設定は自動永続化 | [#12](https://github.com/MocA-Love/superset/pull/12) | 2026-03-29 |
| **クラッシュリカバリー強化** | macOS でアプリが白画面/フリーズする問題を修正。GPU クラッシュ時に最大化/フルスクリーンでもコンポジター再構築を実行、レンダラークラッシュ時の自動リロード/再起動、clipboard 操作のエラーハンドリング追加 | [#13](https://github.com/MocA-Love/superset/pull/13) | 2026-03-29 |
| **Excel 描画オブジェクト・斜線表示** | Excel ファイルの描画オブジェクト(線・矩形)とセル斜線を表示。xlsx ZIP から drawing XML を直接パースし、CSS transform 方式の SVG オーバーレイで正確に配置 | [#16](https://github.com/MocA-Love/superset/pull/16) | 2026-03-29 |
| **Chrome 拡張機能インストール** | Chrome Web Store の URL または拡張 ID からブラウザ拡張機能をインストール。CRX ダウンロード・展開、互換性チェック(Electron 非対応 API 検出)、設定画面での管理(有効/無効/削除)。BrowserPane ツールバーに拡張アイコンを表示し、クリックでポップアップウィンドウを表示。GPL ライブラリ不使用、Electron 標準 API のみで自前実装 | [#20](https://github.com/MocA-Love/superset/pull/20) | 2026-03-29 |
| **Excel diff インラインハイライト** | Excel 差分表示で変更セル内のテキスト差分を文字レベルでインライン表示。追加部分は緑、削除部分は赤+取り消し線。セルからはみ出る場合はホバーでツールチップにフル差分を表示 | [#19](https://github.com/MocA-Love/superset/pull/19) | 2026-03-29 |
| **Files タブのツールチップ** | ファイルツリーのファイル/フォルダ名にホバーで相対パスをツールチップ表示。ツールバーのトグルボタンで ON/OFF 切り替え、設定は永続化 | [#22](https://github.com/MocA-Love/superset/pull/22) | 2026-03-29 |
| **Inspect Element(右クリック検証)** | ブラウザペインの右クリックメニューに「Inspect Element」を追加。クリック位置の要素を直接 DevTools でインスペクト可能 | [#23](https://github.com/MocA-Love/superset/pull/23) | 2026-03-30 |
| **Branch ワークスペースの PR 表示対応** | worktree を切らない「branch」タイプのワークスペースでも Review タブに PR 情報・チェック結果・レビューコメントを表示。`getGitHubStatus` / `getGitHubPRComments` が worktree レコード必須だった制限を、`mainRepoPath` へのフォールバックで解消 | [#24](https://github.com/MocA-Love/superset/pull/24) | 2026-03-30 |
| **シェル履歴サジェスト** | ターミナル入力時に ~/.zsh_history からコマンド候補をドロップダウン表示。↑↓で選択、→で確定、Escで破棄。選択中コマンドのフルプレビュー付き(補完部分を緑色で強調)。8件超はスクロール、末尾到達で追加読み込み。設定画面から ON/OFF 切り替え可能 | [#24](https://github.com/MocA-Love/superset/pull/24) | 2026-03-30 |

## Fork のビルド方法 (macOS)

### 前提条件

- [Bun](https://bun.sh/) v1.0+
- Git 2.20+
- Xcode Command Line Tools (`xcode-select --install`)

### 手順

```bash
# 1. リポジトリをクローン
git clone https://github.com/MocA-Love/superset.git
cd superset

# 2. 依存関係のインストール
bun install

# 3. デスクトップアプリをビルド
cd apps/desktop
SUPERSET_WORKSPACE_NAME=superset bun run build

# 4. ビルド成果物を開く
open release
```

`release` フォルダ内の `.dmg` ファイルを開き、Superset.app を Applications にドラッグしてインストールしてください。

> **⚠️ ビルド時の注意**: `bun dev` でアプリを起動中にビルドすると、開発用の環境変数(`SUPERSET_WORKSPACE_NAME=default` 等)がバイナリに焼き込まれ、本番データ(`~/.superset/`)が参照されなくなります。ビルド時は必ず `SUPERSET_WORKSPACE_NAME=superset` を明示的に指定してください。

> **📦 上書きインストールについて**: 公式版の `.dmg` をフォーク版で上書きしても、ワークスペース・ターミナル履歴・設定はすべて `~/.superset/` に保持されるため、データが消えることはありません。

### 開発モードで実行

```bash
bun install
bun run dev --filter=@superset/desktop
```

---

## Code 10x Faster With No Switching Cost

Superset orchestrates CLI-based coding agents across isolated git worktrees, with built-in terminal, review, and open-in-editor workflows.
Expand Down
5 changes: 5 additions & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@codemirror/lang-yaml": "^6.1.2",
"@codemirror/language": "^6.12.2",
"@codemirror/legacy-modes": "^6.5.2",
"@codemirror/merge": "^6.12.1",
"@codemirror/search": "^6.6.0",
"@codemirror/state": "^6.5.4",
"@codemirror/theme-one-dark": "^6.1.3",
Expand Down Expand Up @@ -154,12 +155,14 @@
"clsx": "^2.1.1",
"culori": "^4.0.2",
"date-fns": "^4.1.0",
"diff": "^7.0.0",
"default-shell": "^2.2.0",
"detect-libc": "2.0.4",
"dnd-core": "^16.0.1",
"dotenv": "^17.3.1",
"drizzle-orm": "0.45.1",
"electron-updater": "^6.7.3",
"exceljs": "^4.4.0",
"execa": "^9.6.0",
"express": "^5.1.0",
"fast-glob": "^3.3.3",
Expand All @@ -185,6 +188,7 @@
"os-locale": "^6.0.2",
"pidtree": "^0.6.0",
"pidusage": "^4.0.1",
"jszip": "^3.10.1",
"posthog-js": "1.310.1",
"posthog-node": "^5.24.7",
"prebuild-install": "^7.1.1",
Expand Down Expand Up @@ -227,6 +231,7 @@
"@tanstack/router-cli": "^1.149.0",
"@tanstack/router-plugin": "^1.149.0",
"@types/better-sqlite3": "^7.6.13",
"@types/diff": "^6.0.0",
"@types/bun": "^1.2.17",
"@types/culori": "^4.0.1",
"@types/http-proxy": "^1.17.17",
Expand Down
40 changes: 40 additions & 0 deletions apps/desktop/src/lib/trpc/routers/browser/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ export const createBrowserRouter = () => {
});
}),

/** Global subscription for new-window events from any browser pane. */
onAnyNewWindow: publicProcedure.subscription(() => {
return observable<{ paneId: string; url: string }>((emit) => {
const handler = (data: { paneId: string; url: string }) => {
emit.next(data);
};
browserManager.on("new-window", handler);
return () => {
browserManager.off("new-window", handler);
};
});
}),

onContextMenuAction: publicProcedure
.input(z.object({ paneId: z.string() }))
.subscription(({ input }) => {
Expand All @@ -136,6 +149,33 @@ export const createBrowserRouter = () => {
return { success: true };
}),

setZoomLevel: publicProcedure
.input(z.object({ paneId: z.string(), level: z.number() }))
.mutation(({ input }) => {
const wc = browserManager.getWebContents(input.paneId);
if (!wc) return { success: false };
wc.setZoomLevel(input.level);
return { success: true };
}),

onZoomChanged: publicProcedure
.input(z.object({ paneId: z.string() }))
.subscription(({ input }) => {
return observable<{ zoomLevel: number }>((emit) => {
let lastLevel: number | null = null;
const interval = setInterval(() => {
const wc = browserManager.getWebContents(input.paneId);
if (!wc) return;
const level = wc.getZoomLevel();
if (level !== lastLevel) {
lastLevel = level;
emit.next({ zoomLevel: level });
}
}, 300);
return () => clearInterval(interval);
});
}),

getPageInfo: publicProcedure
.input(z.object({ paneId: z.string() }))
.query(({ input }) => {
Expand Down
49 changes: 49 additions & 0 deletions apps/desktop/src/lib/trpc/routers/changes/file-contents.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { execFile } from "node:child_process";
import { promisify } from "node:util";
import type { FileContents } from "shared/changes-types";
import { detectLanguage } from "shared/detect-language";
import type { SimpleGit } from "simple-git";
import { z } from "zod";
import { publicProcedure, router } from "../..";
import { toRegisteredWorktreeRelativePath } from "../workspace-fs-service";
import { getSimpleGitWithShellPath } from "../workspaces/utils/git-client";
import { getProcessEnvWithShellPath } from "../workspaces/utils/shell-env";

const MAX_FILE_SIZE = 2 * 1024 * 1024;
const MAX_BINARY_FILE_SIZE = 10 * 1024 * 1024;
const execFileAsync = promisify(execFile);

export const createFileContentsRouter = () => {
return router({
Expand Down Expand Up @@ -51,6 +56,50 @@ export const createFileContentsRouter = () => {
};
}),

readGitFileBinary: publicProcedure
.input(
z.object({
worktreePath: z.string(),
absolutePath: z.string(),
ref: z.string().default("HEAD"),
}),
)
.query(async ({ input }): Promise<{ content: string | null }> => {
const relativePath = toRegisteredWorktreeRelativePath(
input.worktreePath,
input.absolutePath,
);
const spec = `${input.ref}:${relativePath}`;
const git = await getSimpleGitWithShellPath(input.worktreePath);

try {
const sizeOutput = await git.raw(["cat-file", "-s", spec]);
const blobSize = Number.parseInt(sizeOutput.trim(), 10);
if (!Number.isNaN(blobSize) && blobSize > MAX_BINARY_FILE_SIZE) {
return { content: null };
}
} catch {
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Empty catch blocks in readGitFileBinary swallow git/process errors and always return null, which removes diagnostic visibility for unexpected failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/lib/trpc/routers/changes/file-contents.ts, line 81:

<comment>Empty catch blocks in readGitFileBinary swallow git/process errors and always return null, which removes diagnostic visibility for unexpected failures.</comment>

<file context>
@@ -51,6 +56,50 @@ export const createFileContentsRouter = () => {
+					if (!Number.isNaN(blobSize) && blobSize > MAX_BINARY_FILE_SIZE) {
+						return { content: null };
+					}
+				} catch {
+					return { content: null };
+				}
</file context>
Fix with Cubic

return { content: null };
}

try {
const env = await getProcessEnvWithShellPath();
const { stdout } = await execFileAsync(
"git",
["cat-file", "-p", spec],
{
cwd: input.worktreePath,
encoding: "buffer",
maxBuffer: MAX_BINARY_FILE_SIZE,
env,
},
);
return { content: (stdout as unknown as Buffer).toString("base64") };
} catch {
return { content: null };
}
}),

getGitOriginalContent: publicProcedure
.input(
z.object({
Expand Down
Loading