Open files with extension different from .ipynb as a notebook?

I wrote a custom ContentsManager to help storing/loading notebooks in a bit different format.
As visible from screenshot, jupyter is informed that file is a notebook though with a different extension.

Screen Shot 2021-01-24 at 10.56.19 PM

However when clicking on it, it opens file as a text, not a notebook.
Why front-end keeps requesting text file (unless I use open with > Notebook) and how can I change this?

Minor addition: jupyter notebook works correctly (i.e. opens as a notebook). It’s jupyterlab to misbehave

Currently the component in jlab is chosen based on the file extension. For now, I think you’d need to make a jlab extension that would register the notebook extension as the default viewer for your new extension.

@jasongrout can you point me to some example or directions how do I register new extension with jlab extension?

I think you might be able to just do this to add a new extension to the existing notebook file type:

app.docRegistry.getFileType('notebook')?.extensions.push('.newpy');

In order to make sure that filetype is defined, you probably want your extension to require the notebook extension tracker, to make sure you are initialized after the core notebook extension.