Skip to content

Commit 9f56904

Browse files
committed
styling
1 parent a7997f0 commit 9f56904

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

extensions/notebook-renderers/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,10 @@ export const activate: ActivationFunction<void> = (ctx) => {
231231
span.output-stream {
232232
display: inline-block;
233233
width: 100%;
234-
overflow-y: var(--notebook-output-overflow-y);
235-
max-height: 500px;
234+
}
235+
span.output-stream.scrollable {
236+
overflow-y: scroll;
237+
max-height: 400px;
236238
}
237239
.output-plaintext .code-bold,
238240
.output-stream .code-bold,

extensions/notebook-renderers/src/textHelper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export function truncatedArrayOfString(id: string, outputs: string[], linesLimit
5151
}
5252

5353
function scrollableArrayOfString(outputs: string[], container: HTMLElement) {
54+
container.classList.add('scrollable');
5455
const buffer = outputs.join('\n').split(/\r\n|\r|\n/g);
5556
const spanElement = handleANSIOutput(buffer.slice(0, 5000).join('\n'));
5657
container.appendChild(spanElement);

src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Themable {
234234
key: 'notebook.error.rendererNotFound',
235235
comment: ['$0 is a placeholder for the mime type']
236236
}, "No renderer found for '$0' a"),
237-
'notebook-output-overflow-y': this.options.outputScrolling ? 'scroll' : 'visible',
238237
};
239238
}
240239

@@ -243,7 +242,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Themable {
243242
const preloadsData = this.getStaticPreloadsData();
244243
const renderOptions = {
245244
lineLimit: this.configurationService.getValue<number>(NotebookSetting.textOutputLineLimit) ?? 30,
246-
outputScrolling: this.configurationService.getValue<boolean>(NotebookSetting.outputScrolling) ?? true
245+
outputScrolling: this.options.outputScrolling
247246
};
248247
const preloadScript = preloadsScriptStr(
249248
this.options,

src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ async function webviewPreloads(ctx: PreloadContext) {
8888
let currentOptions = ctx.options;
8989
let isWorkspaceTrusted = ctx.isWorkspaceTrusted;
9090
const lineLimit = ctx.renderOptions.lineLimit;
91+
const outputScrolling = ctx.renderOptions.outputScrolling;
9192

9293
const acquireVsCodeApi = globalThis.acquireVsCodeApi;
9394
const vscode = acquireVsCodeApi();
@@ -216,7 +217,7 @@ async function webviewPreloads(ctx: PreloadContext) {
216217
}
217218

218219
interface RendererContext extends rendererApi.RendererContext<unknown> {
219-
readonly settings: { readonly lineLimit: number };
220+
readonly settings: RenderOptions;
220221
}
221222

222223
interface RendererModule {
@@ -1384,6 +1385,7 @@ async function webviewPreloads(ctx: PreloadContext) {
13841385
},
13851386
settings: {
13861387
get lineLimit() { return lineLimit; },
1388+
get outputScrolling() { return outputScrolling; },
13871389
}
13881390
};
13891391

0 commit comments

Comments
 (0)