feat(extension): support config-based ordering#223
Conversation
|
|
Deploying tutorialkit-demo-page with
|
| Latest commit: |
043f5e6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://un5pfp1wv6bbkaxuvb3epyv4ct5b080b9f0kk1p6f6b2z1knrykq5gwpnw3hrag.julianrbryant.com |
| Branch Preview URL: | https://uhm6mk9ry1mwgqcjxb2ha4h44x1b0gh1w721b3m6bk41vmayyahp7gd3k5prya9qaq10q5ttcg.julianrbryant.com |
Deploying tutorialkit-docs-page with
|
| Latest commit: |
043f5e6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://un5mzp8aytdrpm5u3qye2w34ct5b080b9f0kk1nmaa6ejxjd78r21yvbbhhhgbb6.julianrbryant.com |
| Branch Preview URL: | https://uhm6mk9ry1mwgqcjxb2ha4h44x1b0gh1w721b3m6bk41vmayyb8mhpv5d5aq5fk5dmzzhwtxcfyg.julianrbryant.com |
| "__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