Repository navigation
Conversation
…n in web and desktop
…e selection restore
- Add 8 unit tests covering: identical branches, add, modify, remove, rename, WORKDIR sentinel, invalid branch, and binary file detection - Add create_test_repo() helper using tempfile for isolated temp repos - Add tempfile dev-dependency to Cargo.toml - Fix pre-existing clippy warnings (contains, needless_return, useless_format) - Apply cargo fmt to git.rs and lib.rs
Add 9 tests covering: text file content verification, missing file (notFound), binary detection via null bytes, WORKDIR filesystem reads, WORKDIR missing file, non-UTF8 lossy conversion (git blob and workdir), bad ref error handling, and WORKDIR binary detection.
…es_with_oids, and resolve_ref Add 11 tests covering: - list_files: committed files, nested paths, empty tree, WORKDIR, gitignore - list_files_with_oids: valid OID strings, multiple files with unique OIDs - resolve_ref: valid branch, invalid ref error, HEAD resolution
Extract classify_path pure function and EventKind enum from the watcher callback for testability. Add 17 unit tests covering: node_modules filtering, .git/objects and .git/logs ignored, target/ directory ignored, regular source files emit workdir-changed, .git/refs and .git/HEAD emit refs-changed, edge cases (paths outside repo, .git internals).
Mock @tauri-apps/api/core invoke to verify all GitService interface methods call the correct Tauri commands with proper argument shapes. Covers loadRepo, listBranches, getDiff, readFile, listFiles, listFilesWithOids, resolveRef, dispose, error propagation, and instance reuse patterns (18 tests).
12 renderHook tests covering initial state, load success/error state transitions, refresh with preserved selection, reset, localStorage branch persistence, workdir-changed event handling with debounce, branch flipping, and edge cases like single-branch repos.
Expand useFileTree.test.ts from 3 to 22 tests covering tree building, status markers, binary detection, filtering, selection, large repo mode, race condition prevention, expand/collapse, and revealPath.
- 10 tests covering token count updates, binary file handling (both includeBinaryPaths modes), progress callback, cancellation/abort, empty selection, context lines effect, total summation, runtime binary detection, and null gitClient - Mock tiktoken with deterministic word-count tokenizer - Verify cancellation prevents stale state updates after unmount
25 tests covering createUnifiedDiffForPath and buildUnifiedDiffForStatus: - Modified/added/removed file diff generation - Unchanged file handling (identical content, empty string) - CRLF normalization producing stable diffs - Context lines control (0, 3, 999/full file) - Empty file and no-trailing-newline edge cases - Binary file inputs returning null - notFound file side handling
Expand workspaceStore.test.ts from 4 to 16 tests covering: - upsertWorkspace updates existing rather than creating duplicates - upsertWorkspace by path match prevents duplicates - removeWorkspace with non-existent ID is a no-op - removeWorkspace clears activeWorkspaceId for active workspace - getWorkspaceSelectionRestore is case-sensitive - MAX_PERSISTED_SELECTIONS (5000) limit enforcement - listWorkspaceItems sorted by lastOpenedAt descending - setActiveWorkspace/getWorkspaceById round-trips - corrupt localStorage data graceful degradation - session settings merge with defaults (missing keys filled) - findWorkspaceByPath matches exact paths only - save/load round-trip preserves all session data
Tests mapWithConcurrency: concurrency limit enforcement via in-flight tracking, result ordering preservation, error propagation, empty input, sequential processing (limit=1), limit exceeding array length, and AbortSignal cancellation. Tests createConcurrencyLimiter: concurrent execution limiting, result ordering, and error propagation.
- Test single invocation after burst of calls within delay - Test final call's arguments are used - Test timer reset on rapid calls - Test full delay expiration triggers function - Test returned function is callable multiple times independently - Test multiple arguments passed correctly - Uses vi.useFakeTimers for deterministic timing control
- Test provider makes token counts available to children via useContext - Test counts update when selectedPaths change - Test busy flag reflects computation state - Test progress reports completed/total/percent correctly via onBatch - Test total is sum of all individual file counts - Test unmount during async counting causes no state-update warnings - Test progress percent edge cases (zero total, overflow) - Test useTokenCountsContext throws outside provider - Test props are passed correctly to useTokenCounts hook
Extract inline theme management logic from App.tsx into a reusable useTheme hook and add 10 tests covering: system default (light/dark), toggle behavior, localStorage persistence, system fallback, DOM data-theme attribute, corrupt localStorage handling, system preference change tracking, and cleanup on unmount.
Extract output-building logic from App.tsx into testable copyOutput.ts utility functions (generateFileTreeText, buildHeader, buildFileSection, buildCopyOutput). Add 26 tests covering header format, instructions section, file tree toggle, modify/add/remove diffs, binary handling, context lines, and end-to-end output structure.
- Test getModels returns array of ModelInfo objects from API - Verify required fields (id, name, context_length) on each model - Validate model IDs are unique and context_length values are positive - Test localStorage caching (fresh cache hit, stale cache refetch) - Test model selection persistence via gc.selectedModel key - Verify invalid saved model ID handled gracefully (defaults to 0) - Verify ModelInfo type compliance with optional fields
Add 13 integration-level tests verifying error propagation, auto-clear, dismiss, and recovery flows that mirror the App's error management pattern: - Unhandled promise rejection displays in banner (Error and non-Error) - Window.error event displays in banner (with/without error object) - Auto-clear on successful repo load - Multiple rapid errors show only latest - Repo load and diff compute errors propagate to banner - Dismiss clears error without reappearing - Full recovery flow: error → user action → success - Re-render and null transition behavior - Global listener cleanup on unmount
Add comprehensive integration tests covering the full workspace lifecycle in apps/desktop/src/__tests__/workspaceLifecycle.test.ts. Tests verify: save captures branches/selection, restore triggers diff, auto-detection by path, refresh preserves selection, delete clears store, missing branch fallback, debounced session auto-persist, and race condition handling when switching workspaces.
Cover logError with Error objects, strings, non-Error/non-string values, error code prefix formatting, and errorLog cap at 100 entries.
Expand DiffControlBar.test.tsx from 19 to 32 tests covering: - Delete button disabled/enabled based on workspace selection - Save button disabled when no workspace path - Unsaved workspace label variants (with/without path) - Workspace option display format (name - folderName) - Fallback text for unknown workspace IDs - Workspace selector title attribute - WORKDIR display in base branch selector - All controls enabled/disabled state comprehensively - Disabled prop overrides individual button conditions
…nt restart loop The custom domain gitcontext.xyz is gone, so production builds use the /gitcontext/ base and the CNAME is removed. A Playwright smoke test checks the built site under that path. TokenCountsProvider passed a new onBatch on every render; it is a dependency of the counting effect, so each progress update restarted counting and flooded the git worker (production builds never finished counting). Claude-Session: https://claude.ai/code/session_01Yb4sbCDrvzqV8fFpnCrQK5
git2's default https/ssh features pulled in openssl-sys and libssh2-sys, and the released binary loaded /opt/homebrew/opt/openssl@3 at launch, so it failed on Macs without that Homebrew package. The app only reads local repositories, so the network features are off. Minimum macOS is 10.15, the floor Tauri 2 supports. Claude-Session: https://claude.ai/code/session_01Yb4sbCDrvzqV8fFpnCrQK5
- Pages deploys in its own workflow on every push to main, after unit tests and a smoke test of the build under /gitcontext/, so a release failure can no longer take the site down. - Releases: semantic-release creates the tag and a draft release first; the desktop builds are stamped with that version (assets were named 1.0.0 before), uploaded, and the draft is published only when every platform succeeded. - macOS: universal build signed with the Developer ID identity from the release environment, app and DMG notarized and stapled, checked for team, Gatekeeper, architectures and non-system libraries. - Homebrew: the full cask is rendered from packaging/homebrew and pushed to kccarlos/homebrew-tap after a release. - workflow_dispatch builds and signs without releasing. Claude-Session: https://claude.ai/code/session_01Yb4sbCDrvzqV8fFpnCrQK5
…r playwright install Claude-Session: https://claude.ai/code/session_01Yb4sbCDrvzqV8fFpnCrQK5
dev -> main PRs were rebase-merged, so main carries copies of dev's commits with new hashes plus the 2.3.0 release commit, and a dev -> main merge conflicted. main's tree before the release commit equals dev at adb55c2, so this keeps dev's content and takes main's CHANGELOG.md. Claude-Session: https://claude.ai/code/session_01Yb4sbCDrvzqV8fFpnCrQK5
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8e1d9e117
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const effectiveBaseRef = basePinnedCommit ?? baseBranch | ||
| const effectiveCompareRef = comparePinnedCommit ?? compareBranch |
There was a problem hiding this comment.
Clear pinned commits when loading another repository
When a user pins either side and then opens another repository through Change Repository or the workspace selector, loadRepoFromHandle replaces the branches but never clears the pinned OIDs. These effective refs therefore continue to point at commits from the previous repository, causing the new repository's diff and file reads to fail with an unresolved-ref error until the user explicitly selects Latest or changes each affected branch.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in version 2.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Releases v2.4.0 (feat: compare by commit) with the CI from #21.
Merge with "Create a merge commit", not rebase or squash. A rebase merge re-creates dev's commits on main with new hashes, which made dev and main diverge and conflict (reconciled in a8e1d9e).
https://claude.ai/code/session_01Yb4sbCDrvzqV8fFpnCrQK5