You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ npm run package # vsce package
36
36
37
37
### Communication Flow
38
38
39
-
Extension and webview communicate exclusively via `postMessage()`. All message types are defined in `src/utils/message-bus.ts` as TypeScript union types (`WebviewMessage` for webview→extension, `ExtensionMessage` for extension→webview).
39
+
Extension and webview communicate exclusively via `postMessage()`. All message types are defined in `src/utils/message-bus.ts` as TypeScript union types (`WebviewMessage` for webview→extension, `ExtensionMessage` for extension→webview). Types are intentionally duplicated in `webview-ui/src/lib/types.ts` (no shared code package).
40
40
41
41
### Extension Side (`src/`)
42
42
@@ -45,16 +45,16 @@ Extension and webview communicate exclusively via `postMessage()`. All message t
45
45
-**`git/git-service.ts`**: All git operations via `child_process.spawn`. 80+ methods. Maintains activity log (last 200 commands). Caches remote names for 30s.
46
46
-**`git/git-graph-builder.ts`**: Computes graph layout (paths, links, dots) from commit data for canvas rendering.
47
47
-**`git/git-parser.ts`**: Parses raw git log output into structured commit objects.
48
-
-**`services/file-watcher.ts`**: Watches `.git/HEAD`, `.git/refs/**`, `.git/index`. Debounces at 500ms with 1s cooldown.
48
+
-**`services/file-watcher.ts`**: Watches `.git/HEAD`, `.git/MERGE_HEAD`, `.git/REBASE_HEAD`, `.git/refs/**`, `.git/refs/stash`, `.git/index`, plus working tree (excluding `node_modules`, `.git`, `dist`, etc.). Debounces at 500ms with 1s cooldown.
49
49
-**`views/`**: Five `TreeDataProvider` implementations for Activity Bar sidebar (branches, remotes, tags, stashes, worktrees).
50
50
51
51
### Webview Side (`webview-ui/`)
52
52
53
53
-**Framework**: Svelte 5 with `$state`/`$derived` runes, built with Vite 6.
54
54
-**`App.svelte`**: Root component. Handles all extension messages, keyboard shortcuts, layout.
55
-
-**Stores** (`lib/stores/`): `commits.svelte.ts` (graph data), `branches.svelte.ts` (refs), `ui.svelte.ts` (selection, view mode, panel height). All use Svelte 5 class-based `$state`.
56
-
-**`components/graph/CommitGraph.svelte`**: Canvas-based commit graph with interactive selection and context menus.
57
-
-**`lib/i18n/`**: Custom store-based i18n. English (`en.ts`) and Korean (`ko.ts`). Git terms (commit, merge, rebase, push, pull, fetch, stash, tag, checkout, cherry-pick, revert, blame, reflog, bisect) stay untranslated in both languages.
55
+
-**`components/graph/CommitGraph.svelte`**: Canvas-based commit graph with interactive selection and context menus. Uses `shiki` for syntax-highlighted diffs.
56
+
-**`lib/i18n/`**: Custom class-based i18n using `$state`. English (`en.ts`) and Korean (`ko.ts`). `t()` supports parameter interpolation with `{paramName}` syntax. Git terms (commit, merge, rebase, push, pull, fetch, stash, tag, checkout, cherry-pick, revert, blame, reflog, bisect) stay untranslated in both languages.
57
+
-**`lib/stores/`**: All stores use Svelte 5 class-based `$state` pattern — `CommitStore` (graph data + lookup methods), `BranchStore` (refs with computed getters), `UIStore` (selection, view mode, repos), `ModalStore` (8 modal types with dynamic payloads).
58
58
59
59
### Build Tooling
60
60
@@ -78,4 +78,5 @@ Extension and webview communicate exclusively via `postMessage()`. All message t
78
78
-**MainPanel singleton**: One instance per workspace. Uses `pendingModal` pattern to queue modals triggered before the panel is created.
79
79
-**Activity log**: GitService logs every command (args, timestamp, success, duration) in a 200-entry ring buffer, viewable in the webview.
80
80
-**No linter/formatter config**: No eslint or prettier. `npm run lint` runs `tsc --noEmit` only. Webview type checking: `cd webview-ui && npm run check` (runs `svelte-check`).
81
-
-**Tests**: Only parser and graph builder have unit tests (`src/git/__tests__/`). Run with vitest.
81
+
-**Tests**: Only parser and graph builder have unit tests (`src/git/__tests__/`). Run with vitest. Tests use `makeCommit()` helper to create test data. Parser tests cover `parseLog`, `parseRefs`, `parseBranches`, `parseTags`, `parseRemotes`, `parseStashList`, `parseDiff`.
0 commit comments