feat(extension): support config-based ordering#223
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.
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.
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.
AriPerkkio
left a comment
There was a problem hiding this comment.
I'm not that familiar with vscode extension API but the code itself looks good.
AriPerkkio
left a comment
There was a problem hiding this comment.
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.readdirSyncand instead usevscode.workspace.fsfunctions.Screen.Recording.2024-08-07.at.10.37.07.mov
Closes #188