Skip to content

Add CanvasCast Extension - #209

Merged
mattisssa merged 14 commits into
raycast:mainfrom
YodaLightsabr:main
Dec 30, 2021
Merged

mattisssa merged 14 commits into
raycast:mainfrom
YodaLightsabr:main

Conversation

@YodaLightsabr

Copy link
Copy Markdown
Contributor

Description

Add Canvas LMS extension.

Type of change

New extension

Screencast

There isn't a lot to show because it's one command, but here it is. I also can't show the actual data because it has personal information.

image

Courses load a user's courses from https://canvas.instructure.com/doc/api/courses.html
Assignments load a user's TODO items from https://canvas.instructure.com/doc/api/users.html
Announcements load a user's announcements from https://canvas.instructure.com/doc/api/announcements.html

All colors are linked to the color of the course.

Checklist

@mattisssa mattisssa added the new extension Label for PRs with new extensions label Oct 25, 2021

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @YodaLightsabr 💪

Found a few suggestions and comments:

  • Is it called Canvas or CanvasCast, it's mixed in the extension, could be nice to have it baseline.

Do you by any chance have a token I could try so I can test the rest of the functionality? Feel free to find me in the channel #extensions on Slack

Comment thread extensions/canvascast/src/index.tsx Resolved
Comment thread extensions/canvascast/src/index.tsx Resolved
Comment thread extensions/canvascast/package.json Resolved
Comment thread extensions/canvascast/package.json Resolved
@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

Sure! I'll get a test course going where you can try it out. Canvas is the name of the API Canvascast is using to check the courses and assignments.

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Hi @YodaLightsabr 👋

Awesome, looking forward to test it out, thanks for the key provided

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @YodaLightsabr 👋

Thanks for the corrections, it's very close to launching 🚀

Comments and suggestions

  • There is no handling of wrong URL/token - you can check #165 for a way to handle it visually.
  • move api.js to src/ folder

Request a new review when you are ready, feel free to contact me here or at Slack if you have any questions.

Comment thread extensions/canvascast/package.json Outdated
"commands": [
{
"name": "index",
"title": "Open Dashboard",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"title": "Open Dashboard",
"title": "Dashboard",

@maggie-j-liu

Copy link
Copy Markdown
Contributor

hiii! this extension looks super cool; i think it would be nice to add a readme that explains how to get the access token, and also add a warning about the access token breaking canvas' tos as explained here

@pernielsentikaer

Copy link
Copy Markdown
Contributor

@YodaLightsabr Do you need help with anything?

@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

I'll have a few more test assignments added soon, I've just been really busy and haven't gotten around to it yet.

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Hi @YodaLightsabr 👋

Sure! Just DM on Slack when you're ready 🧑‍🎤

And as @maggie-j-liu said, there should be a README.md file telling about the extension (and how to get token) and if anything not is compliant with the terms it should be added too: https://developers.raycast.com/basics/prepare-an-extension-for-store#metadata-and-configuration

@fe9lix

fe9lix commented Dec 22, 2021

Copy link
Copy Markdown
Contributor

Closing this PR due to inactivity – feel free to reopen later.

@fe9lix fe9lix closed this Dec 22, 2021
@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

Thanks, closing it reminded me I hadn't updated it. I think I've just about finished adding all of the suggestions.

@fe9lix

fe9lix commented Dec 24, 2021

Copy link
Copy Markdown
Contributor

@YodaLightsabr Let me know if you want to reopen it here...

@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

Yeah, I think it's ready to be reopened.

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Hi @YodaLightsabr

Let's reopen it and get it merged – we could call it “My Courses” instead, that would be a more sufficient title

@mattisssa
mattisssa merged commit 95fc4f3 into raycast:main Dec 30, 2021
@raycastbot

Copy link
Copy Markdown
Collaborator

@eliotbehr

Copy link
Copy Markdown

@YodaLightsabr

This is a very useful extension. I do have one suggestion: Can you please make the extension only show courses which we have bookmarked in Canvas. For students with many old, but still Canvas-enrolled courses, it takes up the entire CanvasCast "Enrolled courses" thing. E.g., I can't see any course with a letter after "B". By only showing "Bookmarked courses", it would allow us to easily access the courses we want as most accessible and hopefully prevent these past-enrolled courses from taking up the entire CanvasCast pop-up.

@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

Oh yeah, I can totally relate to that. I have a ton of old courses and it wasn't until recently where they were dropped from my account. I'll take a look at this soon.

@eliotbehr

Copy link
Copy Markdown

Oh yeah, I can totally relate to that. I have a ton of old courses and it wasn't until recently where they were dropped from my account. I'll take a look at this soon.

Thanks so much for looking into this! For colleges like mine that are too lazy to drop them it would be super helpful haha

@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

@eliotbehr if you could test something for me it would be a big help. Could you sign into your canvas and then GET https://<YOUR_CANVAS_DOMAIN>/api/v1/courses and compare it to the response of https://<YOUR_CANVAS_DOMAIN>/api/v1/courses?enrollment_state=active. I just want to know if adding the query param excludes your old courses.

@eliotbehr

eliotbehr commented Jan 19, 2022 •

Copy link
Copy Markdown

@YodaLightsabr It did change it very slightly—with enrollment_state=active it removed one course that the school seemed to have explicitly unenrolled me, but not the old courses where I'm still "enrolled". Also this API query only presents at most 10 courses, sorted by alphabetical order it seems.

Could this be a possible option to query?: api/v1/users/self/favorites/courses

@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

Oh, I didn't see that. As long as it returns the same Course object, it should be an easy swap.

@eliotbehr

Copy link
Copy Markdown

@YodaLightsabr
Hey Yoda! Thank you so much for working on these changes! I saw that the extension was recently updated, and I re-installed it but I am still seeing the same old courses. Is there anyway I could help troubleshoot this—perhaps is it because of the API still?

@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

Hmmm, that shouldn't be happening. Could you tell me the API outputs of the courses endpoint, and then the favorites endpoint, and then what you want to see in the extension? You can hide private course details, it would just be helpful for debugging.

@gronk-droid

Copy link
Copy Markdown

@YodaLightsabr
Hey there! I'm having the same issue with favorites here. My unfavorited courses in Canvas are still showing in the command.

Screen Shot 2022-02-05 at 3 02 31 PM
Screen Shot 2022-02-05 at 3 02 46 PM

@YodaLightsabr

Copy link
Copy Markdown
Contributor Author

Ok, I think I've figured out how to only use the courses on the Dashboard and sort them in that order. I'll get started on implementing it.

jfox85 added a commit to jfox85/raycast-extensions that referenced this pull request Sep 19, 2025