Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions contributions.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,19 @@
]
}
},
"gitlens.composer.maximize": {
"label": "Maximize",
"icon": "$(screen-full)",
"menus": {
"editor/title": [
{
"when": "activeWebviewPanelId === gitlens.composer",
"group": "navigation",
"order": -98
}
]
}
},
"gitlens.composer.refresh": {
"label": "Refresh",
"icon": "$(refresh)",
Expand Down
66 changes: 40 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6511,6 +6511,11 @@
"title": "Compose Commits (Preview)...",
"icon": "$(sparkle)"
},
{
"command": "gitlens.composer.maximize",
"title": "Maximize",
"icon": "$(screen-full)"
},
{
"command": "gitlens.composer.refresh",
"title": "Refresh",
Expand Down Expand Up @@ -11752,6 +11757,10 @@
"command": "gitlens.composeCommits:views",
"when": "false"
},
{
"command": "gitlens.composer.maximize",
"when": "false"
},
{
"command": "gitlens.composer.refresh",
"when": "false"
Expand Down Expand Up @@ -15488,25 +15497,20 @@
"when": "activeWebviewPanelId === gitlens.composer",
"group": "navigation@-99"
},
{
"command": "gitlens.graph.refresh",
"when": "activeWebviewPanelId === gitlens.graph",
"group": "navigation@-99"
},
{
"command": "gitlens.timeline.refresh",
"when": "activeWebviewPanelId === gitlens.timeline",
"group": "navigation@-99"
},
{
"submenu": "gitlens/graph/configuration",
"when": "activeWebviewPanelId === gitlens.graph",
"command": "gitlens.composer.maximize",
"when": "activeWebviewPanelId === gitlens.composer",
"group": "navigation@-98"
},
{
"command": "gitlens.graph.split",
"when": "activeWebviewPanelId == gitlens.graph && resourceScheme == webview-panel && config.gitlens.graph.allowMultiple",
"group": "navigation@-97"
"submenu": "gitlens/graph/configuration",
"when": "activeWebviewPanelId === gitlens.graph",
"group": "navigation@-98"
},
{
"command": "gitlens.timeline.split",
Expand Down Expand Up @@ -15535,6 +15539,32 @@
"group": "navigation@100",
"alt": "gitlens.toggleFileBlame:editor/title"
},
{
"command": "gitlens.diffWithPrevious:editor/title",
"when": "resource in gitlens:tabs:tracked && config.gitlens.menus.editorGroup.compare",
"group": "navigation@97",
"alt": "gitlens.diffWithRevision"
},
{
"command": "gitlens.diffWithNext:editor/title",
"when": "resource in gitlens:tabs:tracked && config.gitlens.menus.editorGroup.compare",
"group": "navigation@99"
},
{
"command": "gitlens.diffWithWorking:editor/title",
"when": "resourceScheme =~ /^(gitlens|pr)$/ && gitlens:enabled",
"group": "navigation@-99"
},
{
"command": "gitlens.graph.refresh",
"when": "activeWebviewPanelId === gitlens.graph",
"group": "navigation@-99"
},
{
"command": "gitlens.graph.split",
"when": "activeWebviewPanelId == gitlens.graph && resourceScheme == webview-panel && config.gitlens.graph.allowMultiple",
"group": "navigation@-97"
},
{
"command": "gitlens.toggleFileHeatmap:editor/title",
"when": "resource in gitlens:tabs:blameable && resource not in gitlens:tabs:annotated && config.gitlens.menus.editorGroup.blame && config.gitlens.fileAnnotations.command == heatmap",
Expand All @@ -15546,32 +15576,16 @@
"when": "resource in gitlens:tabs:blameable && resource not in gitlens:tabs:annotated && !gitlens:window:annotated && config.gitlens.menus.editorGroup.blame && !config.gitlens.fileAnnotations.command",
"group": "navigation@100"
},
{
"command": "gitlens.diffWithPrevious:editor/title",
"when": "resource in gitlens:tabs:tracked && config.gitlens.menus.editorGroup.compare",
"group": "navigation@97",
"alt": "gitlens.diffWithRevision"
},
{
"command": "gitlens.showQuickRevisionDetails:editor/title",
"when": "resource in gitlens:tabs:tracked && config.gitlens.menus.editorGroup.compare",
"group": "navigation@98"
},
{
"command": "gitlens.diffWithNext:editor/title",
"when": "resource in gitlens:tabs:tracked && config.gitlens.menus.editorGroup.compare",
"group": "navigation@99"
},
{
"command": "gitlens.openWorkingFile:editor/title",
"when": "resourceScheme == git && gitlens:enabled && !isInDiffEditor",
"group": "navigation@-98"
},
{
"command": "gitlens.diffWithWorking:editor/title",
"when": "resourceScheme =~ /^(gitlens|pr)$/ && gitlens:enabled",
"group": "navigation@-99"
},
{
"command": "gitlens.openWorkingFile:editor/title",
"when": "resourceScheme =~ /^(gitlens|pr)$/ && gitlens:enabled",
Expand Down
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,9 @@ export type CoreConfig = {
};
readonly workbench: {
readonly editorAssociations: Record<string, string> | { viewType: string; filenamePattern: string }[];
readonly panel: {
readonly visible: boolean;
};
readonly tree: {
readonly renderIndentGuides: 'always' | 'none' | 'onHover';
readonly indent: number;
Expand Down
1 change: 1 addition & 0 deletions src/constants.commands.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type ContributedCommands =
| 'gitlens.composeCommits:graph'
| 'gitlens.composeCommits:scm'
| 'gitlens.composeCommits:views'
| 'gitlens.composer.maximize'
| 'gitlens.composer.refresh'
| 'gitlens.computingFileAnnotations'
| 'gitlens.connectRemoteProvider'
Expand Down
2 changes: 2 additions & 0 deletions src/constants.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ export type CoreCommands =
| 'workbench.action.openSettings'
| 'workbench.action.openWalkthrough'
| 'workbench.action.toggleMaximizedPanel'
| 'workbench.action.focusPanel'
| 'workbench.action.togglePanel'
| 'workbench.extensions.action.switchToRelease'
| 'workbench.extensions.installExtension'
| 'workbench.extensions.uninstallExtension'
Expand Down
32 changes: 19 additions & 13 deletions src/webviews/apps/plus/composer/components/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ interface ComposerDataSnapshot {
commits: ComposerCommit[];
selectedCommitId: string | null;
selectedCommitIds: Set<string>;
selectedUnassignedSection: string | null;
selectedUnassignedSection: 'staged' | 'unstaged' | 'unassigned' | null;
selectedHunkIds: Set<string>;
hasUsedAutoCompose: boolean;
}
Expand Down Expand Up @@ -407,13 +407,13 @@ export class ComposerApp extends LitElement {
private lastMouseEvent?: MouseEvent;

override firstUpdated() {
this.initializeResetStateIfNeeded();
// Delay initialization to ensure DOM is ready
setTimeout(() => this.initializeSortable(), 200);
this.initializeDragTracking();
if (this.state.commits.length > 0) {
this.selectCommit(this.state.commits[0].id);
}
this.initializeResetStateIfNeeded();
if (!this.state.onboardingDismissed) {
this.openOnboarding();
}
Expand Down Expand Up @@ -611,9 +611,9 @@ export class ComposerApp extends LitElement {
return {
hunks: JSON.parse(JSON.stringify(this.state?.hunks ?? [])),
commits: JSON.parse(JSON.stringify(this.state?.commits ?? [])),
selectedCommitId: this.state?.selectedCommitId ?? null,
selectedCommitId: this.selectedCommitId,
selectedCommitIds: new Set([...this.selectedCommitIds]),
selectedUnassignedSection: this.state?.selectedUnassignedSection ?? null,
selectedUnassignedSection: this.selectedUnassignedSection,
selectedHunkIds: new Set([...this.selectedHunkIds]),
hasUsedAutoCompose: this.state?.hasUsedAutoCompose ?? false,
};
Expand All @@ -622,9 +622,9 @@ export class ComposerApp extends LitElement {
private applyDataSnapshot(snapshot: ComposerDataSnapshot) {
this.state.hunks = snapshot.hunks;
this.state.commits = snapshot.commits;
this.state.selectedCommitId = snapshot.selectedCommitId;
this.selectedCommitId = snapshot.selectedCommitId;
this.selectedCommitIds = snapshot.selectedCommitIds;
this.state.selectedUnassignedSection = snapshot.selectedUnassignedSection;
this.selectedUnassignedSection = snapshot.selectedUnassignedSection;
this.state.hasUsedAutoCompose = snapshot.hasUsedAutoCompose;
this.selectedHunkIds = snapshot.selectedHunkIds;
this.requestUpdate();
Expand Down Expand Up @@ -823,7 +823,7 @@ export class ComposerApp extends LitElement {
// Create new commit
const newCommit: ComposerCommit = {
id: `commit-${Date.now()}`,
message: '', // Empty message - user will add their own
message: { content: '', isGenerated: false },
hunkIndices: hunkIndices,
};

Expand Down Expand Up @@ -1037,7 +1037,7 @@ export class ComposerApp extends LitElement {
this.commitMessageBeingEdited = null;
}, 1000);

commit.message = message;
commit.message = { content: message, isGenerated: false };
this.requestUpdate();
}
}
Expand Down Expand Up @@ -1208,7 +1208,10 @@ export class ComposerApp extends LitElement {
}

private get isReadyToFinishAndCommit(): boolean {
return this.state.commits.length > 0 && this.state.commits.every(commit => commit.message.trim().length > 0);
return (
this.state.commits.length > 0 &&
this.state.commits.every(commit => commit.message.content.trim().length > 0)
);
}

private get canGenerateCommitsWithAI(): boolean {
Expand Down Expand Up @@ -1301,7 +1304,7 @@ export class ComposerApp extends LitElement {

// Create Commits loading dialog
if (this.state.committing) {
const commitCount = this.state.commits.filter(c => c.message.trim() !== '').length;
const commitCount = this.state.commits.filter(c => c.message.content.trim() !== '').length;
return this.renderLoadingDialog(
'Creating Commits',
`Committing ${commitCount} commit${commitCount === 1 ? '' : 's'}.`,
Expand Down Expand Up @@ -1469,7 +1472,7 @@ export class ComposerApp extends LitElement {
this._ipc.sendCommand(GenerateCommitMessageCommand, {
commitId: commitId,
commitHunkIndices: commit.hunkIndices,
overwriteExistingMessage: commit.message.trim() !== '',
overwriteExistingMessage: commit.message.content.trim() !== '',
});
}

Expand All @@ -1488,7 +1491,7 @@ export class ComposerApp extends LitElement {

// Combine commit messages from selected commits
const combinedMessage = selectedCommits
.map(commit => commit.message)
.map(commit => commit.message.content)
.filter(message => message && message.trim() !== '')
.join('\n\n');

Expand All @@ -1498,10 +1501,13 @@ export class ComposerApp extends LitElement {
.filter(explanation => explanation && explanation.trim() !== '')
.join('\n\n');

// Determine if any of the combined commits were AI-generated
const isGenerated = selectedCommits.some(commit => commit.message.isGenerated);

// Create new combined commit
const combinedCommit: ComposerCommit = {
id: `commit-${Date.now()}`,
message: combinedMessage || 'Combined commit',
message: { content: combinedMessage || 'Combined commit', isGenerated: isGenerated },
hunkIndices: combinedHunkIndices,
aiExplanation: combinedExplanation || undefined,
};
Expand Down
Loading
Loading