-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add motion extension #17756
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
base: main
Are you sure you want to change the base?
Add motion extension #17756
Conversation
- Fix code style issues - Remove edit task functionality and rename extension to Motion - Adding new features to the list task function - Remove old screenshots - Remove unused imports to fix ESLint errors - Add correctly sized screenshots for Raycast store - Fix unterminated string literal in debug-workspaces.tsx - Add missing showFailureToast imports - Rename screenshots for better clarity - Add screenshots for Raycast store - Fix code formatting with Prettier - Address PR feedback: Update error handling, clean up .gitignore, add metadata folder for screenshots - Fix AI evals configuration to match Raycast requirements - Update debug-workspaces.tsx - Update extension per Raycast store guidelines: Add AI evals, create metadata folder, remove hardcoded workspace ID, enhance Prettier config, fix README title
Congratulations on your new Raycast extension! 🚀 Due to our current reduced availability, the initial review may take up to 10-15 business days Once the PR is approved and merged, the extension will be available on our Store. |
@pernielsentikaer here's the new pull request as discussed! thanks. |
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.
PR Summary
This PR adds a new Motion task management extension for Raycast, enabling users to manage tasks, projects, and workspaces through Motion's API.
- The
metadata
folder lacks required screenshots for view commands (add-task, list-tasks, delete-task, debug-workspaces) which are needed for the Raycast Store listing - The
ask-motion
AI tool inpackage.json
has evals but should include more diverse test cases for better coverage - The
list-tasks.tsx
component has duplicate state updates insetFilteredTasks(tasks)
that should be removed - Consider using
showFailureToast
from@raycast/utils
indelete-task.tsx
andlist-tasks.tsx
to simplify error handling - The
debug-workspaces.tsx
component could benefit from a loading indicator during API calls for better UX
💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!
14 file(s) reviewed, 21 comment(s)
Edit PR Review Bot Settings | Greptile
"lint": "ray lint", | ||
"prepublishOnly": "echo \"\\n\\nIt seems like you are trying to publish the Raycast extension to npm.\\n\\nIf you did intend to publish it to npm, remove the \\`prepublishOnly\\` script and rerun \\`npm publish\\` again.\\nIf you wanted to publish it to the Raycast Store instead, use \\`npm run publish\\` instead.\\n\\n\" && exit 1", | ||
"publish": "npx @raycast/api@latest publish", | ||
"save": "git add . && git commit -m 'Save changes' && git push" |
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.
style: The save
script is not a standard Raycast extension script and could be removed
1. `add-task.tsx` - Screenshot of the Add Task form | ||
2. `list-tasks.tsx` - Screenshot showing a list of tasks | ||
3. `edit-task.tsx` - Screenshot of the Edit Task form | ||
4. `delete-task.tsx` - Screenshot of the Delete Task view | ||
5. `debug-workspaces.tsx` - Screenshot of the Workspace Details view |
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.
logic: The file mentions edit-task.tsx
but this command is not defined in package.json. Either remove this line or add the command to package.json
## Features | ||
|
||
- **Add Task**: Quickly create new tasks with title, description, due date, priority, project, and label | ||
- **Edit Task**: View and edit your existing tasks, including updating priorities, deadlines, and project assignments |
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.
logic: The 'Edit Task' feature is listed in the README but there is no corresponding command in package.json or implementation file
```bash | ||
# Install dependencies | ||
npm install | ||
|
||
# Start development server | ||
npm run dev | ||
``` |
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.
style: Code block should be removed since these commands are already documented in the Installation section
await showToast({ | ||
style: Toast.Style.Failure, | ||
title: "Failed to initialize Motion client", | ||
message: String(error), | ||
}); |
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.
style: Could be simplified using showFailureToast from @raycast/utils
await showToast({ | |
style: Toast.Style.Failure, | |
title: "Failed to initialize Motion client", | |
message: String(error), | |
}); | |
await showFailureToast("Failed to initialize Motion client", String(error)); |
async getTaskById(id: string): Promise<MotionTask> { | ||
const url = `${BASE_URL}/tasks/${id}?workspaceId=${preferences.workspaceId}`; | ||
logRequest("GET", url, headers); | ||
|
||
const response = await fetch(url, { | ||
method: "GET", | ||
headers, | ||
}); | ||
|
||
if (!response.ok) { | ||
const responseText = await logResponse(response); | ||
throw new Error( | ||
`Failed to get task: ${response.statusText}${responseText ? ` - ${responseText}` : ""}` | ||
); | ||
} | ||
|
||
return response.json() as Promise<MotionTask>; | ||
}, |
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.
logic: getTaskById lacks try-catch block for error handling, unlike other API methods
async getTaskById(id: string): Promise<MotionTask> { | |
const url = `${BASE_URL}/tasks/${id}?workspaceId=${preferences.workspaceId}`; | |
logRequest("GET", url, headers); | |
const response = await fetch(url, { | |
method: "GET", | |
headers, | |
}); | |
if (!response.ok) { | |
const responseText = await logResponse(response); | |
throw new Error( | |
`Failed to get task: ${response.statusText}${responseText ? ` - ${responseText}` : ""}` | |
); | |
} | |
return response.json() as Promise<MotionTask>; | |
}, | |
async getTaskById(id: string): Promise<MotionTask> { | |
const url = `${BASE_URL}/tasks/${id}?workspaceId=${preferences.workspaceId}`; | |
logRequest("GET", url, headers); | |
try { | |
const response = await fetch(url, { | |
method: "GET", | |
headers, | |
}); | |
if (!response.ok) { | |
const responseText = await logResponse(response); | |
throw new Error( | |
`Failed to get task: ${response.statusText}${responseText ? ` - ${responseText}` : ""}` | |
); | |
} | |
return response.json() as Promise<MotionTask>; | |
} catch (error) { | |
console.error("[DEBUG] Get task by ID error:", error); | |
throw error; | |
} | |
}, |
async deleteTask(id: string): Promise<void> { | ||
const url = `${BASE_URL}/tasks/${id}?workspaceId=${preferences.workspaceId}`; | ||
logRequest("DELETE", url, headers); | ||
|
||
const response = await fetch(url, { | ||
method: "DELETE", | ||
headers, | ||
}); | ||
|
||
if (!response.ok) { | ||
const responseText = await logResponse(response); | ||
throw new Error( | ||
`Failed to delete task: ${response.statusText}${responseText ? ` - ${responseText}` : ""}` | ||
); | ||
} | ||
}, |
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.
style: deleteTask should verify task exists before attempting deletion to prevent accidental removals
// Sort tasks by due date (most recent first) | ||
const sortedTasks = [...tasksData].sort((a, b) => { | ||
if (!a.dueDate) return 1; | ||
if (!b.dueDate) return -1; | ||
return new Date(a.dueDate).getTime() - new Date(b.dueDate).getTime(); | ||
}); |
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.
logic: Tasks are sorted with most recent first, but the comparison is reversed - newer dates should return -1 for ascending order
// Sort tasks by due date (most recent first) | |
const sortedTasks = [...tasksData].sort((a, b) => { | |
if (!a.dueDate) return 1; | |
if (!b.dueDate) return -1; | |
return new Date(a.dueDate).getTime() - new Date(b.dueDate).getTime(); | |
}); | |
// Sort tasks by due date (most recent first) | |
const sortedTasks = [...tasksData].sort((a, b) => { | |
if (!a.dueDate) return 1; | |
if (!b.dueDate) return -1; | |
return new Date(b.dueDate).getTime() - new Date(a.dueDate).getTime(); | |
}); |
const motionClient = getMotionApiClient(); | ||
const tasks = await motionClient.getTasks(); |
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.
logic: getTasks() call should be wrapped in a try-catch block separate from the main try-catch to handle API initialization errors distinctly from task fetching errors
console.error("Error in Ask Motion tool:", error); | ||
|
||
// Extract more useful information from the error | ||
const errorDetails = String(error); |
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.
style: consider using showFailureToast from @raycast/utils for error handling
@@ -0,0 +1,18 @@ | |||
# Screenshots for Motion Extension |
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.
Why do we have a markdown file in metadata? Let's remove it
Hey @owendavidprice 👋 Would you mind taking a look at the feedback above when you get a chance, please? 🙏 |
Description
Screencast
Checklist
npm run build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are placed outside of themetadata
folder