-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
any approach to override icon/renderer for specific folder? #15741
Comments
This is already possible. You can register a custom file type ( |
thanks @krassowski ! Yes I found this yeaterday and blocked by the mimetype setting. Would have a try base on your example, thanks a lot! |
Hi @krassowski I have a try as below and somehow it doesn't work even though I can see my customised views registered in document manager This is what I tried (I am sorry that I cannot share screenshot/source code of internal project)
After above operations, I can see my customised fileType registered in setting editor, but icon still not changed. Maybe it is overriden by default directory rule, is there anything like rank? |
Directories and notebooks are treated specially: jupyterlab/packages/docregistry/src/registry.ts Lines 664 to 692 in 82051a9
Maybe we need to make a small change in the |
Definitely I am happy to but not sure if I am eligible haha. Maybe let me have a try if nobody else requests this urgently |
Just had a full-look, looks like notebook and directory would be forced to default file types such that pattern matching logic would be skipped. I may propose below logic update
const tryFts = this.getFileTypesForPath(name)
If so, use user-customised fileType If not, fallback to the default notebook/directory fileType. @krassowski please take a glance if it sense to you, if so, I would try to make it this mont (It would not be that quick as I would not be able to access my personal PC for around 2 weeks due to personal issue) |
@linlol Thank you for opening this issue! Which version of JupyterLab are you using? |
Hi @JasonWeill , I am currently using 3.6.3 As you can see from the discussion among Krassowski and I, the behaviour shall be indifferent for the latest dev branch |
@linlol Thanks for your response. If possible, I recommend upgrading to Lab 4. Most new features are not getting backported to Lab 3. |
@JasonWeill yes, thanks for pointing this, yes definitely we would upgrade jupyter lab 4 |
definitely I would not expect this feature onboarding at 3.6.x🤣🤣 |
The logic change that you propose appears fine to me - feel welcome to start a PR, from there we can see if this breaks any tests etc. That would be a small behaviour change so I believe we could introduce it in JupyterLab 4.2.0. |
thanks, I would start making the change among the end of the month (currently I don't have eligible coding env due to national holiday |
hi @krassowski , I make a PR for my change, is there any easy approach to propose a quick test looks like I need to add enhancement label, can you help add it? (or actually I can do it by myself?) well nws, I can see a lot of UI integration error... definitely something wrong. Honestly I don't understand the UI test failure, file type change of directory/notebook shall be irrelevant with the output of cell run https://github.com/jupyterlab/jupyterlab/actions/runs/7969849144/job/21756346972?pr=15828 is there anywhere to see the snapshot of UI test |
Problem
We are working on an internal jupyter lab solution. In this solution, there is some folder managed by ourselves (for example, a folder controlled by git records common util notebooks)
Is there any approach to specify another piece of svg string to notebooks with special name pattern?
This could also be a common requirement I guess? Suppose the case that give node_modules a dedicated icon
Proposed Solution
One possible solution is leave an abstraction like fileType, which enables application maintainer to customise it in lab extension
With such kind of abstraction, it shall also be better if we can make it configurable in setting registry
Additional context
The text was updated successfully, but these errors were encountered: