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

Update to JupyterLab 4.0.0a35#6757

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
jtpio merged 14 commits intojupyter:mainfromjtpio:update-jupyterlab-alpha
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
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
Enable file name search toolbar item
  • Loading branch information
@jtpio
jtpio committedMar 3, 2023
commitcef6c63788e9f30f579558b968daa92223792f52
1 change: 1 addition & 0 deletionspackages/tree-extension/schema/widget.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@
"jupyter.lab.toolbars": {
"FileBrowser": [
{ "name": "spacer", "type": "spacer", "rank": 900 },
{ "name": "fileNameSearcher", "rank": 950, "disabled": true },
{ "name": "new-dropdown", "rank": 1000 },
{ "name": "uploader", "rank": 1010 },
{ "name": "refresh", "command": "filebrowser:refresh", "rank": 1020 }
Expand Down
29 changes: 29 additions & 0 deletionspackages/tree-extension/src/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,7 +30,9 @@ import { ITranslator } from '@jupyterlab/translation';

import {
caretDownIcon,
FilenameSearcher,
folderIcon,
IScore,
runningIcon
} from '@jupyterlab/ui-components';

Expand All@@ -48,6 +50,11 @@ const FILE_BROWSER_FACTORY = 'FileBrowser';
*/
const FILE_BROWSER_PLUGIN_ID = '@jupyterlab/filebrowser-extension:browser';

/**
* The class name added to the filebrowser filterbox node.
*/
const FILTERBOX_CLASS = 'jp-FileBrowser-filterBox';

/**
* The namespace for command IDs.
*/
Expand DownExpand Up@@ -232,6 +239,28 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
})
);

toolbarRegistry.addFactory(
FILE_BROWSER_FACTORY,
'fileNameSearcher',
(browser: FileBrowser) => {
const searcher = FilenameSearcher({
updateFilter: (
filterFn: (item: string) => Partial<IScore> | null,
query?: string
) => {
browser.model.setFilter(value => {
return filterFn(value.name.toLowerCase());
});
},
useFuzzyFilter: true,
placeholder: trans.__('Filter files by name'),
forceRefresh: true
});
searcher.addClass(FILTERBOX_CLASS);
return searcher;
}
);

setToolbar(
browser,
createToolbarFactory(
Expand Down
9 changes: 9 additions & 0 deletionspackages/tree-extension/style/base.css
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,3 +15,12 @@
.jp-FileBrowser-toolbar button.jp-ToolbarButtonComponent {
height: 100%;
}

.jp-FileBrowser-filterBox {
padding: 0;
flex: 0 0 auto;
}

.jp-FileBrowser-filterBox input {
line-height: 24px;
}

[8]ページ先頭

©2009-2025 Movatter.jp