Skip to content

Commit 9647599

Browse files
authored
Allow clicking anywhere in titles to expand/collap nb diff view cells (#226911)
1 parent f4e914e commit 9647599

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

src/vs/workbench/contrib/notebook/browser/diff/diffComponents.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -186,23 +186,10 @@ class PropertyHeader extends Disposable {
186186

187187
const target = e.event.target as HTMLElement;
188188

189-
if (target.classList.contains('codicon-notebook-collapsed') || target.classList.contains('codicon-notebook-expanded')) {
190-
const parent = target.parentElement as HTMLElement;
191-
192-
if (!parent) {
193-
return;
194-
}
195-
196-
if (!parent.classList.contains(this.accessor.prefix)) {
197-
return;
198-
}
199-
200-
if (!parent.classList.contains('property-folding-indicator')) {
201-
return;
202-
}
203-
204-
// folding icon
205-
189+
if (target === this.propertyHeaderContainer ||
190+
target === this._foldingIndicator || this._foldingIndicator.contains(target) ||
191+
target === metadataStatus || metadataStatus.contains(target)
192+
) {
206193
const cellViewModel = e.target;
207194

208195
if (cellViewModel === this.cell) {

src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@
129129
align-items: center;
130130
}
131131

132+
.notebook-text-diff-editor .cell-diff-editor-container .input-header-container,
133+
.notebook-text-diff-editor .cell-diff-editor-container .output-header-container,
134+
.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container {
135+
cursor: pointer;
136+
}
137+
132138
.notebook-text-diff-editor .cell-diff-editor-container .input-header-container .property-toolbar,
133139
.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-toolbar,
134140
.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-toolbar {

0 commit comments

Comments
 (0)