diff --git a/src/webviews/apps/commitDetails/commitDetails.html b/src/webviews/apps/commitDetails/commitDetails.html
index e8b8807..f539a65 100644
--- a/src/webviews/apps/commitDetails/commitDetails.html
+++ b/src/webviews/apps/commitDetails/commitDetails.html
@@ -10,8 +10,15 @@
No commit selected
-
-
+
+
+
+
+
diff --git a/src/webviews/apps/commitDetails/commitDetails.scss b/src/webviews/apps/commitDetails/commitDetails.scss
index f6aae0f..069d0fc 100644
--- a/src/webviews/apps/commitDetails/commitDetails.scss
+++ b/src/webviews/apps/commitDetails/commitDetails.scss
@@ -50,8 +50,9 @@ ul {
display: inline-block;
border: none;
padding: 0.4rem;
+ font-family: inherit;
font-size: inherit;
- line-height: inherit;
+ line-height: 1.4;
text-align: center;
text-decoration: none;
user-select: none;
@@ -71,6 +72,30 @@ ul {
&--full {
width: 100%;
}
+
+ code-icon {
+ pointer-events: none;
+ }
+}
+
+.button-container {
+ margin: 1rem auto 0;
+ text-align: left;
+ max-width: 30rem;
+ transition: max-width .2s ease-out;
+}
+
+.button-group {
+ display: inline-flex;
+ gap: 0.1rem;
+ width: 100%;
+ max-width: 30rem;
+}
+
+@media (min-width: 640px) {
+ .button-container {
+ max-width: 100%;
+ }
}
// webview-specific styles
@@ -172,7 +197,7 @@ ul {
}
&__message {
- font-size: 1.5rem;
+ font-size: 1.3rem;
border: 1px solid var(--color-background--lighten-15);
padding: 0.5rem;
}
@@ -187,6 +212,11 @@ ul {
-webkit-box-orient: vertical;
overflow: hidden;
}
+
+ strong {
+ font-weight: 600;
+ font-size: 1.4rem;
+ }
}
&__commit-action {
diff --git a/src/webviews/apps/commitDetails/commitDetails.ts b/src/webviews/apps/commitDetails/commitDetails.ts
index c763e41..254aec0 100644
--- a/src/webviews/apps/commitDetails/commitDetails.ts
+++ b/src/webviews/apps/commitDetails/commitDetails.ts
@@ -12,6 +12,7 @@ import {
OpenFileOnRemoteCommandType,
PickCommitCommandType,
RichContentNotificationType,
+ SearchCommitCommandType,
State,
} from '../../commitDetails/protocol';
import { App } from '../shared/appBase';
@@ -59,6 +60,7 @@ export class CommitDetailsApp extends App {
),
DOM.on('[data-action="commit-show-actions"]', 'click', e => this.onCommitMoreActions(e)),
DOM.on('[data-action="pick-commit"]', 'click', e => this.onPickCommit(e)),
+ DOM.on('[data-action="search-commit"]', 'click', e => this.onSearchCommit(e)),
DOM.on('[data-action="autolink-settings"]', 'click', e => this.onAutolinkSettings(e)),
];
@@ -70,6 +72,10 @@ export class CommitDetailsApp extends App {
this.sendCommand(AutolinkSettingsCommandType, undefined);
}
+ onSearchCommit(_e: MouseEvent) {
+ this.sendCommand(SearchCommitCommandType, undefined);
+ }
+
onPickCommit(_e: MouseEvent) {
this.sendCommand(PickCommitCommandType, undefined);
}
diff --git a/src/webviews/commitDetails/commitDetailsWebviewView.ts b/src/webviews/commitDetails/commitDetailsWebviewView.ts
index 3fc8af1..86a4f67 100644
--- a/src/webviews/commitDetails/commitDetailsWebviewView.ts
+++ b/src/webviews/commitDetails/commitDetailsWebviewView.ts
@@ -27,6 +27,7 @@ import {
PickCommitCommandType,
RichCommitDetails,
RichContentNotificationType,
+ SearchCommitCommandType,
State,
} from './protocol';
@@ -87,6 +88,11 @@ export class CommitDetailsWebviewView extends WebviewViewBase {
this.showCommitPicker();
});
break;
+ case SearchCommitCommandType.method:
+ onIpc(SearchCommitCommandType, e, _params => {
+ this.showCommitSearch();
+ });
+ break;
case AutolinkSettingsCommandType.method:
onIpc(AutolinkSettingsCommandType, e, _params => {
this.showAutolinkSettings();
@@ -103,6 +109,12 @@ export class CommitDetailsWebviewView extends WebviewViewBase {
void executeCommand(Commands.ShowSettingsPageAndJumpToAutolinks);
}
+ private showCommitSearch() {
+ void executeCommand(Commands.SearchCommits, {
+ showResultsInDetails: true,
+ });
+ }
+
private showCommitPicker() {
void executeGitCommand({ command: 'log', state: { openPickInView: true } });
}
diff --git a/src/webviews/commitDetails/protocol.ts b/src/webviews/commitDetails/protocol.ts
index b1e2f2f..e26bfb2 100644
--- a/src/webviews/commitDetails/protocol.ts
+++ b/src/webviews/commitDetails/protocol.ts
@@ -39,6 +39,7 @@ export const FileComparePreviousCommandType = new IpcCommandType('co
export const FileMoreActionsCommandType = new IpcCommandType('commit/file/moreActions');
export const CommitActionsCommandType = new IpcCommandType('commit/moreActions');
export const PickCommitCommandType = new IpcCommandType('commit/pickCommit');
+export const SearchCommitCommandType = new IpcCommandType('commit/searchCommit');
export const AutolinkSettingsCommandType = new IpcCommandType('commit/autolinkSettings');
// NOTIFICATIONS