-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add star functionality to tasks (#6244) #6246
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
Conversation
- Add isStarred field to HistoryItem type - Add starredTaskIds to GlobalState for persistent storage - Implement toggleTaskStar message handler in webviewMessageHandler - Update ClineProvider to map starred status to tasks - Add star button to TaskItemHeader component - Sort starred tasks to the top in useTaskSearch hook - Prevent deletion of starred tasks with warning messages - Add comprehensive tests for star functionality Fixes #6244
| <> | ||
| <div className="mb-2 text-vscode-errorForeground"> | ||
| {starredTaskIds.length === taskIds.length | ||
| ? "All selected tasks are starred. Please unstar them before deleting." |
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.
The inline string for starred tasks (e.g. 'All selected tasks are starred. Please unstar them before deleting.') is hardcoded. For proper internationalization, use the translation function (t) with a translation key.
| ? "All selected tasks are starred. Please unstar them before deleting." | |
| ? t("history:allTasksStarredUnstarBeforeDelete") |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| <AlertDialogDescription>{t("history:deleteTaskMessage")}</AlertDialogDescription> | ||
| <AlertDialogDescription> | ||
| {isStarred | ||
| ? "This task is starred. Please unstar it before deleting." |
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.
The message for starred tasks ('This task is starred. Please unstar it before deleting.') is hardcoded. It should be translated using t() for consistency with i18n requirements.
| ? "This task is starred. Please unstar it before deleting." | |
| ? t("history:starredTaskDeleteMessage") |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| <button | ||
| onClick={handleStarClick} | ||
| className="p-1 hover:bg-vscode-toolbar-hoverBackground rounded" | ||
| title={item.isStarred ? "Unstar task" : "Star task"}> |
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.
The title attribute on the star button uses inline text ('Star task'/'Unstar task'). Replace these with t()-based translation keys for proper internationalization.
| title={item.isStarred ? "Unstar task" : "Star task"}> | |
| title={item.isStarred ? t('unstarTask') : t('starTask')}> |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
|
Closing for now as the issue needs approval and proper scoping |
This PR implements the star functionality for tasks as requested in issue #6244.
Summary
Users can now star tasks to keep them at the top of the task list and prevent accidental deletion.
Changes
isStarredfield to HistoryItem typestarredTaskIdsto GlobalState for persistent storagetoggleTaskStarmessage handler in webviewMessageHandlerScreenshots
Star Button in Task Header
The star button appears next to each task. Starred tasks show a filled star icon.
Starred Tasks at Top
Starred tasks are automatically sorted to the top of the task list, regardless of the selected sort order.
Deletion Protection
When attempting to delete a starred task, users see a warning message and must unstar the task first.
Testing
Fixes #6244
Important
Add star functionality to tasks, allowing users to star tasks to keep them at the top and prevent accidental deletion, with updates to data models, UI components, and task handling logic.
isStarredfield toHistoryIteminhistory.ts.starredTaskIdstoGlobalStateinglobal-settings.tsfor persistent storage.toggleTaskStarhandler inwebviewMessageHandler.tsto toggle task star status.ClineProvider.tsto map starred status to tasks.useTaskSearchto sort starred tasks to the top.BatchDeleteTaskDialog.tsxandDeleteTaskDialog.tsx.TaskItemHeader.tsxwith visual feedback.BatchDeleteTaskDialog.spec.tsx,DeleteTaskDialog.spec.tsx,TaskItemHeader.spec.tsx, anduseTaskSearch.spec.tsx.This description was created by
for 0b7a9a4. You can customize this summary. It will automatically update as commits are pushed.