Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d482927
Update Widget List.ipynb
liamb27 Apr 1, 2024
3fec38a
Update package imports
May 26, 2024
2baf3d6
Fix/unify tooltips.
May 26, 2024
53adf75
DirectionalLinkModel - remove link to source and target on cleanup.
May 26, 2024
b9d043e
Add weakref with opt in automatic widget deletion using 'enable_weakr…
May 26, 2024
cf8ef63
Add Children for Box (and subclasses) to support validation of any ty…
May 26, 2024
54bd2c6
Update yarn.lock (ran jlpm dlx yarn-berry-deduplicate).
May 26, 2024
75da2f9
Run lint.
May 28, 2024
0c1dafe
Fix tests that need dummy comm & update yarn.lock.
Jun 9, 2024
077d950
Merge branch 'main' of https://github.com/jupyter-widgets/ipywidgets …
Aug 31, 2024
3e49c8e
Fix tests and lock file.
Aug 31, 2024
7fa9cba
Simplify tooltips to work everywhere
Sep 10, 2024
234752c
Remove unnecessary code.
Sep 11, 2024
9d5a482
Update the widget model specification for 'Children'.
Sep 12, 2024
8286c7c
Make _model_id a property
Oct 26, 2024
dec5524
Merge branch 'main' of https://github.com/jupyter-widgets/ipywidgets …
Nov 2, 2024
ca3d0cb
Change _instances from 'global' variable to class variable.
Nov 4, 2024
1833ca0
Merge branch 'jupyter-widgets:main' into weakref
fleming79 Oct 15, 2025
4aff0cd
Simplify tests (some were failing for an unknown reason when run toge…
Oct 17, 2025
4869104
Fix create_markdown accessing deprecated (removed _widget_types).
Oct 18, 2025
3541511
Change from using Widget._instances class variable to the global _wid…
Oct 19, 2025
1243f70
Improved resilience of Widget.get_state to omit close items in boxes …
Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/base-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"chai": "^4.0.0",
"chai-as-promised": "^7.0.0",
"expect.js": "^0.3.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^6.3.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@jupyterlab/services": "^6.0.0 || ^7.0.0",
"@lumino/coreutils": "^1.11.1 || ^2.1",
"@lumino/messaging": "^1.10.1 || ^2.1",
"@lumino/messaging": "^1.10.1 || ^2.0.1",
"@lumino/widgets": "^1.30.0 || ^2.1",
"@types/backbone": "1.4.14",
"@types/lodash": "^4.14.134",
Expand All @@ -55,7 +55,6 @@
"chai": "^4.0.0",
"chai-as-promised": "^7.0.0",
"expect.js": "^0.3.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^6.3.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
Expand Down
8 changes: 6 additions & 2 deletions packages/base/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1101,14 +1101,18 @@ export class DOMWidgetView extends WidgetView {
}

updateTooltip(): void {
const title = this.model.get('tooltip');
const title = this.tooltip;
if (!title) {
this.el.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
} else if (!this.model.get('description')) {
this.el.setAttribute('title', title);
}
}

get tooltip() {
return this.model.get('tooltip') ?? this.model.get('description');
}

/**
* Update the DOM classes applied to an element, default to this.el.
*/
Expand Down
5 changes: 2 additions & 3 deletions packages/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
"dependencies": {
"@jupyter-widgets/base": "^6.0.10",
"@lumino/algorithm": "^1.9.1 || ^2.1",
"@lumino/algorithm": "^1.9.2 || ^2.0.1",
"@lumino/domutils": "^1.8.1 || ^2.1",
"@lumino/messaging": "^1.10.1 || ^2.1",
"@lumino/messaging": "^1.10.1 || ^2.0.1",
"@lumino/signaling": "^1.10.1 || ^2.1",
"@lumino/widgets": "^1.30.0 || ^2.1",
"d3-color": "^3.0.1",
Expand All @@ -57,7 +57,6 @@
"chai": "^4.0.0",
"css-loader": "^6.5.1",
"expect.js": "^0.3.1",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^6.3.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
Expand Down
13 changes: 5 additions & 8 deletions packages/controls/src/widget_bool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ export class CheckboxView extends DescriptionView {
this.descriptionSpan.textContent = description;
}
this.typeset(this.descriptionSpan);
this.descriptionSpan.title = description;
this.checkbox.title = description;
this.updateTooltip();
}

/**
Expand All @@ -181,13 +180,11 @@ export class CheckboxView extends DescriptionView {
}

updateTooltip(): void {
super.updateTooltip();
if (!this.checkbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.checkbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.checkbox.setAttribute('title', title);
}
const title = this.tooltip;
this.checkbox.setAttribute('title', title);
this.descriptionSpan.setAttribute('title', title);
}

events(): { [e: string]: string } {
Expand Down
3 changes: 2 additions & 1 deletion packages/controls/src/widget_description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ export class DescriptionView extends DOMWidgetView {
}

updateTooltip(): void {
super.updateTooltip();
if (!this.label) return;
this.label.title = this.model.get('tooltip');
this.label.title = this.tooltip;
}

label: HTMLLabelElement;
Expand Down
3 changes: 3 additions & 0 deletions packages/controls/src/widget_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ export class DirectionalLinkModel extends CoreWidgetModel {
undefined
);
this.stopListening(this.sourceModel, 'destroy', undefined);
this.set('source', [null, '']);
}
if (this.targetModel) {
this.stopListening(this.targetModel, 'destroy', undefined);
this.set('target', [null, '']);
this.save_changes();
}
}

Expand Down
8 changes: 2 additions & 6 deletions packages/controls/src/widget_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ export class SelectionView extends DescriptionView {
}

updateTooltip(): void {
super.updateTooltip();
if (!this.listbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.listbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.listbox.setAttribute('title', title);
}
this.listbox.setAttribute('title', this.tooltip);
}

listbox: HTMLSelectElement;
Expand Down
16 changes: 4 additions & 12 deletions packages/controls/src/widget_string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,9 @@ export class TextareaView extends StringView {
}

updateTooltip(): void {
super.updateTooltip();
if (!this.textbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.textbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.textbox.setAttribute('title', title);
}
this.textbox.setAttribute('title', this.tooltip);
}

events(): { [e: string]: string } {
Expand Down Expand Up @@ -505,13 +501,9 @@ export class TextView extends StringView {
}

updateTooltip(): void {
super.updateTooltip();
if (!this.textbox) return; // we might be constructing the parent
const title = this.model.get('tooltip');
if (!title) {
this.textbox.removeAttribute('title');
} else if (this.model.get('description').length === 0) {
this.textbox.setAttribute('title', title);
}
this.textbox.setAttribute('title', this.tooltip);
}

update(options?: any): void {
Expand Down
2 changes: 1 addition & 1 deletion packages/html-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@jupyterlab/outputarea": "^3.0.0 || ^4.0.0",
"@jupyterlab/rendermime": "^3.0.0 || ^4.0.0",
"@jupyterlab/rendermime-interfaces": "^3.0.0 || ^4.0.0",
"@lumino/messaging": "^1.10.1 || ^2.1",
"@lumino/messaging": "^1.10.1 || ^2.0.1",
"@lumino/widgets": "^1.30.0 || ^2.1",
"ajv": "^8.6.0",
"jquery": "^3.1.1",
Expand Down
2 changes: 1 addition & 1 deletion python/ipywidgets/ipywidgets/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

from .widget import Widget, CallbackDispatcher, register, widget_serialization
from .widget import Widget, CallbackDispatcher, register, widget_serialization, enable_weakreference, disable_weakreference
from .domwidget import DOMWidget
from .valuewidget import ValueWidget

Expand Down
5 changes: 2 additions & 3 deletions python/ipywidgets/ipywidgets/widgets/tests/test_send_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@

from ..._version import __control_protocol_version__


# A widget with simple traits
class SimpleWidget(Widget):
a = Bool().tag(sync=True)
b = Tuple(Bool(), Bool(), Bool(), default_value=(False, False, False)).tag(
sync=True
)
b = Tuple(Bool(), Bool(), Bool(), default_value=(False, False, False)).tag(sync=True)
c = List(Bool()).tag(sync=True)


Expand Down
Loading