Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated fav-icon Base URL from JupyterLab PageConfig. #7109

Merged
merged 5 commits into from
Oct 17, 2023
Merged
Changes from 1 commit
Commits
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
8 changes: 6 additions & 2 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import { Widget } from '@lumino/widgets';

import { TrustedComponent } from './trusted';

import { PageConfig } from '@jupyterlab/coreutils';


/**
* The class for kernel status errors.
*/
Expand Down Expand Up @@ -411,6 +414,7 @@ const tabIcon: JupyterFrontEndPlugin<void> = {
requires: [INotebookTracker],
activate: (app: JupyterFrontEnd, tracker: INotebookTracker) => {
// the favicons are provided by Jupyter Server
const baseURL = PageConfig.getBaseUrl();
const notebookIcon = ' /static/favicons/favicon-notebook.ico';
const busyIcon = ' /static/favicons/favicon-busy-1.ico';

Expand All @@ -422,10 +426,10 @@ const tabIcon: JupyterFrontEndPlugin<void> = {
) as HTMLLinkElement;
switch (status) {
case 'busy':
link.href = busyIcon;
link.href = baseURL + busyIcon;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this string concatenation be moved above where notebookIcon and busyIcon are defined?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it could be combined with URLExt.join() (some example uses in this repo).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the Quick review. This will be more readable. have Updated the PR.

break;
case 'idle':
link.href = notebookIcon;
link.href = baseURL + notebookIcon;
break;
}
};
Expand Down