Skip to content

Commit

Permalink
Add console,shorten labels
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Apr 25, 2024
1 parent 9ce0639 commit 158e9be
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/launcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function LauncherBody(props: {
cwd: string;
typeItems: IItem[];
notebookItems: IKernelItem[];
consoleItems: IKernelItem[];
commands: CommandRegistry;
settings: ISettingRegistry.ISettings;
}): React.ReactElement {
Expand Down Expand Up @@ -157,7 +158,7 @@ function LauncherBody(props: {
</div>
<CollapsibleSection
className="jp-Launcher-openByType"
title={trans.__('Open New by Type')}
title={trans.__('Create Empty')}
open={true} // TODO: store this in layout/state higher up
>
{typeItems
Expand All @@ -172,7 +173,7 @@ function LauncherBody(props: {
</CollapsibleSection>
<CollapsibleSection
className="jp-Launcher-openByKernel"
title={trans.__('Open New by Kernel')}
title={trans.__('Launch Notebook')}
open={true} // TODO: store this in layout/state higher up
>
<KernelTable
Expand All @@ -185,6 +186,21 @@ function LauncherBody(props: {
onClick={item => item.execute()}
/>
</CollapsibleSection>
<CollapsibleSection
className="jp-Launcher-openByKernel"
title={trans.__('Launch Console')}
open={false}
>
<KernelTable
items={props.consoleItems}
commands={props.commands}
showSearchBox={false}
query={query}
settings={props.settings}
trans={trans}
onClick={item => item.execute()}
/>
</CollapsibleSection>
</div>
);
}
Expand Down Expand Up @@ -589,6 +605,11 @@ export class NewLauncher extends Launcher {
.filter(item => item.category && item.category === notebookCategory)
.map(this.renderKernelCommand);

const consoleItems = items
.filter(item => item.category && item.category === consoleCategory)
.map(this.renderKernelCommand);


// TODO: only create items once or if changed; dispose of them too
const typeItems: IItem[] = typeCommands.map(this.renderCommand);

Expand All @@ -599,6 +620,7 @@ export class NewLauncher extends Launcher {
commands={this.commands}
typeItems={typeItems}
notebookItems={notebookItems}
consoleItems={consoleItems}
settings={this._settings}
/>
);
Expand Down

0 comments on commit 158e9be

Please sign in to comment.