Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 29, 2025

Summary

This PR implements the feature requested in #8366 to add editable titles to Roo Code tasks and task history.

Changes

Core Implementation

  • ✅ Added optional title field to HistoryItem type schema
  • ✅ Implemented title update message handling between extension and webview
  • ✅ Added inline title editing UI in TaskHeader component
  • ✅ Updated TaskItem component to display titles prominently in history
  • ✅ Added comprehensive i18n support for title-related UI elements

User Experience

  • Users can click the edit icon next to the task title to enter edit mode
  • Titles can be saved with Enter key or save button, cancelled with Escape or cancel button
  • Empty titles clear the title field (fallback to task text)
  • Titles persist across VS Code sessions
  • Titles are displayed prominently in the task history list

Technical Details

  • Title input is properly trimmed and sanitized
  • Comprehensive test coverage added for backend functionality
  • Follows existing React patterns and TypeScript conventions
  • No breaking changes - fully backward compatible

Testing

  • ✅ Backend tests pass (webviewMessageHandler.spec.ts)
  • ✅ Type checking passes
  • ✅ Manual testing completed

Screenshots

The implementation adds an inline edit UI to the task header and displays titles prominently in the history list.

Fixes #8366


Important

This PR adds editable task titles to the UI, allowing users to modify titles inline, with changes persisting across sessions and reflected in task history.

  • Behavior:
    • Adds title field to HistoryItem schema in history.ts.
    • Implements updateTaskTitle message handling in webviewMessageHandler.ts.
    • Adds inline title editing in TaskHeader.tsx.
    • Updates TaskItem.tsx to display titles in history.
  • User Experience:
    • Users can edit task titles inline in the TaskHeader component.
    • Titles are saved with Enter or save button, cancelled with Escape or cancel button.
    • Empty titles clear the title field.
    • Titles persist across sessions and are shown in task history.
  • Testing:
    • Adds tests for title editing in TaskHeader.spec.tsx.
    • Backend tests for updateTaskTitle in webviewMessageHandler.spec.ts.
  • Misc:
    • Adds i18n support for title-related UI elements in chat.json and common.json.

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

- Add optional title field to HistoryItem type schema
- Add updateTaskTitle message types to Extension and Webview messages
- Implement title update handler in webviewMessageHandler with trimming
- Add title editing UI to TaskHeader component with inline edit mode
- Update TaskItem component to display titles prominently in history
- Add translations for title editing UI elements
- Add tests for backend title update functionality

Implements #8366
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 29, 2025 17:07
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request UI/UX UI/UX related or focused labels Sep 29, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 29, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 29, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 29, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Self-review engaged: grading my own code like a mirror that files Jira tickets.

)}

<div className="flex-1 min-w-0">
{/* Display title if it exists */}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P1: Titles aren’t included in the history search. The acceptance criteria require titles to be searchable alongside the existing content. Consider updating the search logic (useTaskSearch) to index both title and task, and adjust highlighting accordingly.

Comment on lines +102 to +112
const handleSaveTitle = () => {
if (currentTaskItem) {
// Send message to update the task title
vscode.postMessage({
type: "updateTaskTitle",
taskId: currentTaskItem.id,
title: editedTitle.trim(),
})
}
setIsEditingTitle(false)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P3: Avoid no-op updates. If the trimmed title hasn’t changed (treat undefined as ""), skip posting an update.

Suggested change
const handleSaveTitle = () => {
if (currentTaskItem) {
// Send message to update the task title
vscode.postMessage({
type: "updateTaskTitle",
taskId: currentTaskItem.id,
title: editedTitle.trim(),
})
}
setIsEditingTitle(false)
}
const handleSaveTitle = () => {
if (currentTaskItem) {
const newTitle = editedTitle.trim()
const prevTitle = currentTaskItem.title ?? ""
if (newTitle === prevTitle) {
setIsEditingTitle(false)
return
}
vscode.postMessage({
type: "updateTaskTitle",
taskId: currentTaskItem.id,
title: newTitle,
})
}
setIsEditingTitle(false)
}

placeholder={t("chat:task.titlePlaceholder")}
/>
<StandardTooltip content={t("chat:task.saveTitle")}>
<button
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P2: Accessibility – add an aria-label to the save button so screen readers (and tests) can reliably target it. Example: aria-label={t("chat:task.saveTitle")}.

</button>
</StandardTooltip>
<StandardTooltip content={t("chat:task.cancelEdit")}>
<button
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P2: Accessibility – add an aria-label to the cancel button. Example: aria-label={t("chat:task.cancelEdit")}.

</span>
<StandardTooltip content={t("chat:task.editTitle")}>
<button
onClick={(e) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P2: Accessibility – add an aria-label to the edit button. Example: aria-label={t("chat:task.editTitle")}.

fireEvent.mouseEnter(titleElement.parentElement!)

// Edit button should now be visible
expect(screen.getByLabelText("chat:editTitle")).toBeInTheDocument()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P1: i18n mismatch – tests query "chat:editTitle" but the component uses the "chat:task.*" keys. Update the label to match.

Suggested change
expect(screen.getByLabelText("chat:editTitle")).toBeInTheDocument()
expect(screen.getByLabelText("chat:task.editTitle")).toBeInTheDocument()

expect(input.tagName).toBe("INPUT")

// Should show save and cancel buttons
expect(screen.getByLabelText("chat:saveTitle")).toBeInTheDocument()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P1: i18n mismatch – update to the namespaced key used in the UI.

Suggested change
expect(screen.getByLabelText("chat:saveTitle")).toBeInTheDocument()
expect(screen.getByLabelText("chat:task.saveTitle")).toBeInTheDocument()


// Should show save and cancel buttons
expect(screen.getByLabelText("chat:saveTitle")).toBeInTheDocument()
expect(screen.getByLabelText("chat:cancelEdit")).toBeInTheDocument()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P1: i18n mismatch – update to the namespaced key used in the UI.

Suggested change
expect(screen.getByLabelText("chat:cancelEdit")).toBeInTheDocument()
expect(screen.getByLabelText("chat:task.cancelEdit")).toBeInTheDocument()

fireEvent.click(screen.getByLabelText("chat:editTitle"))

// Should show input with placeholder
const input = screen.getByPlaceholderText("chat:titlePlaceholder") as HTMLInputElement
Copy link
Contributor Author

Choose a reason for hiding this comment

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

P1: i18n mismatch – placeholder key should match the UI’s "chat:task.titlePlaceholder".

Suggested change
const input = screen.getByPlaceholderText("chat:titlePlaceholder") as HTMLInputElement
const input = screen.getByPlaceholderText("chat:task.titlePlaceholder") as HTMLInputElement

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. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add editable titles to Roo Code tasks and task history

3 participants