You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving the extension from one sidebar to another causes it to forget that the current directory is git-backed, and it will not recover until moving up above the current directory and back in.
Reproduce
From a git-backed directory:
left click extension (confirm it shows git-backed directory)
right click on the extension in left side bar and move to other sidebar
(extension will show a non-git-backed directory)
Browsing in file browser deeper into path will not resolve
Browsing up in filetree until we're out of the git dir, then back into it, will make things work again
Expected behavior
That extension does not lose track of it being in a git directory when switching side bar side, or at least can quickly recover.
The text was updated successfully, but these errors were encountered:
Okay, let's try take a shot at this. The bug is due to pathRepository not being set correctly in the model.
GitPanel.render() checks if GitPanel.state.repository is not null and only then renders the panel. If it is null, we get _renderWarning panel. This is what happens in the current bug behavior after switching the sidebar side.
GitPanel.componentDidMount() updates GitPanel.state.repository variable upon receiving signal from model.repositoryChanged. Signal is emitted by the GitExtension.pathRepository property setter. Currently, the property is set only in handful of places: when running git init, when application is restored or the filebrowser path is changed. However, it is not called when sidebar side for JupyterLab-git is changed and that cause the current bug.
The fix I came up with is to force change the repository in GitPanel.componentDidMount() by setting the state.repository with model.pathRepository. Since GitPanel.componentDidMount() also runs after changing the sidebar side, it fixes the problem, but does not affect existing signalling for repositoryChanged.
It might not be an optimal fix, but hopefully my analysis could help come up with a better fix.
Description
Moving the extension from one sidebar to another causes it to forget that the current directory is git-backed, and it will not recover until moving up above the current directory and back in.
Reproduce
From a git-backed directory:
Expected behavior
That extension does not lose track of it being in a git directory when switching side bar side, or at least can quickly recover.
The text was updated successfully, but these errors were encountered: