@happy-nut/monacori 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icon.icns +0 -0
- package/dist/app-main.js +441 -158
- package/dist/assets.js +8 -1
- package/dist/build.d.ts +1 -0
- package/dist/build.js +13 -7
- package/dist/diff.d.ts +2 -1
- package/dist/diff.js +3 -3
- package/dist/i18n.js +56 -8
- package/dist/preload.cjs +15 -0
- package/dist/render.d.ts +5 -0
- package/dist/render.js +154 -29
- package/dist/util.d.ts +5 -0
- package/dist/util.js +21 -0
- package/dist/viewer.client.js +582 -153
- package/dist/viewer.client.min.js +1 -0
- package/dist/viewer.css +202 -72
- package/package.json +10 -2
- package/scripts/patch-electron-name.mjs +23 -14
package/dist/assets.js
CHANGED
|
@@ -26,7 +26,14 @@ export function diffCss() {
|
|
|
26
26
|
return readViewerAsset("viewer.css");
|
|
27
27
|
}
|
|
28
28
|
export function diffScript() {
|
|
29
|
-
|
|
29
|
+
// Prefer the minified bundle the build emits (smaller inlined <script>); fall back to the readable concat
|
|
30
|
+
// when minify was skipped (e.g. terser unavailable).
|
|
31
|
+
try {
|
|
32
|
+
return readViewerAsset("viewer.client.min.js");
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return readViewerAsset("viewer.client.js");
|
|
36
|
+
}
|
|
30
37
|
}
|
|
31
38
|
// xterm.js (terminal renderer) for the integrated terminal panel. UMD bundles that expose
|
|
32
39
|
// window.Terminal + window.FitAddon when inlined. Resolved from node_modules like diff2HtmlCss();
|
package/dist/build.d.ts
CHANGED
package/dist/build.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { basename } from "node:path";
|
|
3
|
-
import { isGitRepository } from "./git.js";
|
|
3
|
+
import { isGitRepository, git } from "./git.js";
|
|
4
4
|
import { collectHttpEnvironments, collectReviewFileStates, collectSourceFiles, parseUnifiedDiff, readUnifiedDiff } from "./diff.js";
|
|
5
5
|
import { renderDiff2Html } from "./highlight.js";
|
|
6
6
|
import { diffSubtitle, renderDiffHtml, renderDiffTree, renderNotGitRepoHtml, renderReviewStatus, renderSourceTree, shouldLazyRender, splitDiffForLazy } from "./render.js";
|
|
7
7
|
export function buildDiffReview(input) {
|
|
8
|
-
|
|
8
|
+
const root = input.root ?? process.cwd();
|
|
9
|
+
if (!isGitRepository(root)) {
|
|
9
10
|
return {
|
|
10
|
-
html: renderNotGitRepoHtml(
|
|
11
|
+
html: renderNotGitRepoHtml(root),
|
|
11
12
|
files: 0,
|
|
12
13
|
hunks: 0,
|
|
13
14
|
signature: "not-a-git-repo",
|
|
@@ -20,13 +21,16 @@ export function buildDiffReview(input) {
|
|
|
20
21
|
context: input.context,
|
|
21
22
|
includeUntracked: input.includeUntracked,
|
|
22
23
|
ignoreWhitespace: input.ignoreWhitespace,
|
|
24
|
+
root,
|
|
23
25
|
});
|
|
24
26
|
const files = parseUnifiedDiff(diffText);
|
|
25
|
-
const sourceFiles = collectSourceFiles(files);
|
|
27
|
+
const sourceFiles = collectSourceFiles(files, root);
|
|
26
28
|
const fileStates = collectReviewFileStates(files, sourceFiles);
|
|
27
|
-
const httpEnvironments = collectHttpEnvironments(
|
|
29
|
+
const httpEnvironments = collectHttpEnvironments(root);
|
|
28
30
|
const hunks = files.reduce((sum, file) => sum + file.hunks.length, 0);
|
|
29
31
|
const generatedAt = new Date().toISOString();
|
|
32
|
+
// Current branch for the sidebar chip (empty on a detached HEAD); refreshed in the watch payload too.
|
|
33
|
+
const branch = git(root, ["branch", "--show-current"]);
|
|
30
34
|
const diffHtml = renderDiff2Html(diffText);
|
|
31
35
|
const totalLines = files.reduce((sum, file) => sum + file.hunks.reduce((t, h) => t + h.lines.length, 0), 0);
|
|
32
36
|
// lazy-LOAD (Phase 2) serves each file body + source on demand instead of embedding them; it implies
|
|
@@ -57,8 +61,9 @@ export function buildDiffReview(input) {
|
|
|
57
61
|
httpEnvironments,
|
|
58
62
|
title: input.title,
|
|
59
63
|
subtitle: diffSubtitle(input),
|
|
60
|
-
projectName: basename(
|
|
61
|
-
projectPath:
|
|
64
|
+
projectName: basename(root),
|
|
65
|
+
projectPath: root,
|
|
66
|
+
branch,
|
|
62
67
|
watch: Boolean(input.watch),
|
|
63
68
|
ignoreWhitespace: Boolean(input.ignoreWhitespace),
|
|
64
69
|
app: Boolean(input.app),
|
|
@@ -70,6 +75,7 @@ export function buildDiffReview(input) {
|
|
|
70
75
|
const update = {
|
|
71
76
|
signature,
|
|
72
77
|
generatedAt,
|
|
78
|
+
branch,
|
|
73
79
|
diffContainer: diffSplit.container || '<div class="empty" data-i18n="diff.noDiff">No diff to review.</div>',
|
|
74
80
|
changesPanel: renderDiffTree(files),
|
|
75
81
|
filesTree: renderSourceTree(sourceFiles),
|
package/dist/diff.d.ts
CHANGED
|
@@ -5,8 +5,9 @@ export declare function readUnifiedDiff(options: {
|
|
|
5
5
|
context: number;
|
|
6
6
|
includeUntracked: boolean;
|
|
7
7
|
ignoreWhitespace?: boolean;
|
|
8
|
+
root?: string;
|
|
8
9
|
}): string;
|
|
9
10
|
export declare function parseUnifiedDiff(content: string): DiffFile[];
|
|
10
|
-
export declare function collectSourceFiles(diffFiles: DiffFile[]): SourceFile[];
|
|
11
|
+
export declare function collectSourceFiles(diffFiles: DiffFile[], rootArg?: string): SourceFile[];
|
|
11
12
|
export declare function collectReviewFileStates(diffFiles: DiffFile[], sourceFiles: SourceFile[]): ReviewFileState[];
|
|
12
13
|
export declare function collectHttpEnvironments(root: string): Record<string, Record<string, string>>;
|
package/dist/diff.js
CHANGED
|
@@ -10,7 +10,7 @@ import { git, repoRoot } from "./git.js";
|
|
|
10
10
|
// IPC/pty. With it an unchanged file costs a single statSync — the per-tick cost collapses to stat-only.
|
|
11
11
|
const sourceContentCache = new Map();
|
|
12
12
|
export function readUnifiedDiff(options) {
|
|
13
|
-
const root = repoRoot();
|
|
13
|
+
const root = repoRoot(options.root);
|
|
14
14
|
const args = ["diff", "--no-ext-diff", "--find-renames", `--unified=${options.context}`];
|
|
15
15
|
if (options.ignoreWhitespace)
|
|
16
16
|
args.push("--ignore-all-space");
|
|
@@ -214,7 +214,7 @@ function gitStatusMap(cwd) {
|
|
|
214
214
|
}
|
|
215
215
|
return map;
|
|
216
216
|
}
|
|
217
|
-
export function collectSourceFiles(diffFiles) {
|
|
217
|
+
export function collectSourceFiles(diffFiles, rootArg) {
|
|
218
218
|
const changed = new Set(diffFiles
|
|
219
219
|
.map((file) => file.displayPath)
|
|
220
220
|
.filter((path) => path && path !== "/dev/null"));
|
|
@@ -231,7 +231,7 @@ export function collectSourceFiles(diffFiles) {
|
|
|
231
231
|
}
|
|
232
232
|
changedLinesByPath.set(file.displayPath, nums);
|
|
233
233
|
}
|
|
234
|
-
const root = repoRoot();
|
|
234
|
+
const root = repoRoot(rootArg);
|
|
235
235
|
const vcsByPath = gitStatusMap(root);
|
|
236
236
|
for (const file of diffFiles) {
|
|
237
237
|
const kind = vcsByPath.get(file.displayPath);
|
package/dist/i18n.js
CHANGED
|
@@ -14,17 +14,25 @@ export const MESSAGES = {
|
|
|
14
14
|
// Tabs (sidebar)
|
|
15
15
|
"tab.changes": "Changes",
|
|
16
16
|
"tab.files": "Files",
|
|
17
|
+
"tab.changes.title": "Changes (⌘0)",
|
|
18
|
+
"tab.files.title": "Files (⌘1)",
|
|
19
|
+
"rail.questions": "Questions",
|
|
20
|
+
"rail.changeRequests": "Change requests",
|
|
21
|
+
"rail.branch": "Current branch",
|
|
17
22
|
// Sidebar footer / About
|
|
18
23
|
"sidebar.updateAvailable": "update available",
|
|
19
24
|
"about.title": "About monacori",
|
|
25
|
+
"about.tip": "Settings (⌘,)",
|
|
20
26
|
"terminal.title": "Terminal",
|
|
21
|
-
"terminal.toggle": "Toggle terminal (
|
|
27
|
+
"terminal.toggle": "Toggle terminal (⌃`)",
|
|
22
28
|
"terminal.close": "Close terminal",
|
|
29
|
+
"dock.maximize": "Maximize panel (⌘⇧')",
|
|
30
|
+
"dock.restore": "Restore panel (⌘⇧')",
|
|
23
31
|
// Review status (toolbar) — units; the numeric count stays dynamic and is prepended at runtime.
|
|
24
32
|
"status.files": "files",
|
|
25
33
|
"status.hunks": "hunks",
|
|
26
34
|
"status.wsIgnored": "ws ignored",
|
|
27
|
-
"status.wsIgnored.title": "Whitespace ignored —
|
|
35
|
+
"status.wsIgnored.title": "Whitespace ignored — ⌘⇧W",
|
|
28
36
|
"status.indexed": "indexed",
|
|
29
37
|
"status.index.title": "Go-to-definition index",
|
|
30
38
|
"status.indexing": "indexing",
|
|
@@ -42,6 +50,7 @@ export const MESSAGES = {
|
|
|
42
50
|
"http.env.title": "HTTP Client environment",
|
|
43
51
|
"http.env.aria": "HTTP environment",
|
|
44
52
|
"btn.diff": "Diff",
|
|
53
|
+
"btn.diff.title": "Back to diff (F7)",
|
|
45
54
|
"source.loading": "Loading source…",
|
|
46
55
|
"source.previewUnavailable": "Source preview unavailable.",
|
|
47
56
|
"source.viewRaw": "Raw",
|
|
@@ -53,6 +62,7 @@ export const MESSAGES = {
|
|
|
53
62
|
"quickopen.recent": "Recent files",
|
|
54
63
|
"quickopen.findInFiles": "Find in Files",
|
|
55
64
|
"quickopen.noFiles": "No files found.",
|
|
65
|
+
"quickopen.typeToFilter": "type to filter",
|
|
56
66
|
// Usages
|
|
57
67
|
"usages.aria": "Usages",
|
|
58
68
|
"usages.title": "Usages",
|
|
@@ -64,6 +74,8 @@ export const MESSAGES = {
|
|
|
64
74
|
// Settings — General
|
|
65
75
|
"settings.language": "Language",
|
|
66
76
|
"settings.theme": "Theme",
|
|
77
|
+
"settings.bellNotify": "Notify when a terminal task finishes (bell)",
|
|
78
|
+
"notify.bellBody": "a task finished or needs your input",
|
|
67
79
|
"theme.dark": "Dark",
|
|
68
80
|
"theme.light": "Light",
|
|
69
81
|
"settings.checkingUpdates": "Checking for updates…",
|
|
@@ -74,10 +86,21 @@ export const MESSAGES = {
|
|
|
74
86
|
"settings.updated": "Updated. Restarting…",
|
|
75
87
|
"settings.updateFailed": "Update failed — try again, or run: npm i -g @happy-nut/monacori",
|
|
76
88
|
"settings.kbd.title": "Keyboard shortcuts",
|
|
89
|
+
"settings.kbd.cat.app": "App",
|
|
77
90
|
"settings.kbd.cat.nav": "Navigation",
|
|
78
91
|
"settings.kbd.cat.review": "Review",
|
|
79
92
|
"settings.kbd.cat.terminal": "Terminal",
|
|
80
93
|
// Settings — keyboard-shortcut labels (descriptions only; <kbd> key names stay literal)
|
|
94
|
+
"kbd.openFolder": "Open folder",
|
|
95
|
+
"kbd.openNewWindow": "Open in new window",
|
|
96
|
+
"kbd.openSettings": "Settings",
|
|
97
|
+
"kbd.closeDialog": "Close dialog / cancel",
|
|
98
|
+
"kbd.pageUpDown": "Page up / down",
|
|
99
|
+
"kbd.runHttp": "Run HTTP request (.http)",
|
|
100
|
+
"kbd.editComment": "Edit comment (when selected)",
|
|
101
|
+
"kbd.deleteComment": "Delete comment (when selected)",
|
|
102
|
+
"kbd.stepComments": "Step between comments (merged)",
|
|
103
|
+
"kbd.mergedSend": "Comment menu / send to pane (merged)",
|
|
81
104
|
"kbd.nextChange": "Next change",
|
|
82
105
|
"kbd.prevChange": "Previous change",
|
|
83
106
|
"kbd.closeTab": "Close tab",
|
|
@@ -99,6 +122,7 @@ export const MESSAGES = {
|
|
|
99
122
|
"kbd.ignoreWhitespace": "Ignore whitespace",
|
|
100
123
|
"kbd.saveComment": "Save comment",
|
|
101
124
|
"kbd.promptMemo": "Prompt memo",
|
|
125
|
+
"kbd.maximizePanel": "Maximize panel (terminal / merged / memo)",
|
|
102
126
|
"kbd.toggleTerminal": "Toggle terminal",
|
|
103
127
|
"kbd.splitPane": "Split pane",
|
|
104
128
|
"kbd.focusPane": "Focus prev / next pane",
|
|
@@ -106,7 +130,7 @@ export const MESSAGES = {
|
|
|
106
130
|
"kbd.closeTerminal": "Close terminal (when focused)",
|
|
107
131
|
// Settings — Merge prompts
|
|
108
132
|
"mergePrompts.title": "Merge prompts",
|
|
109
|
-
"mergePrompts.desc": "Heading prepended to the merged prompt opened with
|
|
133
|
+
"mergePrompts.desc": "Heading prepended to the merged prompt opened with ⌘⇧/ (questions) and ⌘⇧. (change requests). Leave blank to use the default.",
|
|
110
134
|
"mergePrompts.qHeading": "Questions heading",
|
|
111
135
|
"mergePrompts.cHeading": "Change-requests heading",
|
|
112
136
|
"mergePrompts.reset": "Reset to defaults",
|
|
@@ -116,7 +140,7 @@ export const MESSAGES = {
|
|
|
116
140
|
"composer.changeRequest": "Request a change for this line",
|
|
117
141
|
"composer.save": "Comment",
|
|
118
142
|
"composer.cancel": "Cancel",
|
|
119
|
-
"composer.hint": "
|
|
143
|
+
"composer.hint": "⌘Enter to save, Esc to cancel",
|
|
120
144
|
"composer.delete": "Delete",
|
|
121
145
|
"comment.kind.q": "❓ Question",
|
|
122
146
|
"comment.kind.c": "✎ Change request",
|
|
@@ -146,17 +170,25 @@ export const MESSAGES = {
|
|
|
146
170
|
// Tabs (sidebar)
|
|
147
171
|
"tab.changes": "변경사항",
|
|
148
172
|
"tab.files": "파일",
|
|
173
|
+
"rail.questions": "질문",
|
|
174
|
+
"rail.changeRequests": "변경 요청",
|
|
175
|
+
"rail.branch": "현재 브랜치",
|
|
176
|
+
"tab.changes.title": "변경사항 (⌘0)",
|
|
177
|
+
"tab.files.title": "파일 (⌘1)",
|
|
149
178
|
// Sidebar footer / About
|
|
150
179
|
"sidebar.updateAvailable": "업데이트 있음",
|
|
151
180
|
"about.title": "monacori 정보",
|
|
181
|
+
"about.tip": "설정 (⌘,)",
|
|
152
182
|
"terminal.title": "터미널",
|
|
153
|
-
"terminal.toggle": "터미널 토글 (
|
|
183
|
+
"terminal.toggle": "터미널 토글 (⌃`)",
|
|
154
184
|
"terminal.close": "터미널 닫기",
|
|
185
|
+
"dock.maximize": "패널 최대화 (⌘⇧')",
|
|
186
|
+
"dock.restore": "패널 복원 (⌘⇧')",
|
|
155
187
|
// Review status (toolbar)
|
|
156
188
|
"status.files": "개 파일",
|
|
157
189
|
"status.hunks": "개 변경 묶음",
|
|
158
190
|
"status.wsIgnored": "공백 무시",
|
|
159
|
-
"status.wsIgnored.title": "공백 무시 —
|
|
191
|
+
"status.wsIgnored.title": "공백 무시 — ⌘⇧W",
|
|
160
192
|
"status.indexed": "개 인덱싱됨",
|
|
161
193
|
"status.index.title": "정의로 이동 인덱스",
|
|
162
194
|
"status.indexing": "인덱싱 중",
|
|
@@ -174,6 +206,7 @@ export const MESSAGES = {
|
|
|
174
206
|
"http.env.title": "HTTP 클라이언트 환경",
|
|
175
207
|
"http.env.aria": "HTTP 환경",
|
|
176
208
|
"btn.diff": "Diff",
|
|
209
|
+
"btn.diff.title": "Diff로 돌아가기 (F7)",
|
|
177
210
|
"source.loading": "소스 불러오는 중…",
|
|
178
211
|
"source.previewUnavailable": "소스 미리보기를 사용할 수 없습니다.",
|
|
179
212
|
"source.viewRaw": "원문",
|
|
@@ -185,6 +218,7 @@ export const MESSAGES = {
|
|
|
185
218
|
"quickopen.recent": "최근 파일",
|
|
186
219
|
"quickopen.findInFiles": "파일 내용 검색",
|
|
187
220
|
"quickopen.noFiles": "파일을 찾을 수 없습니다.",
|
|
221
|
+
"quickopen.typeToFilter": "입력하여 필터",
|
|
188
222
|
// Usages
|
|
189
223
|
"usages.aria": "사용처",
|
|
190
224
|
"usages.title": "사용처",
|
|
@@ -196,6 +230,8 @@ export const MESSAGES = {
|
|
|
196
230
|
// Settings — General
|
|
197
231
|
"settings.language": "언어",
|
|
198
232
|
"settings.theme": "테마",
|
|
233
|
+
"settings.bellNotify": "터미널 작업이 끝나면 알림 (벨)",
|
|
234
|
+
"notify.bellBody": "작업이 끝났거나 입력이 필요합니다",
|
|
199
235
|
"theme.dark": "다크",
|
|
200
236
|
"theme.light": "라이트",
|
|
201
237
|
"settings.checkingUpdates": "업데이트 확인 중…",
|
|
@@ -206,10 +242,21 @@ export const MESSAGES = {
|
|
|
206
242
|
"settings.updated": "업데이트 완료. 재시작 중…",
|
|
207
243
|
"settings.updateFailed": "업데이트 실패 — 다시 시도하거나 실행하세요: npm i -g @happy-nut/monacori",
|
|
208
244
|
"settings.kbd.title": "키보드 단축키",
|
|
245
|
+
"settings.kbd.cat.app": "앱",
|
|
209
246
|
"settings.kbd.cat.nav": "탐색",
|
|
210
247
|
"settings.kbd.cat.review": "리뷰",
|
|
211
248
|
"settings.kbd.cat.terminal": "터미널",
|
|
212
249
|
// Settings — keyboard-shortcut labels
|
|
250
|
+
"kbd.openFolder": "폴더 열기",
|
|
251
|
+
"kbd.openNewWindow": "새 창에서 열기",
|
|
252
|
+
"kbd.openSettings": "설정",
|
|
253
|
+
"kbd.closeDialog": "대화상자 닫기 / 취소",
|
|
254
|
+
"kbd.pageUpDown": "페이지 위 / 아래",
|
|
255
|
+
"kbd.runHttp": "HTTP 요청 실행 (.http)",
|
|
256
|
+
"kbd.editComment": "코멘트 편집 (선택 시)",
|
|
257
|
+
"kbd.deleteComment": "코멘트 삭제 (선택 시)",
|
|
258
|
+
"kbd.stepComments": "코멘트 단위 이동 (합본)",
|
|
259
|
+
"kbd.mergedSend": "코멘트 메뉴 / 패널로 전송 (합본)",
|
|
213
260
|
"kbd.nextChange": "다음 변경",
|
|
214
261
|
"kbd.prevChange": "이전 변경",
|
|
215
262
|
"kbd.closeTab": "탭 닫기",
|
|
@@ -231,6 +278,7 @@ export const MESSAGES = {
|
|
|
231
278
|
"kbd.ignoreWhitespace": "공백 무시",
|
|
232
279
|
"kbd.saveComment": "코멘트 저장",
|
|
233
280
|
"kbd.promptMemo": "프롬프트 메모",
|
|
281
|
+
"kbd.maximizePanel": "패널 최대화 (터미널 / 합본 / 메모)",
|
|
234
282
|
"kbd.toggleTerminal": "터미널 토글",
|
|
235
283
|
"kbd.splitPane": "패널 분할",
|
|
236
284
|
"kbd.focusPane": "이전 / 다음 패널로 이동",
|
|
@@ -238,7 +286,7 @@ export const MESSAGES = {
|
|
|
238
286
|
"kbd.closeTerminal": "터미널 닫기 (포커스 시)",
|
|
239
287
|
// Settings — Merge prompts
|
|
240
288
|
"mergePrompts.title": "병합 프롬프트",
|
|
241
|
-
"mergePrompts.desc": "
|
|
289
|
+
"mergePrompts.desc": "⌘⇧/ (질문) 및 ⌘⇧. (변경요청)로 여는 병합 프롬프트 맨 앞에 붙는 머리말입니다. 비워 두면 기본값을 사용합니다.",
|
|
242
290
|
"mergePrompts.qHeading": "질문 머리말",
|
|
243
291
|
"mergePrompts.cHeading": "변경요청 머리말",
|
|
244
292
|
"mergePrompts.reset": "기본값으로 초기화",
|
|
@@ -248,7 +296,7 @@ export const MESSAGES = {
|
|
|
248
296
|
"composer.changeRequest": "이 줄에 대한 변경 요청하기",
|
|
249
297
|
"composer.save": "코멘트",
|
|
250
298
|
"composer.cancel": "취소",
|
|
251
|
-
"composer.hint": "
|
|
299
|
+
"composer.hint": "⌘Enter로 저장, Esc로 취소",
|
|
252
300
|
"composer.delete": "삭제",
|
|
253
301
|
"comment.kind.q": "❓ 질문",
|
|
254
302
|
"comment.kind.c": "✎ 변경 요청",
|
package/dist/preload.cjs
CHANGED
|
@@ -52,6 +52,13 @@ electron_1.contextBridge.exposeInMainWorld("monacoriFile", {
|
|
|
52
52
|
electron_1.contextBridge.exposeInMainWorld("monacoriUpdate", {
|
|
53
53
|
run: () => electron_1.ipcRenderer.invoke("monacori:self-update"),
|
|
54
54
|
});
|
|
55
|
+
// Packaged .app (double-clicked, no cwd repo): the welcome screen's "Open Folder" button asks the main
|
|
56
|
+
// process to show a directory picker and load that git repo's review.
|
|
57
|
+
electron_1.contextBridge.exposeInMainWorld("monacoriApp", {
|
|
58
|
+
openFolder: () => electron_1.ipcRenderer.invoke("monacori:open-folder"),
|
|
59
|
+
// Welcome screen's Recent Projects: open a remembered repo path in the current window.
|
|
60
|
+
openRecent: (path) => electron_1.ipcRenderer.invoke("monacori:open-recent", { path }),
|
|
61
|
+
});
|
|
55
62
|
// Integrated terminal: bridge the renderer's xterm view to a node-pty owned by the main process (the
|
|
56
63
|
// sandboxed renderer can't spawn a pty). Only present in the Electron app; browser/serve mode lacks it,
|
|
57
64
|
// so the renderer keeps the terminal panel hidden there.
|
|
@@ -60,6 +67,9 @@ electron_1.contextBridge.exposeInMainWorld("monacoriPty", {
|
|
|
60
67
|
write: (msg) => electron_1.ipcRenderer.send("monacori:pty-write", msg),
|
|
61
68
|
resize: (msg) => electron_1.ipcRenderer.send("monacori:pty-resize", msg),
|
|
62
69
|
kill: (msg) => electron_1.ipcRenderer.send("monacori:pty-kill", msg),
|
|
70
|
+
// A TUI in the pane rang the terminal bell (e.g. Claude Code finished a turn / needs input). The renderer
|
|
71
|
+
// passes a pre-localized title+body; the main process decides whether to raise a native notification.
|
|
72
|
+
bell: (msg) => electron_1.ipcRenderer.send("monacori:bell", msg),
|
|
63
73
|
onData: (cb) => {
|
|
64
74
|
electron_1.ipcRenderer.on("monacori:pty-data", (_event, msg) => cb(msg));
|
|
65
75
|
},
|
|
@@ -67,6 +77,11 @@ electron_1.contextBridge.exposeInMainWorld("monacoriPty", {
|
|
|
67
77
|
electron_1.ipcRenderer.on("monacori:pty-exit", (_event, msg) => cb(msg));
|
|
68
78
|
},
|
|
69
79
|
});
|
|
80
|
+
// Clipboard bridge — the integrated terminal copies its own selection on Cmd+C (xterm doesn't auto-copy, and
|
|
81
|
+
// the sandboxed renderer's navigator.clipboard is unreliable on file://). Electron's clipboard always works here.
|
|
82
|
+
electron_1.contextBridge.exposeInMainWorld("monacoriClipboard", {
|
|
83
|
+
write: (text) => electron_1.clipboard.writeText(typeof text === "string" ? text : String(text)),
|
|
84
|
+
});
|
|
70
85
|
// Global settings (locale, …) persisted by the main process under userData so they survive app
|
|
71
86
|
// restarts — the renderer's file:// localStorage is not reliably persisted across reopens. `all` is
|
|
72
87
|
// read synchronously at preload so the renderer can pick the locale before first paint; `set` writes
|
package/dist/render.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { DiffFile, ReviewFileState, SourceFile } from "./types.js";
|
|
2
2
|
export declare function renderNotGitRepoHtml(root: string): string;
|
|
3
|
+
export declare function renderWelcomeHtml(light?: boolean, recent?: {
|
|
4
|
+
path: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}[]): string;
|
|
3
7
|
export declare function shouldLazyRender(fileCount: number, totalLines: number): boolean;
|
|
4
8
|
export declare function splitDiffForLazy(diffHtml: string, files: DiffFile[]): {
|
|
5
9
|
container: string;
|
|
@@ -28,6 +32,7 @@ export declare function renderDiffHtml(input: {
|
|
|
28
32
|
subtitle: string;
|
|
29
33
|
projectName: string;
|
|
30
34
|
projectPath: string;
|
|
35
|
+
branch?: string;
|
|
31
36
|
watch?: boolean;
|
|
32
37
|
ignoreWhitespace?: boolean;
|
|
33
38
|
app?: boolean;
|