Skip to content

Add item editing functionality and project documentation#1318

Open
KayakCbun wants to merge 2 commits intop0deje:masterfrom
KayakCbun:claude/update-claude-md-8xT5S
Open

Add item editing functionality and project documentation#1318
KayakCbun wants to merge 2 commits intop0deje:masterfrom
KayakCbun:claude/update-claude-md-8xT5S

Conversation

@KayakCbun
Copy link
Copy Markdown

Summary

This PR adds the ability to edit clipboard history items directly in the UI, along with comprehensive project documentation. Users can now modify text content of existing items or create new items from scratch using a new inline editing interface.

Key Changes

Editing Functionality

  • New KeyChord case: Added editCurrentItem mapped to Cmd+E for quick access to edit mode
  • History methods: Implemented startEditing(), saveEditing(), and cancelEditing() to manage the editing lifecycle
  • New item creation: Added addNew() method to create empty clipboard items ready for editing
  • HistoryItemDecorator properties: Added isEditing and editingText state properties to track editing mode

UI Updates

  • HistoryItemView: Refactored to show either normal view or inline editing view based on isEditing state
    • Editing view includes a multi-line TextField with save/cancel buttons
    • Added context menu with Edit, Pin/Unpin, and Delete actions
    • Auto-focuses the text field when entering edit mode
  • HeaderView: Added "+" button to create new clipboard items
  • KeyHandlingView: Wired up Cmd+E to trigger editing for the selected item

Localization

  • Added new string keys: edit, pin, unpin, delete, add_new to English localizable strings

Documentation

  • CLAUDE.md: Added comprehensive project overview including:
    • Project structure and file organization
    • Build and test instructions
    • Code style conventions and naming patterns
    • Linting tools configuration (SwiftLint, Periphery, Bartycrouch)

Implementation Details

  • Editing preserves the original clipboard item structure while updating the string content
  • Empty items are automatically deleted when editing is cancelled
  • Saving with empty text also deletes the item
  • The editing interface uses SwiftUI's @FocusState to auto-focus the text field
  • Changes are persisted to Core Data storage immediately upon save

https://claude.ai/code/session_014wX55ko1ozMbjn3SbpxMZg

- Edit: Right-click context menu with Edit option on text items, or use
  Cmd+E to enter inline edit mode on the selected item. The item becomes
  a TextField where content can be modified and saved (Enter) or
  cancelled (Escape). Save/cancel buttons also provided.

- Quick-add: Plus button in the header creates a new empty item in edit
  mode for quickly jotting down notes.

- Context menu also adds Pin/Unpin and Delete actions.

https://claude.ai/code/session_014wX55ko1ozMbjn3SbpxMZg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants