final feature set
This commit is contained in:
45
tasks/text-selection-copy/01-text-selection-copy.md
Normal file
45
tasks/text-selection-copy/01-text-selection-copy.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# 01. Add Text Selection Event Handling
|
||||
|
||||
meta:
|
||||
id: text-selection-copy-01
|
||||
feature: text-selection-copy
|
||||
priority: P2
|
||||
depends_on: []
|
||||
tags: [ui, events, clipboard]
|
||||
|
||||
objective:
|
||||
- Add event listeners for text selection events in the TUI components
|
||||
- Detect when text is selected by the user
|
||||
- Prepare infrastructure for clipboard copy on selection release
|
||||
|
||||
deliverables:
|
||||
- New event bus events for text selection
|
||||
- Selection state tracking in app store
|
||||
- Event listener setup in main components
|
||||
|
||||
steps:
|
||||
1. Create new event bus events for text selection (`selection.start`, `selection.end`)
|
||||
2. Add selection state to app store (selectedText, selectionStart, selectionEnd)
|
||||
3. Add event listeners to key components that display text
|
||||
4. Track selection state changes in real-time
|
||||
5. Add cleanup handlers for event listeners
|
||||
|
||||
tests:
|
||||
- Unit: Test event bus event emission for selection events
|
||||
- Integration: Verify selection state updates when text is selected
|
||||
- Manual: Select text in different components and verify state tracking
|
||||
|
||||
acceptance_criteria:
|
||||
- Selection events are emitted when text is selected
|
||||
- Selection state is properly tracked in app store
|
||||
- Event listeners are correctly registered and cleaned up
|
||||
|
||||
validation:
|
||||
- Run the app and select text in Player component
|
||||
- Check app store selection state is updated
|
||||
- Verify event bus receives selection events
|
||||
|
||||
notes:
|
||||
- Need to handle terminal-specific selection behavior
|
||||
- Selection might not work in all terminal emulators
|
||||
- Consider using OSC 52 for clipboard operations
|
||||
45
tasks/text-selection-copy/02-clipboard-copy-on-release.md
Normal file
45
tasks/text-selection-copy/02-clipboard-copy-on-release.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# 02. Implement Clipboard Copy on Selection Release
|
||||
|
||||
meta:
|
||||
id: text-selection-copy-02
|
||||
feature: text-selection-copy
|
||||
priority: P2
|
||||
depends_on: [text-selection-copy-01]
|
||||
tags: [clipboard, events, user-experience]
|
||||
|
||||
objective:
|
||||
- Copy selected text to clipboard when selection is released
|
||||
- Handle terminal clipboard limitations
|
||||
- Provide user feedback when copy succeeds
|
||||
|
||||
deliverables:
|
||||
- Clipboard copy logic triggered on selection release
|
||||
- User notifications for copy actions
|
||||
- Integration with existing clipboard utilities
|
||||
|
||||
steps:
|
||||
1. Add event listener for selection release events
|
||||
2. Extract selected text from current focus component
|
||||
3. Use existing Clipboard.copy() utility
|
||||
4. Emit "clipboard.copied" event for notifications
|
||||
5. Add visual feedback (toast notification)
|
||||
|
||||
tests:
|
||||
- Unit: Test clipboard copy function with various text inputs
|
||||
- Integration: Verify copy happens on selection release
|
||||
- Manual: Select text and verify it appears in clipboard
|
||||
|
||||
acceptance_criteria:
|
||||
- Selected text is copied to clipboard when selection ends
|
||||
- User receives feedback when copy succeeds
|
||||
- Works across different terminal environments
|
||||
|
||||
validation:
|
||||
- Select text in Player description
|
||||
- Verify text is in clipboard after selection ends
|
||||
- Check for toast notification
|
||||
|
||||
notes:
|
||||
- Use existing Clipboard namespace from `src/utils/clipboard.ts`
|
||||
- Consider timing of selection release vs terminal refresh
|
||||
- May need to debounce copy operations
|
||||
15
tasks/text-selection-copy/README.md
Normal file
15
tasks/text-selection-copy/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Text Selection Copy to Clipboard
|
||||
|
||||
Objective: When text is selected in the TUI, copy it to the clipboard on release
|
||||
|
||||
Status legend: [ ] todo, [~] in-progress, [x] done
|
||||
|
||||
Tasks
|
||||
- [ ] 01 — Add text selection event handling → `01-text-selection-copy.md`
|
||||
- [ ] 02 — Implement clipboard copy on selection release → `02-clipboard-copy-on-release.md`
|
||||
|
||||
Dependencies
|
||||
- 01 -> 02
|
||||
|
||||
Exit criteria
|
||||
- Users can select text and it gets copied to clipboard when selection is released
|
||||
Reference in New Issue
Block a user