Skip to content

Commit 7485ba2

Browse files
committed
Merge branch 'main' into fix/faster-std-rendering
2 parents 1aaebbd + f28b414 commit 7485ba2

File tree

9 files changed

+70
-15
lines changed

9 files changed

+70
-15
lines changed

.github/workflows/galata.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323

2424
- name: Base Setup
2525
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
26+
with:
27+
python_version: "3.11"
2628

2729
- name: Set up browser cache
2830
uses: actions/cache@v4

docs/source/extension/extension_points.rst

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Here is a sample block of code that adds a command to the application (given by
7474
execute: () => {
7575
console.log(`Executed ${commandID}`);
7676
toggled = !toggled;
77+
}
7778
});
7879
7980
This example adds a new command, which, when triggered, calls the ``execute`` function.

jupyterlab/extensions/pypi.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def make_connection(self, host):
6565
proxy_host, _, proxy_port = http_proxy.netloc.partition(":")
6666

6767
proxies = {
68-
"http://": http_proxy_url,
69-
"https://": https_proxy_url,
68+
"http://": httpx.HTTPTransport(proxy=http_proxy_url),
69+
"https://": httpx.HTTPTransport(proxy=https_proxy_url),
7070
}
7171

7272
xmlrpc_transport_override = ProxiedTransport()
@@ -131,7 +131,7 @@ def __init__(
131131
parent: Optional[config.Configurable] = None,
132132
) -> None:
133133
super().__init__(app_options, ext_options, parent)
134-
self._httpx_client = httpx.AsyncClient(proxies=proxies)
134+
self._httpx_client = httpx.AsyncClient(mounts=proxies)
135135
# Set configurable cache size to fetch function
136136
self._fetch_package_metadata = partial(_fetch_package_metadata, self._httpx_client)
137137
self._observe_package_metadata_cache_size({"new": self.package_metadata_cache_size})

packages/filebrowser/src/model.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,15 @@ export class FileBrowserModel implements IDisposable {
609609
const path = this._model.path;
610610
const { sessions } = this.manager.services;
611611
const { oldValue, newValue } = change;
612+
const prefix = this.driveName.length > 0 ? this.driveName + ':' : '';
612613
const value =
613-
oldValue && oldValue.path && PathExt.dirname(oldValue.path) === path
614+
oldValue &&
615+
oldValue.path &&
616+
prefix + PathExt.dirname(oldValue.path) === path
614617
? oldValue
615-
: newValue && newValue.path && PathExt.dirname(newValue.path) === path
618+
: newValue &&
619+
newValue.path &&
620+
prefix + PathExt.dirname(newValue.path) === path
616621
? newValue
617622
: undefined;
618623

packages/filebrowser/test/model.spec.ts

+22
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,28 @@ describe('filebrowser/model', () => {
152152
expect(called).toBe(true);
153153
});
154154

155+
it('should be emitted when a file is created in a drive with a name', async () => {
156+
await state.clear();
157+
const driveName = 'RTC';
158+
const modelWithName = new FileBrowserModel({
159+
manager,
160+
state,
161+
driveName
162+
});
163+
164+
let called = false;
165+
modelWithName.fileChanged.connect((sender, args) => {
166+
expect(sender).toBe(modelWithName);
167+
expect(args.type).toBe('new');
168+
expect(args.oldValue).toBeNull();
169+
expect(args.newValue!.type).toBe('file');
170+
called = true;
171+
});
172+
await manager.newUntitled({ type: 'file' });
173+
expect(called).toBe(true);
174+
modelWithName.dispose();
175+
});
176+
155177
it('should be emitted when a file is renamed', async () => {
156178
let called = false;
157179
model.fileChanged.connect((sender, args) => {

packages/notebook/style/base.css

+8-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
flex: 0 0 auto;
205205
min-width: 36px;
206206
color: var(--jp-cell-inprompt-font-color);
207+
opacity: 0.5;
207208
padding: var(--jp-code-padding);
208209
padding-left: 12px;
209210
font-family: var(--jp-cell-prompt-font-family);
@@ -221,7 +222,13 @@
221222
top: 8px;
222223
left: 8px;
223224
background: var(--jp-layout-color2);
224-
border: var(--jp-border-width) solid var(--jp-input-border-color);
225+
border-width: var(--jp-border-width);
226+
border-style: solid;
227+
border-color: color-mix(
228+
in srgb,
229+
var(--jp-input-border-color) 20%,
230+
transparent
231+
);
225232
box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.12);
226233
}
227234

packages/outputarea/src/model.ts

+25-8
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,20 @@ export class OutputAreaModel implements IOutputAreaModel {
358358
const curText = prev.streamText!;
359359
const newText =
360360
typeof value.text === 'string' ? value.text : value.text.join('');
361-
Private.addText(curText, newText);
361+
this._streamIndex = Private.addText(this._streamIndex, curText, newText);
362362
return this.length;
363363
}
364364

365365
if (nbformat.isStream(value)) {
366366
if (typeof value.text !== 'string') {
367367
value.text = value.text.join('');
368368
}
369-
value.text = Private.processText(value.text);
369+
const { text, index } = Private.processText(
370+
this._streamIndex,
371+
value.text
372+
);
373+
this._streamIndex = index;
374+
value.text = text;
370375
}
371376

372377
// Create the new item.
@@ -480,6 +485,7 @@ export class OutputAreaModel implements IOutputAreaModel {
480485
private _changed = new Signal<OutputAreaModel, IOutputAreaModel.ChangedArgs>(
481486
this
482487
);
488+
private _streamIndex = 0;
483489
}
484490

485491
/**
@@ -530,14 +536,20 @@ namespace Private {
530536
/*
531537
* Handle backspaces in `newText` and concatenates to `text`, if any.
532538
*/
533-
export function processText(newText: string, text?: string): string {
539+
export function processText(
540+
index: number,
541+
newText: string,
542+
text?: string
543+
): { text: string; index: number } {
534544
if (text === undefined) {
535545
text = '';
536546
}
537547
if (!(newText.includes('\b') || newText.includes('\r'))) {
538-
return text + newText;
548+
text =
549+
text.slice(0, index) + newText + text.slice(index + newText.length);
550+
return { text, index: index + newText.length };
539551
}
540-
let idx0 = text.length;
552+
let idx0 = index;
541553
let idx1: number = -1;
542554
let lastEnd: number = 0;
543555
const regex = /[\n\b\r]/;
@@ -587,14 +599,18 @@ namespace Private {
587599
throw Error(`This should not happen`);
588600
}
589601
}
590-
return text;
602+
return { text, index: idx0 };
591603
}
592604

593605
/*
594606
* Concatenate a string to an observable string, handling backspaces.
595607
*/
596-
export function addText(curText: IObservableString, newText: string): void {
597-
const text = processText(newText, curText.text);
608+
export function addText(
609+
prevIndex: number,
610+
curText: IObservableString,
611+
newText: string
612+
): number {
613+
const { text, index } = processText(prevIndex, newText, curText.text);
598614
// Compute the difference between current text and new text.
599615
let done = false;
600616
let idx = 0;
@@ -619,5 +635,6 @@ namespace Private {
619635
idx++;
620636
}
621637
}
638+
return index;
622639
}
623640
}

packages/ui-components/src/components/windowedlist.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,7 @@ export class WindowedList<
13151315
private _applyNoWindowingStyles() {
13161316
this._viewport.style.position = 'relative';
13171317
this._viewport.style.top = '0px';
1318+
this._viewport.style.minHeight = '';
13181319
this._innerElement.style.height = '';
13191320
}
13201321
/**

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ classifiers = [
3636
]
3737
dependencies = [
3838
"async_lru>=1.0.0",
39-
"httpx>=0.25.0",
39+
"httpx~=0.28.0",
4040
"importlib-metadata>=4.8.3;python_version<\"3.10\"",
4141
"importlib-resources>=1.4;python_version<\"3.9\"",
4242
"ipykernel>=6.5.0",

0 commit comments

Comments
 (0)