Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 26, 2025

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

  • ✨ Added isStarred field to HistoryItem type
  • 💾 Added starredTaskIds to GlobalState for persistent storage
  • 🔧 Implemented toggleTaskStar message handler in webviewMessageHandler
  • 🗺️ Updated ClineProvider to map starred status to tasks
  • ⭐ Added star button to TaskItemHeader component with visual feedback
  • 📊 Modified useTaskSearch hook to sort starred tasks to the top
  • 🛡️ Added protection against deletion of starred tasks with warning messages
  • ✅ Added comprehensive tests for star functionality

Screenshots

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

  • Added unit tests for the useTaskSearch hook to verify starred tasks sorting
  • Updated existing tests for DeleteTaskDialog and BatchDeleteTaskDialog components
  • All tests pass successfully

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.

  • Behavior:
    • Add isStarred field to HistoryItem in history.ts.
    • Add starredTaskIds to GlobalState in global-settings.ts for persistent storage.
    • Implement toggleTaskStar handler in webviewMessageHandler.ts to toggle task star status.
    • Update ClineProvider.ts to map starred status to tasks.
    • Modify useTaskSearch to sort starred tasks to the top.
    • Add protection against deletion of starred tasks in BatchDeleteTaskDialog.tsx and DeleteTaskDialog.tsx.
  • UI Components:
    • Add star button to TaskItemHeader.tsx with visual feedback.
  • Tests:
    • Add tests for star functionality in BatchDeleteTaskDialog.spec.tsx, DeleteTaskDialog.spec.tsx, TaskItemHeader.spec.tsx, and useTaskSearch.spec.tsx.

This description was created by Ellipsis for 0b7a9a4. You can customize this summary. It will automatically update as commits are pushed.

- 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
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 26, 2025 13:42
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jul 26, 2025
<>
<div className="mb-2 text-vscode-errorForeground">
{starredTaskIds.length === taskIds.length
? "All selected tasks are starred. Please unstar them before deleting."
Copy link
Contributor

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.

Suggested change
? "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."
Copy link
Contributor

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.

Suggested change
? "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"}>
Copy link
Contributor

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.

Suggested change
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.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 26, 2025
@daniel-lxs
Copy link
Member

Closing for now as the issue needs approval and proper scoping

@daniel-lxs daniel-lxs closed this Jul 29, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 29, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Give option to star a task to see at top and not to delete accidentally.

4 participants