chore: added Cursor to the extensions page#504
chore: added Cursor to the extensions page#504theisoj wants to merge 6 commits intoTestaustime:mainfrom
Conversation
… will be available soon).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Cursor extension in this repo: Please clone it from my repo and make it available. |
src/app/[locale]/authorize/page.tsx
Outdated
| const loginUrl = | ||
| editor == "vscode" | ||
| ? `/login?redirect=${encodeURIComponent("/authorize?editor=vscode")}` | ||
| : editor == "" |
There was a problem hiding this comment.
Should it be cursor instead?
| : editor == "" | |
| : editor == "cursor" |
There was a problem hiding this comment.
Also could use something like this so it's easier to extend in the future
const loginUrls = new Map(Object.entries({
vscode: `/login?redirect=${encodeURIComponent("/authorize?editor=vscode")}`,
cursor: `/login?redirect=${encodeURIComponent("/authorize?editor=cursor")}`
}))
const loginUrl = loginUrls.get(editor)
if (loginUrl === undefined) {
// Make this prettier
return <div>Unsupported editor</div>
}There was a problem hiding this comment.
it would be better in my opinion.
src/app/[locale]/extensions/page.tsx
Outdated
| <ExtensionBlock | ||
| logo="/images/cursor.svg" | ||
| alt="Cursor logo" | ||
| downloadLink="https://marketplace.visualstudio.com/items?itemName=testausserveri-ry.testaustime" |
There was a problem hiding this comment.
This is the VS Code extension
| logo="/images/cursor.svg" | ||
| alt="Cursor logo" | ||
| downloadLink="https://marketplace.visualstudio.com/items?itemName=testausserveri-ry.testaustime" | ||
| sourceCodeLink="https://github.com/Testausserveri/testaustime-cursor" |
There was a problem hiding this comment.
Is the repo in process of being moved under Testaustime (or at least Testausserveri) organization? At least I didn't see any messages in Discord about that
There was a problem hiding this comment.
yes. we'll talk about that in discord.
src/app/[locale]/authorize/page.tsx
Outdated
|
|
||
| const { username } = me; | ||
|
|
||
| const editorName = editor == "vscode" ? "Visual Studio Code" : "Cursor"; |
There was a problem hiding this comment.
Similar change here as I commented above
There was a problem hiding this comment.
yeah. that wasn't better thing, but I did that anyway.
src/app/[locale]/authorize/page.tsx
Outdated
| href={`vscode://testausserveri-ry.testaustime/authorize?token=${token}`} | ||
| href={ | ||
| editor == "vscode" | ||
| ? `vscode://testausserveri-ry.testaustime/authorize?token=${token}` |
src/app/[locale]/authorize/page.tsx
Outdated
| <Button | ||
| component="a" | ||
| href={`vscode://testausserveri-ry.testaustime/authorize?token=${token}`} | ||
| href={loginUrl} |
There was a problem hiding this comment.
This is not correct, loginUrl is a path in the frontend, not a path in the extension. You need to create a new map for the extension urls too.
src/app/[locale]/authorize/page.tsx
Outdated
|
|
||
| if (loginUrl === undefined) { | ||
| // Make this prettier | ||
| return <div>Unsupported editor</div>; |
src/app/[locale]/authorize/page.tsx
Outdated
| const editorName = editorNames.get(editor ?? "vscode"); | ||
|
|
||
| if (editorName === undefined) { | ||
| return <div>Invalid editor</div>; |
There was a problem hiding this comment.
This should be the same text as above, with translation
Cursor support added for Testaustime extension. I made this modification because VS Code is not the only code editor in the market. There's is plenty of them out there. Nothing else to add here.