Skip to content

Commit 753ea9b

Browse files
Various minor bug fixes, accrodion, and also try to fix releasing (#13)
* Fix label edits * Use accordion for more flexibility * Fix splitview resizing * Try to fix releasing to github packages * Fix linting
1 parent 46f7038 commit 753ea9b

File tree

4 files changed

+42
-17
lines changed

4 files changed

+42
-17
lines changed

.github/workflows/publish-release.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,27 @@ jobs:
3030
app-id: ${{ vars.APP_ID }}
3131
private-key: ${{ secrets.APP_PRIVATE_KEY }}
3232

33+
- name: Populate Release for github packages
34+
id: populate-release-gh-packages
35+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
36+
with:
37+
token: ${{ steps.app-token.outputs.token }}
38+
branch: ${{ github.event.inputs.branch }}
39+
release_url: ${{ github.event.inputs.release_url }}
40+
steps_to_skip: "build-python,check-python,check-python"
41+
42+
- name: Finalize Release for github packages
43+
id: finalize-release-gh-packages
44+
env:
45+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_REGISTRY: https://npm.pkg.github.com/
47+
TWINE_COMMAND: "echo Skip python file with options "
48+
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
49+
with:
50+
token: ${{ steps.app-token.outputs.token }}
51+
steps_to_skip: "forwardport-changelog,publish-release"
52+
release_url: ${{ steps.populate-release.outputs.release_url }}
53+
3354
- name: Populate Release
3455
id: populate-release
3556
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
@@ -52,18 +73,6 @@ jobs:
5273
token: ${{ steps.app-token.outputs.token }}
5374
release_url: ${{ steps.populate-release.outputs.release_url }}
5475

55-
- name: Finalize Release for github packages
56-
id: finalize-release-gh-packages
57-
env:
58-
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
NPM_REGISTRY: https://npm.pkg.github.com/
60-
TWINE_COMMAND: "echo Skip python file with options "
61-
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
62-
with:
63-
token: ${{ steps.app-token.outputs.token }}
64-
steps_to_skip: "forwardport-changelog,publish-release"
65-
# release_url: ${{ steps.populate-release.outputs.release_url }}
66-
6776
- name: "** Next Step **"
6877
if: ${{ success() }}
6978
run: |

packages/applet-view/src/avoutputarea.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class AppletViewOutputArea extends AccordionPanel {
7272
this.addApplet({ appid, appname: 'Applet 1' });
7373
}
7474
this.id = `AppletView-${UUID.uuid4()}`;
75-
this.title.label = 'Applets Preview';
75+
this.title.label = 'Applet area';
7676
this.title.icon = notebookIcon;
7777
this.title.caption = this._notebook.title.label
7878
? trans.__('For Notebook: %1', this._notebook.title.label)
@@ -935,11 +935,19 @@ export class AppletViewRenderer extends AccordionPanel.Renderer {
935935
handle.appendChild(editLabel);
936936
});
937937
editLabel.addEventListener('blur', (ev: FocusEvent) => {
938+
// Firefox and Safari needs this
939+
if (editLabel.value !== title) {
940+
editLabel.dispatchEvent(new Event('change', { bubbles: true }));
941+
}
942+
938943
handle.removeChild(editLabel);
939944
handle.appendChild(staticLabel);
940945
});
941946
editLabel.addEventListener('keydown', (ev: KeyboardEvent) => {
942947
if (ev.key === 'Enter') {
948+
if (editLabel.value !== title) {
949+
editLabel.dispatchEvent(new Event('change', { bubbles: true }));
950+
}
943951
handle.removeChild(editLabel);
944952
handle.appendChild(staticLabel);
945953
}

packages/applet-view/src/splitviewnotebookpanel.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
NotebookWidgetFactory,
88
StaticNotebook
99
} from '@jupyterlab/notebook';
10-
import { BoxLayout, SplitPanel } from '@lumino/widgets';
10+
import { BoxLayout, AccordionPanel, AccordionLayout } from '@lumino/widgets';
1111
import { AppletViewOutputArea } from './avoutputarea';
1212
import {
1313
IFailsLauncherInfo,
@@ -39,9 +39,10 @@ export class SplitViewNotebookPanel
3939
const layout = this.layout as BoxLayout;
4040
layout.removeWidget(content);
4141
// 2. add a BoxLayout instead
42-
const splitPanel = new SplitPanel({
42+
const splitPanel = new AccordionPanel({
4343
spacing: 1,
44-
orientation: 'horizontal'
44+
orientation: 'horizontal',
45+
alignment: 'justify'
4546
});
4647
BoxLayout.setStretch(splitPanel, 1);
4748

@@ -55,13 +56,16 @@ export class SplitViewNotebookPanel
5556
}));
5657
splitPanel.addWidget(widget);
5758
layout.addWidget(splitPanel);
59+
const splitLayout = splitPanel.layout as AccordionLayout;
60+
splitLayout.titleSpace = 22;
5861
// move to separate handler
5962
if (failsLauncherInfo?.inLecture) {
6063
this.toolbar.hide();
6164
this.addClass('fl-jl-notebook-inlecture');
6265
this._appletviewWidget.inLecture = true;
6366
content.hide();
6467
splitPanel.setRelativeSizes([0, 1]); // change sizes
68+
splitLayout.titleSpace = 0;
6569
}
6670
if (failsLauncherInfo) {
6771
failsLauncherInfo.inLectureChanged.connect(
@@ -71,14 +75,18 @@ export class SplitViewNotebookPanel
7175
this.addClass('fl-jl-notebook-inlecture');
7276
this._appletviewWidget.inLecture = true;
7377
content.hide();
78+
widget.show();
79+
splitLayout.titleSpace = 0;
7480
splitPanel.setRelativeSizes([0, 1]); // change sizes
7581
} else {
7682
this.toolbar.show();
7783
this.removeClass('fl-jl-notebook-inlecture');
7884
this._appletviewWidget.inLecture = false;
7985
content.show();
86+
splitLayout.titleSpace = 22;
8087
splitPanel.setRelativeSizes([1, 1]); // change sizes
8188
widget.unselectApplet();
89+
setTimeout(() => splitPanel.setRelativeSizes([1, 1]), 1);
8290
}
8391
}
8492
);

packages/applet-view/style/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
}
115115

116116
.fl-jl-notebook-inlecture .lm-AccordionPanel-title {
117-
display: none;
117+
display: none !important;
118118
}
119119

120120
.fl-jl-notebook-inlecture .lm-SplitPanel-handle {

0 commit comments

Comments
 (0)