Skip to content

Commit 0fc9dfc

Browse files
authored
Merge branch 'main' into bug/4387-fix-integration-status
2 parents b1c0c73 + 59241cf commit 0fc9dfc

File tree

136 files changed

+4953
-2398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4953
-2398
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
blank_issues_enabled: false
1+
blank_issues_enabled: true
22
contact_links:
33
- name: Q & A
44
url: https://github.com/gitkraken/vscode-gitlens/discussions?discussions_q=category%3AQ%26A

.github/copilot-instructions.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# GitLens Copilot Instructions
2+
3+
This workspace contains **GitLens** - a VS Code extension that supercharges Git functionality. Below are key development guidelines and architecture insights.
4+
5+
## Core Commands
6+
7+
### Build & Development
8+
9+
- `pnpm run build` - Full development build
10+
- `pnpm run build:quick` - Fast build without linting
11+
- `pnpm run watch` - Watch mode for development
12+
- `pnpm run watch:quick` - Fast watch mode without linting
13+
- `pnpm run bundle` - Production bundle
14+
15+
### Testing & Quality
16+
17+
- `pnpm run test` - Run unit tests with vscode-test
18+
- `pnpm run test:e2e` - End-to-end tests with Playwright
19+
- `pnpm run lint` - ESLint with TypeScript rules
20+
- `pnpm run lint:fix` - Auto-fix linting issues
21+
- `pnpm run pretty` - Format with Prettier
22+
23+
### Specialized Commands
24+
25+
- `pnpm run build:tests` - Build test files with esbuild
26+
- `pnpm run generate:contributions` - Generate package.json contributions from contributions.json
27+
- `pnpm run generate:commandTypes` - Generate command types from contributions
28+
- `pnpm run web` - Run extension in web environment for testing
29+
30+
## High-Level Architecture
31+
32+
### Core Container System
33+
34+
- **Container** (`src/container.ts`) - Main dependency injection container, singleton pattern
35+
- All services registered in constructor and exposed as getters
36+
- Handles lifecycle, configuration changes, and service coordination
37+
38+
### Major Services & Providers
39+
40+
- **GitProviderService** - Core Git operations and repository management
41+
- **SubscriptionService** - GitLens Pro subscription and account management
42+
- **IntegrationService** - GitHub/GitLab/etc integrations
43+
- **AIProviderService** - AI features (commit messages, explanations)
44+
- **WebviewsController** - Manages all webview panels (Graph, Home, etc)
45+
- **AutolinksProvider** - Auto-linking issues/PRs in commit messages
46+
- **TelemetryService** - Usage analytics and error reporting
47+
48+
### VS Code Contributions
49+
50+
- Commands, Menus, Submenus, Keybindings, and Views are defined in `contributions.json`
51+
- Contributions are generated from `contributions.json` into `package.json` via `pnpm run generate:contributions`
52+
- Contributions can also be extracted from `package.json` into `contributions.json` via `pnpm run extract:contributions`
53+
54+
### Webview Architecture
55+
56+
- **Shared Components** (`src/webviews/apps/shared/`) - Common UI components using Lit
57+
- **Host-Guest Communication** - IPC between extension and webviews
58+
- **State Management** - Context providers with Lit reactive patterns
59+
- Major webviews: Home, Commit Graph, Timeline, Launchpad, Settings
60+
61+
### Git Integration
62+
63+
- **GitProviderService** - Abstracts Git operations across different providers
64+
- **Repository Models** - Strongly typed Git entities (Branch, Commit, Tag, etc)
65+
- **DocumentTracker** - Tracks file changes and editor state
66+
- **FileAnnotationController** - Blame, heatmap, and change annotations
67+
68+
### Plus Features (Pro)
69+
70+
- **Subscription gating** - Feature access control via SubscriptionService
71+
- **Cloud integrations** - GitHub/GitLab APIs for PRs, issues
72+
- **Worktrees** - Multi-branch workflow support
73+
- **AI features** - Commit generation, explanations using various providers
74+
75+
## Coding Standards & Style Rules
76+
77+
### TypeScript Configuration
78+
79+
- Strict TypeScript with `strictTypeChecked` ESLint config
80+
- No `any` usage (exceptions for external APIs)
81+
- Explicit return types for public methods
82+
- Prefer `type` over `interface` for unions
83+
84+
### Import Organization
85+
86+
- Use path aliases: `@env/` for environment-specific code
87+
- Import order: node built-ins → external → internal → relative
88+
- No default exports (ESLint enforced)
89+
- Consistent type imports with `import type`
90+
91+
### Naming Conventions
92+
93+
- **Classes**: PascalCase (no `I` prefix for interfaces)
94+
- **Methods/Variables**: camelCase
95+
- **Constants**: camelCase for module-level constants
96+
- **Private members**: Leading underscore allowed
97+
- **Files**: camelCase.ts, camelCase.utils.ts for related utilities
98+
- **Folders**
99+
- Models under a `models/` sub-folder
100+
- Utilities under a `utils/` sub-folder if they can be used in both the extension host and webviews, or `utils/-webview/` sub-folder for extension host-specific utilities
101+
- Webview apps under `webviews/apps/`
102+
103+
### Code Structure
104+
105+
- **Single responsibility** - Each service has focused purpose
106+
- **Dependency injection** - Services injected via Container
107+
- **Event-driven** - EventEmitter pattern for service communication
108+
- **Disposable pattern** - Proper cleanup with VS Code Disposable interface
109+
110+
### Error Handling
111+
112+
- Use custom error types extending Error
113+
- Log errors with context using Logger.error()
114+
- Graceful degradation for network/API failures
115+
- Validate external data with schema validators
116+
117+
### Webview Specific
118+
119+
- **Lit Elements** - Use for reactive UI components
120+
- **Context providers** - For sharing state across components
121+
- **Signal patterns** - For reactive state management
122+
- **CSS custom properties** - For theming support
123+
124+
### Environment Abstractions
125+
126+
- **Platform detection** - Use `@env/platform` abstractions
127+
- **Node vs Browser** - Environment-specific implementations in `src/env/`
128+
- **WebWorker support** - Browser extension compatibility
129+
130+
## Repository Guidelines
131+
132+
### Commit Messages
133+
134+
- Use a future-oriented manner, third-person singular present tense (e.g., 'Fixes', 'Updates', 'Improves', 'Adds', 'Removes')
135+
- Reference issues with `#123` syntax for auto-linking
136+
- Keep first line under 72 characters
137+
138+
### Branch Workflow
139+
140+
- Feature branches from `main`
141+
- Prefix with feature type: `feature/`, `bug/`, `debt/`
142+
- Use descriptive names: `feature/search-natural-language`
143+
144+
### Code Reviews
145+
146+
- Check TypeScript compilation and tests pass
147+
- Verify no new ESLint violations
148+
- Test webview changes in both themes
149+
- Validate Plus features with subscription states
150+
151+
## Key Extension Points
152+
153+
### Adding New Commands
154+
155+
1. Define in `src/commands/` directory
156+
2. Register in `src/commands.ts`
157+
3. Add to `contributions.json` for package.json generation
158+
4. Update command types with `pnpm run generate:commandTypes`
159+
160+
### New Webviews
161+
162+
1. Create provider in `src/webviews/`
163+
2. Add Lit app in `src/webviews/apps/`
164+
3. Register in WebviewsController
165+
4. Add protocol definitions for IPC
166+
167+
### Git Provider Extensions
168+
169+
- Implement GitProvider interface
170+
- Register with GitProviderService
171+
- Handle provider-specific authentication
172+
173+
### AI Provider Integration
174+
175+
- Implement AIProvider interface
176+
- Add to AIProviderService registry
177+
- Handle authentication and rate limiting
178+
179+
## Development Environment
180+
181+
### Prerequisites
182+
183+
- **Node.js** ≥ 22.12.0
184+
- **pnpm** ≥ 10.x (via corepack)
185+
- **Git** ≥ 2.7.2
186+
187+
### VS Code Tasks
188+
189+
- **Build** - `Ctrl+Shift+P` → "Tasks: Run Task" → "watch"
190+
- **Test** - Use VS Code's built-in test runner
191+
- **Debug** - F5 to launch Extension Development Host
192+
193+
### Multi-target Support
194+
195+
- **Node.js** - Traditional VS Code extension
196+
- **Web Worker** - Browser/web VS Code compatibility
197+
- Shared code with environment abstractions
198+
199+
This architecture enables GitLens to provide powerful Git tooling while maintaining clean separation of concerns and extensibility for new features.

CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,36 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
66

77
## [Unreleased]
88

9+
## [17.3.0] - 2025-07-08
10+
11+
### Added
12+
13+
- Adds support for using natural language to search for commits on the _Commit Graph_, _Search & Compare_ view, and in the _Search Commits_ command using AI ([#4471](https://github.com/gitkraken/vscode-gitlens/issues/4471))
14+
- Adds support for time-based commit searches on the _Commit Graph_, _Search & Compare_ view, and in the _Search Commits_ command
15+
- Adds 👍 "Helpful" and 👎 "Unhelpful" feedback buttons to AI-generated markdown previews such as Commit Composer and Explain Changes ([#4449](https://github.com/gitkraken/vscode-gitlens/issues/4449))
16+
- Adds a _Commit with AI (Preview)_ button to the _Inspect Overview_ tab of the _Commit Graph_ and _Inspect_ views
17+
18+
### Changed
19+
20+
- Improves experience for invalid AI rebase responses by implementing conversational retry logic that provides specific feedback to the AI about missing, extra, or duplicate hunks and automatically retries up to 3 times ([#4395](https://github.com/gitkraken/vscode-gitlens/issues/4395))
21+
22+
### Fixed
23+
24+
- Fixes stashes with parent commits older than the oldest stash not being visible on branches ([#4401](https://github.com/gitkraken/vscode-gitlens/issues/4401))
25+
- Fixes editing search result in Search & Compare view failure ([#4431](https://github.com/gitkraken/vscode-gitlens/issues/4431))
26+
- Fixes search results not paging properly on the _Commit Graph_ when the first page of results is contained within the already loaded commits
27+
28+
## [17.2.1] - 2025-06-26
29+
930
### Changed
1031

1132
- Improves AI status label in integrations popup to "Select AI model to enable AI features" and fixes text brightness ([#4400](https://github.com/gitkraken/vscode-gitlens/issues/4400))
1233

1334
### Fixed
1435

1536
- Fixes disabled GitLens view tabs on clean install ([#4416](https://github.com/gitkraken/vscode-gitlens/issues/4416))
37+
- Fixes Stashes view errors w/ ID already exists ([#4427](https://github.com/gitkraken/vscode-gitlens/issues/4427))
38+
- Fixes showing GitLens view tabs when the view is hidden ([#4426](https://github.com/gitkraken/vscode-gitlens/issues/4426), [#4389](https://github.com/gitkraken/vscode-gitlens/issues/4389))
1639

1740
## [17.2.0] - 2025-06-17
1841

@@ -6211,7 +6234,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
62116234

62126235
- Initial release but still heavily a work in progress.
62136236

6214-
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/v17.2.0...HEAD
6237+
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/v17.3.0...HEAD
6238+
[17.3.0]: https://github.com/gitkraken/vscode-gitlens/compare/v17.2.1...gitkraken:v17.3.0
6239+
[17.2.1]: https://github.com/gitkraken/vscode-gitlens/compare/v17.2.0...gitkraken:v17.2.1
62156240
[17.2.0]: https://github.com/gitkraken/vscode-gitlens/compare/v17.1.1...gitkraken:v17.2.0
62166241
[17.1.1]: https://github.com/gitkraken/vscode-gitlens/compare/v17.1.0...gitkraken:v17.1.1
62176242
[17.1.0]: https://github.com/gitkraken/vscode-gitlens/compare/v17.0.3...gitkraken:v17.1.0

ThirdPartyNotices.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ This project incorporates components from the projects listed below.
1313
8. @octokit/request version 10.0.3 (https://github.com/octokit/request.js)
1414
9. @octokit/types version 14.1.0 (https://github.com/octokit/types.ts)
1515
10. @opentelemetry/api version 1.9.0 (https://github.com/open-telemetry/opentelemetry-js)
16-
11. @opentelemetry/exporter-trace-otlp-http version 0.202.0 (https://github.com/open-telemetry/opentelemetry-js)
16+
11. @opentelemetry/exporter-trace-otlp-http version 0.203.0 (https://github.com/open-telemetry/opentelemetry-js)
1717
12. @opentelemetry/resources version 2.0.1 (https://github.com/open-telemetry/opentelemetry-js)
1818
13. @opentelemetry/sdk-trace-base version 2.0.1 (https://github.com/open-telemetry/opentelemetry-js)
1919
14. @opentelemetry/semantic-conventions version 1.34.0 (https://github.com/open-telemetry/opentelemetry-js)
2020
15. @shoelace-style/shoelace version 2.20.1 (https://github.com/shoelace-style/shoelace)
2121
16. @vscode/codicons version 0.0.36 (https://github.com/microsoft/vscode-codicons)
22-
17. billboard.js version 3.15.1 (https://github.com/naver/billboard.js)
22+
17. billboard.js version 3.16.0 (https://github.com/naver/billboard.js)
2323
18. https-proxy-agent version 5.0.1 (https://github.com/TooTallNate/node-https-proxy-agent)
2424
19. iconv-lite version 0.6.3 (https://github.com/ashtuchkin/iconv-lite)
2525
20. lit version 3.3.0 (https://github.com/lit/lit)
26-
21. marked version 15.0.12 (https://github.com/markedjs/marked)
26+
21. marked version 16.0.0 (https://github.com/markedjs/marked)
2727
22. microsoft/vscode (https://github.com/microsoft/vscode)
2828
23. node-fetch version 2.7.0 (https://github.com/bitinn/node-fetch)
2929
24. os-browserify version 0.3.0 (https://github.com/CoderPuppy/os-browserify)

contributions.json

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,58 @@
143143
]
144144
}
145145
},
146+
"gitlens.ai.feedback.helpful": {
147+
"label": "Helpful",
148+
"icon": "$(thumbsup)",
149+
"menus": {
150+
"editor/title": [
151+
{
152+
"when": "resourceScheme == gitlens-ai-markdown && resource not in gitlens:tabs:ai:helpful && config.gitlens.telemetry.enabled && config.telemetry.telemetryLevel != off && activeCustomEditorId == vscode.markdown.preview.editor",
153+
"group": "navigation",
154+
"order": 1
155+
}
156+
]
157+
}
158+
},
159+
"gitlens.ai.feedback.helpful.chosen": {
160+
"label": "Helpful",
161+
"icon": "$(thumbsup-filled)",
162+
"menus": {
163+
"editor/title": [
164+
{
165+
"when": "resourceScheme == gitlens-ai-markdown && resource in gitlens:tabs:ai:helpful && config.gitlens.telemetry.enabled && config.telemetry.telemetryLevel != off && activeCustomEditorId == vscode.markdown.preview.editor",
166+
"group": "navigation",
167+
"order": 1
168+
}
169+
]
170+
}
171+
},
172+
"gitlens.ai.feedback.unhelpful": {
173+
"label": "Unhelpful",
174+
"icon": "$(thumbsdown)",
175+
"menus": {
176+
"editor/title": [
177+
{
178+
"when": "resourceScheme == gitlens-ai-markdown && resource not in gitlens:tabs:ai:unhelpful && config.gitlens.telemetry.enabled && config.telemetry.telemetryLevel != off && activeCustomEditorId == vscode.markdown.preview.editor",
179+
"group": "navigation",
180+
"order": 2
181+
}
182+
]
183+
}
184+
},
185+
"gitlens.ai.feedback.unhelpful.chosen": {
186+
"label": "Unhelpful",
187+
"icon": "$(thumbsdown-filled)",
188+
"menus": {
189+
"editor/title": [
190+
{
191+
"when": "resourceScheme == gitlens-ai-markdown && resource in gitlens:tabs:ai:unhelpful && config.gitlens.telemetry.enabled && config.telemetry.telemetryLevel != off && activeCustomEditorId == vscode.markdown.preview.editor",
192+
"group": "navigation",
193+
"order": 2
194+
}
195+
]
196+
}
197+
},
146198
"gitlens.ai.generateChangelog": {
147199
"label": "Generate Changelog (Preview)...",
148200
"commandPalette": "gitlens:enabled && !gitlens:untrusted && gitlens:gk:organization:ai:enabled"
@@ -3682,14 +3734,14 @@
36823734
"menus": {
36833735
"editor/title": [
36843736
{
3685-
"when": "resourceScheme == gitlens-markdown && activeCustomEditorId == vscode.markdown.preview.editor",
3737+
"when": "resourceScheme == gitlens-ai-markdown && activeCustomEditorId == vscode.markdown.preview.editor && resourcePath =~ /^\\/explain\\//",
36863738
"group": "navigation",
3687-
"order": 0
3739+
"order": 3
36883740
}
36893741
],
36903742
"editor/title/context": [
36913743
{
3692-
"when": "resourceScheme == gitlens-markdown && activeCustomEditorId == vscode.markdown.preview.editor",
3744+
"when": "resourceScheme == gitlens-ai-markdown && activeCustomEditorId == vscode.markdown.preview.editor && resourcePath =~ /^\\/explain\\//",
36933745
"group": "1_gitlens",
36943746
"order": 0
36953747
}

0 commit comments

Comments
 (0)