-
Notifications
You must be signed in to change notification settings - Fork 85
feat(extension): support config-based ordering #223
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
Conversation
|
Deploying tutorialkit-demo-page with
|
Latest commit: |
043f5e6
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f33a8823.tutorialkit-demo-page.pages.dev |
Branch Preview URL: | https://joan-config-based-ordering.tutorialkit-demo-page.pages.dev |
Deploying tutorialkit-docs-page with
|
Latest commit: |
043f5e6
|
Status: | ✅ Deploy successful! |
Preview URL: | https://a4c6aa88.tutorialkit-docs-page.pages.dev |
Branch Preview URL: | https://joan-config-based-ordering.tutorialkit-docs-page.pages.dev |
"__esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node", | ||
"__dev": "pnpm run esbuild-base -- --sourcemap --watch", | ||
"__vscode:prepublish": "pnpm run esbuild-base -- --minify", | ||
"__build": "vsce package", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed those because I don't think we should use them? @sulco what do you think?
lesson.name = parsedContent.data.title; | ||
timeoutId = setTimeout(async () => { | ||
loading = true; | ||
await this.refresh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a file is changed, we throw away everything and recalculate everything (lazily on a needed basis though).
This is pretty inefficient but very simple.
Ideally, I'd want to do something more fine-grained where we only update the element of the tree that need to. This should improve perf on really big tutorials with many many markdown files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that familiar with vscode
extension API but the code itself looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I did some testing locally with Vite Plugin Tutorial too. Nice work! 💯
This PR adds:
It does not implement re-ordering via drag and drop (I'll do that in a follow up PR).
I simplified the TreeView so that it does not contains any logic regarding the data structure generation. This is now done entirely in
models/tree/load.ts
(not a fan of this location but couldn't think of a better one). The logic no longer usefs.readdirSync
and instead usevscode.workspace.fs
functions.Screen.Recording.2024-08-07.at.10.37.07.mov
Closes #188