Skip to content

Commit 3ffc155

Browse files
committed
describedBy and lint
1 parent 412294a commit 3ffc155

File tree

2 files changed

+77
-15
lines changed

2 files changed

+77
-15
lines changed

src/plugin.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,37 @@ const codeMirrorPlugin: JupyterFrontEndPlugin<void> = {
6868

6969
commands.addCommand('jupyterlab-cell-diff:show-codemirror', {
7070
label: 'Show Cell Diff (CodeMirror)',
71+
describedBy: {
72+
args: {
73+
type: 'object',
74+
properties: {
75+
cellId: {
76+
type: 'string',
77+
description: 'ID of the cell to show diff for'
78+
},
79+
originalSource: {
80+
type: 'string',
81+
description: 'Original source code to compare against'
82+
},
83+
newSource: {
84+
type: 'string',
85+
description: 'New source code to compare with'
86+
},
87+
showActionButtons: {
88+
type: 'boolean',
89+
description: 'Whether to show action buttons in the diff widget'
90+
},
91+
notebookPath: {
92+
type: 'string',
93+
description: 'Path to the notebook containing the cell'
94+
},
95+
openDiff: {
96+
type: 'boolean',
97+
description: 'Whether to open the diff widget automatically'
98+
}
99+
}
100+
}
101+
},
71102
execute: async (args: any = {}) => {
72103
const {
73104
cellId,
@@ -140,6 +171,37 @@ const nbdimePlugin: JupyterFrontEndPlugin<void> = {
140171

141172
commands.addCommand('jupyterlab-cell-diff:show-nbdime', {
142173
label: 'Show Cell Diff (NBDime)',
174+
describedBy: {
175+
args: {
176+
type: 'object',
177+
properties: {
178+
cellId: {
179+
type: 'string',
180+
description: 'ID of the cell to show diff for'
181+
},
182+
originalSource: {
183+
type: 'string',
184+
description: 'Original source code to compare against'
185+
},
186+
newSource: {
187+
type: 'string',
188+
description: 'New source code to compare with'
189+
},
190+
showActionButtons: {
191+
type: 'boolean',
192+
description: 'Whether to show action buttons in the diff widget'
193+
},
194+
notebookPath: {
195+
type: 'string',
196+
description: 'Path to the notebook containing the cell'
197+
},
198+
openDiff: {
199+
type: 'boolean',
200+
description: 'Whether to open the diff widget automatically'
201+
}
202+
}
203+
}
204+
},
143205
execute: async (args: any = {}) => {
144206
const {
145207
cellId,

style/base.css

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,35 @@
5050
transition: background-color 0.1s ease;
5151
}
5252

53-
.jp-DiffView-toggle button:hover,
54-
.jp-DiffView-accept button:hover,
55-
.jp-DiffView-reject button:hover {
56-
background-color: var(--jp-layout-color3);
57-
}
58-
5953
.jp-DiffView-accept button {
6054
background-color: var(--jp-success-color2) !important;
6155
border-color: var(--jp-success-color1) !important;
6256
}
6357

64-
.jp-DiffView-accept button:hover {
65-
background-color: var(--jp-success-color1) !important;
66-
color: var(--jp-ui-inverse-font-color1) !important;
67-
}
68-
6958
.jp-DiffView-reject button {
7059
background-color: var(--jp-error-color2) !important;
7160
border-color: var(--jp-error-color1) !important;
7261
}
7362

63+
.jp-DiffView-toggle button {
64+
background-color: var(--jp-brand-color2) !important;
65+
border-color: var(--jp-brand-color1) !important;
66+
}
67+
68+
.jp-DiffView-toggle button:hover,
69+
.jp-DiffView-accept button:hover,
7470
.jp-DiffView-reject button:hover {
75-
background-color: var(--jp-error-color1) !important;
71+
background-color: var(--jp-layout-color3);
72+
}
73+
74+
.jp-DiffView-accept button:hover {
75+
background-color: var(--jp-success-color1) !important;
7676
color: var(--jp-ui-inverse-font-color1) !important;
7777
}
7878

79-
.jp-DiffView-toggle button {
80-
background-color: var(--jp-brand-color2) !important;
81-
border-color: var(--jp-brand-color1) !important;
79+
.jp-DiffView-reject button:hover {
80+
background-color: var(--jp-error-color1) !important;
81+
color: var(--jp-ui-inverse-font-color1) !important;
8282
}
8383

8484
.jp-DiffView-toggle button:hover {

0 commit comments

Comments
 (0)