@@ -37,6 +37,8 @@ const jupyterProxyDomains =
3737 ( el ) => 'https://' + el
3838 )
3939
40+ export const notebookEditPseudoAppid = '1e5584e0-718c-4228-a666-0bdaf57fb82e'
41+
4042export class AppletButton extends Component {
4143 constructor ( args ) {
4244 super ( args )
@@ -975,10 +977,12 @@ export class JupyterHublet extends Component {
975977 newwidth = Math . max ( 150 , newwidth )
976978 newheight = Math . max ( 150 , newheight )
977979 const destaspect = this . aspect
978- if ( newwidth > newheight ) {
979- newheight = newwidth / destaspect
980- } else {
981- newwidth = newheight * destaspect
980+ if ( this . props . appids ?. appid !== notebookEditPseudoAppid ) {
981+ if ( newwidth > newheight ) {
982+ newheight = newwidth / destaspect
983+ } else {
984+ newwidth = newheight * destaspect
985+ }
982986 }
983987 newheight -= oldheight
984988 newwidth -= oldwidth
@@ -1002,7 +1006,10 @@ export class JupyterHublet extends Component {
10021006 }
10031007
10041008 checkAdjustAppletSize ( ) {
1005- if ( this . props . master ) {
1009+ if (
1010+ this . props . master &&
1011+ this . props . appids ?. appid !== notebookEditPseudoAppid
1012+ ) {
10061013 const oldaspect = this . props . pos . width / this . props . pos . height
10071014 const newaspect = this . aspect
10081015 if ( oldaspect !== newaspect ) {
@@ -1050,6 +1057,7 @@ export class JupyterHublet extends Component {
10501057 const applet = this . props . ipynb ?. applets ?. find ?. (
10511058 ( el ) => this . props . appids ?. appid === el . appid
10521059 )
1060+ const heading = applet ?. appname || this . props . ipynb ?. name
10531061 const master = this . props . master
10541062 const stopProp = ( event ) => event . stopPropagation ( )
10551063 const width =
@@ -1158,16 +1166,18 @@ export class JupyterHublet extends Component {
11581166 tooltip = 'Steer applet state'
11591167 />
11601168 ) }
1161- { master && this . props . screenShotSaver && (
1162- < AppletButton
1163- icon = { < FontAwesomeIcon icon = { faCamera } /> }
1164- key = 'appletbutton'
1165- onClick = { ( ) => {
1166- this . doScreenshot ( )
1167- } }
1168- tooltip = 'Create picture from applet'
1169- />
1170- ) }
1169+ { master &&
1170+ this . props . appids ?. appid !== notebookEditPseudoAppid &&
1171+ this . props . screenShotSaver && (
1172+ < AppletButton
1173+ icon = { < FontAwesomeIcon icon = { faCamera } /> }
1174+ key = 'appletbutton'
1175+ onClick = { ( ) => {
1176+ this . doScreenshot ( )
1177+ } }
1178+ tooltip = 'Create picture from applet'
1179+ />
1180+ ) }
11711181 < AppletButton
11721182 icon = { 'pi pi-info-circle' }
11731183 key = 'infobutton'
@@ -1205,9 +1215,7 @@ export class JupyterHublet extends Component {
12051215 onPointerMove = { ( event ) => this . onPointerMove ( 'move' , event ) }
12061216 onPointerUp = { ( event ) => this . onPointerUp ( 'move' , event ) }
12071217 />
1208- < div className = 'appletHeadingText' >
1209- { applet ?. appname || 'Loading...' }
1210- </ div >
1218+ < div className = 'appletHeadingText' > { heading || 'Loading...' } </ div >
12111219 < div
12121220 ref = { this . kernelStatusRef }
12131221 className = {
@@ -1270,7 +1278,10 @@ export class JupyterHublet extends Component {
12701278 ref = { this . jupyteredit }
12711279 document = { this . state . jupyterDocument }
12721280 filename = { this . props . ipynb ?. filename }
1273- appid = { this . props . appids ?. appid }
1281+ appid = {
1282+ this . props . appids ?. appid !== notebookEditPseudoAppid &&
1283+ this . props . appids ?. appid
1284+ }
12741285 stateCallback = { ( stateChange ) => {
12751286 this . setState ( ( state ) => ( {
12761287 jupyterState : {
@@ -1347,7 +1358,8 @@ export class JupyterHublet extends Component {
13471358 alt = 'powered by jupyter logo'
13481359 />
13491360 < div style = { { marginLeft : '10px' , textAlign : 'left' } } >
1350- FAILS' apps are powered by Jupyter Lite{ ' ' }
1361+ FAILS' apps and jupyter notebook support are powered by Jupyter
1362+ Lite{ ' ' }
13511363 </ div >
13521364 </ div >
13531365 </ h3 >
@@ -1363,7 +1375,7 @@ export class JupyterHublet extends Component {
13631375 { ' ' }
13641376 OSS attribution and licensing{ ' ' }
13651377 </ button > { ' ' }
1366- for app related content.
1378+ for jupyter related content.
13671379 < br /> < br />
13681380 </ OverlayPanel >
13691381 </ Fragment >
0 commit comments