Repository navigation
Fix Google Tasks create task success handling - #29030
Conversation
|
Thank you for your contribution! 🎉 🔔 @elliotdes @pernielsentikaer @erikvdp @ridemountainpig you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. 📋 Quick checkout commandsBRANCH="fix-google-tasks-create-task"
FORK_URL="https://github.com/mralonsocorona/extensions.git"
EXTENSION_NAME="google-tasks"
REPO_NAME="extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. |
Greptile SummaryThis PR fixes Google Tasks task creation feedback so success is shown only after the API request completes. The main changes are:
Confidence Score: 4/5The create-task success handling is improved, but the list refresh path still needs attention before merging. The changed flow is small and focused, with validation reported, and runtime evidence confirms the remaining refresh regression in the filtered list view. extensions/google-tasks/src/components/ListView.tsx and extensions/google-tasks/CHANGELOG.md
What T-Rex did
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
extensions/google-tasks/src/components/ListView.tsx:50
**Preserve active filter refresh**
`fetchList(listId)` defaults `showCompleted` to `false`, so creating a task while the list filter is `All` reloads `state.tasks` without completed tasks. The initial load passes `showCompleted` based on `state.filter`; this refresh needs the same argument or completed tasks disappear from the current view after a successful create.
```suggestion
const showCompleted = state.filter === Filter.All || state.filter === Filter.Completed;
const refreshedList = await fetchList(listId, showCompleted);
```
Reviews (2): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile |
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
| try { | ||
| setState((previous) => ({ ...previous, isLoading: true })); | ||
| await createTask(listId, taskToCreate); | ||
| const refreshedList = await fetchList(listId); |
There was a problem hiding this comment.
Preserve active filter refresh
fetchList(listId) defaults showCompleted to false, so creating a task while the list filter is All reloads state.tasks without completed tasks. The initial load passes showCompleted based on state.filter; this refresh needs the same argument or completed tasks disappear from the current view after a successful create.
| const refreshedList = await fetchList(listId); | |
| const showCompleted = state.filter === Filter.All || state.filter === Filter.Completed; | |
| const refreshedList = await fetchList(listId, showCompleted); |
Artifacts
Repro: focused ListView create refresh harness
- Contains supporting evidence from the run (text/javascript; charset=utf-8).
Repro: harness output showing omitted showCompleted refresh and disappearing completed task
- Keeps the command output available without making the summary code-heavy.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/google-tasks/src/components/ListView.tsx
Line: 50
Comment:
**Preserve active filter refresh**
`fetchList(listId)` defaults `showCompleted` to `false`, so creating a task while the list filter is `All` reloads `state.tasks` without completed tasks. The initial load passes `showCompleted` based on `state.filter`; this refresh needs the same argument or completed tasks disappear from the current view after a successful create.
```suggestion
const showCompleted = state.filter === Filter.All || state.filter === Filter.Completed;
const refreshedList = await fetchList(listId, showCompleted);
```
How can I resolve this? If you propose a fix, please make it concise.* Fix Google Tasks create task success handling * Update CHANGELOG.md --------- Co-authored-by: raycastbot <[email protected]>
Summary
Fixes the Google Tasks Create Task command so it only shows the success toast and closes the form after the task creation request has completed successfully.
Previously, the form called the async
onCreatehandler without awaiting it, then immediately showedTask Created!and navigated back. If the Google Tasks API request failed, users could still see a success message even though the task was not created.Changes
onCreatecontract async.Validation
npm run lintnpm run buildFixes #28900