Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve context handling#4453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ian-r-rose merged 66 commits intojupyterlab:masterfromjasongrout:context
May 25, 2018
Merged
Changes from1 commit
Commits
Show all changes
66 commits
Select commitHold shift + click to select a range
7a5bd00
WIP context cleanups
jasongroutApr 23, 2018
78df852
Handle paths having multiple contexts.
jasongroutApr 24, 2018
db40067
Some new docs about how JupyterLab deals with documents.
jasongroutApr 25, 2018
1e298d7
WIP
jasongroutApr 26, 2018
2e93f83
WIP
jasongroutApr 27, 2018
9c7c4a8
WIP
jasongroutApr 28, 2018
92d58d0
Revert back to original widget creation workflow, but insist we get b…
jasongroutMay 7, 2018
3816766
WIP for MimeDocument widget
jasongroutMay 9, 2018
6ede2da
WIP trying out an idea for a mime document renderer, pushing most log…
jasongroutMay 10, 2018
0ff19f6
WIP converting code to use IDocumentWidget
jasongroutMay 10, 2018
4aa4de6
Fix all compilation errors dealing with the move to IDocumentWidget.
jasongroutMay 10, 2018
58a7a4b
Fix lint errors
jasongroutMay 11, 2018
3fc6bde
WIP: Fix some tests, skip others while we are evaluating this approach.
jasongroutMay 11, 2018
1107f69
Create a specialized MimeDocument document widget type.
jasongroutMay 12, 2018
12dfc8e
Delay a document widget from being ready until the context is ready.
jasongroutMay 12, 2018
af12ced
Use the ABCWidgetFactory type parameter defaults where we can to simp…
jasongroutMay 12, 2018
55f8b32
Convert the notebook to use DocumentWidget
jasongroutMay 12, 2018
631d0e1
Move notebook content generation to the widget factory.
jasongroutMay 13, 2018
8b3b7e1
Remove image viewer toolbar-lookalike css.
jasongroutMay 13, 2018
db7fc2d
Move dirty state handling to the document widget.
jasongroutMay 13, 2018
c90b59b
Get rid of double toolbars in file editor and mime document.
jasongroutMay 13, 2018
c3496d1
Switch SingletonLayout workaround from panel layout to box layout for…
jasongroutMay 13, 2018
f7b03da
Adjust toolbar height to account for visible widgets.
jasongroutMay 14, 2018
78e85c3
Fix toolbar collapse status based on explicit hiding, rather than cum…
jasongroutMay 14, 2018
b60aaf5
Move csv viewer toolbar over to document widget toolbar.
jasongroutMay 15, 2018
1a6b58d
Delete now-redundant notebook toolbar styling.
jasongroutMay 15, 2018
11ffaaf
Revert part of 7a5bd00ce3df55b85c747d02a00e87c49e3288b4 dealing with …
jasongroutMay 15, 2018
cbb1b6a
Make a CSVDocumentWidget which creates default content and toolbar.
jasongroutMay 15, 2018
6554c24
Fix tests
jasongroutMay 15, 2018
b0a3234
Merge branch 'master' into context
jasongroutMay 15, 2018
5d9d5db
Fix issues with the merge.
jasongroutMay 16, 2018
7ecb3c8
Fix CSV viewer toolbar tests.
jasongroutMay 16, 2018
447ab04
Fix mimedocument tests.
jasongroutMay 16, 2018
ebac5f0
Allow MainAreaWidget ready promises actually be Promise<any> for conv…
jasongroutMay 16, 2018
ae8b29b
Add document widget tests.
jasongroutMay 16, 2018
087d1d9
Fix more tests.
jasongroutMay 16, 2018
0468ec2
WIP notebook tests.
jasongroutMay 17, 2018
ae892b4
More notebook test fixes.
jasongroutMay 17, 2018
ba2802f
Fix more tests, convert many to use async/await.
jasongroutMay 17, 2018
672e843
Add the notebook panel .notebook attribute to ease the transition.
jasongroutMay 17, 2018
57b5c07
Fix integrity failures.
jasongroutMay 17, 2018
99c6c45
Make MainAreaWidget promise resolve *after* the spinner is removed.
jasongroutMay 17, 2018
5a21d5a
When a code editor is created, clear the history after setting the in…
jasongroutMay 17, 2018
7b618ba
Clear the notebook model undo history when the model is set.
jasongroutMay 17, 2018
ec7d693
Move .notebook references to .content
jasongroutMay 17, 2018
d72fd54
Delete the .notebook attribute for notebook panels again.
jasongroutMay 18, 2018
ce1abda
Fix model initialization test.
jasongroutMay 18, 2018
5da4760
path generally will be a stricter criteria than factory name, so matc…
jasongroutMay 18, 2018
64212a6
Initialize a model after the context's first save/revert.
jasongroutMay 18, 2018
5027e9e
Merge remote-tracking branch 'origin/master' into context
jasongroutMay 20, 2018
f12be48
Just use the BoxLayout instead of trying SingletonLayout.
jasongroutMay 20, 2018
7bb239a
Remove comment monologue that is no longer necessary or accurate of t…
jasongroutMay 20, 2018
56e5766
Run notebook panel contentfactory tests.
jasongroutMay 20, 2018
427a67e
Tweak documentation
jasongroutMay 22, 2018
4efcad2
Use StackedLayout instead of BoxLayout for single children.
jasongroutMay 22, 2018
21040a0
Fix review comment issues.
jasongroutMay 23, 2018
bf94b1e
Document the choices around focusing content.
jasongroutMay 23, 2018
d031011
We don’t need the document opener spinner anymore now that the docume…
jasongroutMay 23, 2018
dba0b63
MainAreaWidget attribute name change: ready -> reveal
jasongroutMay 23, 2018
414fd43
Change the main area widget reveal promise to ‘revealed’
jasongroutMay 23, 2018
413f401
Fix the revealed logic for the notebook panel.
jasongroutMay 23, 2018
63c41c1
Clarify logic around `isRevealed` to mean “spinner is gone, either a …
jasongroutMay 23, 2018
3ab6372
Update docs per review comments.
jasongroutMay 24, 2018
6749792
Move signal construction to attribute definition, consistent with the…
jasongroutMay 24, 2018
693810c
Support making the content null.
jasongroutMay 24, 2018
ac907af
Change MainAreaWidget to using the spinner as just a DOM node rather …
jasongroutMay 25, 2018
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
PrevPrevious commit
NextNext commit
Support making the content null.
  • Loading branch information
@jasongrout
jasongrout committedMay 25, 2018
commit693810c4e03b77e584b23f394c6c20e9f5b9fc45
38 changes: 26 additions & 12 deletionspackages/apputils/src/mainareawidget.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,8 +43,8 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
this.addClass('jp-MainAreaWidget');
this.id = uuid();

const content = this.content = options.content;
const toolbar = this.toolbar = options.toolbar || new Toolbar();
const content = this._content = options.content;
const toolbar = this._toolbar = options.toolbar || new Toolbar();
const spinner = this._spinner;

const layout = this.layout = new BoxLayout({spacing: 0});
Expand All@@ -54,8 +54,6 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
BoxLayout.setStretch(content, 1);
BoxLayout.setStretch(spinner, 1);

layout.addWidget(toolbar);

if (!content.id) {
content.id = uuid();
}
Expand All@@ -65,15 +63,18 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
content.title.changed.connect(this._updateTitle, this);
this.title.closable = true;
this.title.changed.connect(this._updateContentTitle, this);
content.disposed.connect(() => this.dispose());

if (options.reveal) {
layout.addWidget(spinner);
// Make sure the revealed promise is a Promise<void> to avoid leaking any
// results.
this._revealed = options.reveal.then(() => {
if (content.isDisposed) {
this.dispose();
return;
}
content.disposed.connect(() => this.dispose());
const active = document.activeElement === spinner.node;
spinner.dispose();
layout.addWidget(toolbar);
layout.addWidget(content);
this._isRevealed = true;
if (active) {
Expand All@@ -89,14 +90,19 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
BoxLayout.setStretch(error, 1);
spinner.dispose();
content.dispose();
this._content = null;
toolbar.dispose();
this._toolbar = null;
layout.addWidget(error);
this._isRevealed = true;
throw(error);
});
// Handle no reveal promise.
} else {
// Handle no reveal promise.
spinner.dispose();
layout.addWidget(toolbar);
layout.addWidget(content);
content.disposed.connect(() => this.dispose());
this._isRevealed = true;
this._revealed = Promise.resolve(undefined);
}
Expand All@@ -105,12 +111,16 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
/**
* The content hosted by the widget.
*/
readonly content: T;
get content(): T {
return this._content;
}

/**
* The toolbar hosted by the widget.
*/
readonly toolbar: Toolbar;
get toolbar(): Toolbar {
return this._toolbar;
}

/**
* Whether the content widget or an error is revealed.
Expand DownExpand Up@@ -141,7 +151,7 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
case 'mouseup':
case 'mouseout':
let target = event.target as HTMLElement;
if (this._isRevealed &&
if (this._isRevealed && this._content &&
this.toolbar.node.contains(document.activeElement) &&
target.tagName !== 'SELECT') {
this._focusContent();
Expand DownExpand Up@@ -173,7 +183,9 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
*/
protected onActivateRequest(msg: Message): void {
if (this._isRevealed) {
this._focusContent();
if (this._content) {
this._focusContent();
}
} else {
this._spinner.node.focus();
}
Expand DownExpand Up@@ -238,6 +250,8 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
this.content.activate();
}

private _content: T;
private _toolbar: Toolbar;
private _changeGuard = false;
private _spinner = new Spinner();

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp