Skip to content

Fix issues surrounding persisted workspaces. #18

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

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Conversation

GirlBossRush
Copy link

@GirlBossRush GirlBossRush commented Nov 18, 2021

This PR addresses coder/code-server#4487, specifically extending VS Code’s existing desktop workspace behaviors to the browser. This may also address —ignore-last-opened by making the new tab behavior match the user’s initial path arguments.
https://github.com/cdr/vscode/blob/c1494438479e8382794576f2c621081d52b4fdc1/src/vs/workbench/browser/web.main.ts#L223-L243

@GirlBossRush GirlBossRush added bug Something isn't working enhancement New feature or request labels Nov 18, 2021
@GirlBossRush GirlBossRush self-assigned this Nov 18, 2021
Copy link

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

woohoo! 🎉 (thanks for letting me pair on this and see how you figured it out!)

const folder = toWorkspaceFolder(recent.folderUri);
workspace.folders = [folder];

window.history.replaceState(null, '', `?folder=${encodePath(folder.uri.path)}`);
Copy link

Choose a reason for hiding this comment

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

❓ Does this mean that if you open localhost:8080 (without passing a folder via the CLI), it will check for a recent folder and then append that as a query param to the URL?

(followup: what's the reason for doing this? Is this so the open folder is always in the URL or something else)

Copy link
Author

Choose a reason for hiding this comment

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

Correct. This ensures the user gets a URL which matches the format generated by VS Code when they explicitly open a new folder. It also lets them share a link to a specific folder which is especially useful now that this state is stored in the browser.

Copy link

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

Woohoo!

👏 Thanks for leaving detailed comments like this and explaining the why behind our changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants