Commit d113d62
authored
Move copy task ID functionality to context menu (#1558)
## TL;DR
Moved the "Copy Task ID" feature from the TaskDetail header to the task context menu, removing the task ID display from the component header and centralizing this action in the context menu.
## Problem
The task ID was displayed as a clickable button in the TaskDetail header, taking up valuable space. This functionality is better served as a context menu action that's available on-demand.
## Changes
- **Added "Copy Task ID" context menu action** to task actions in `context-menu/schemas.ts` and `context-menu/service.ts`
- **Removed task ID display from TaskDetail component header** - no longer shows the task ID button in the header UI
- **Moved copy functionality** from TaskDetail component to `useTaskContextMenu` hook where it handles the clipboard write and toast notification
- **Cleaned up TaskDetail imports** - removed unused `Tooltip` from radix-ui, `useCallback` from React, and `toast` from sonner (now only imported in the hook)
- **Simplified header content memoization** - removed task ID and copyTaskId from dependency array
## How did you test this?
- The changes are based on moving existing functionality to a new location rather than adding new behavior
- The copy functionality logic remains the same (clipboard write + success toast)
- The context menu integration follows the existing pattern for task actions
---
*Created with [PostHog Code](https://posthog.com/code?ref=pr)*1 parent 80d59e0 commit d113d62
4 files changed
Lines changed: 14 additions & 21 deletions
File tree
- apps/code/src
- renderer
- features/task-detail/components
- hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
Lines changed: 7 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 88 | | |
95 | 89 | | |
96 | 90 | | |
97 | 91 | | |
98 | 92 | | |
99 | 93 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
113 | 99 | | |
114 | 100 | | |
115 | | - | |
| 101 | + | |
116 | 102 | | |
117 | 103 | | |
118 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
0 commit comments