Skip to content

Feature: Add inline text editing to annotation toolbar #11

@kookyleo

Description

@kookyleo

Feature Request

Description

Add an inline text editing feature to the existing annotation toolbar that allows users to edit the original markdown text and write changes back to the source file.

Requirements

  • Extend the current annotation popover toolbar with an "Edit" button
  • Support inline editing of the selected text
  • Write changes back to the original markdown file
  • Constraint: Cannot span multiple lines (same as current annotation behavior)
  • Should not break existing annotations

Concerns to Address

  1. Annotation preservation: How to handle existing annotations when text is edited?

    • Option A: Remove annotations on edited text
    • Option B: Try to preserve annotations by adjusting offsets
    • Option C: Block editing if text has annotations
  2. Multi-line restriction: Maintain consistency with current annotation system

  3. File synchronization: Need to handle:

    • File write operations
    • Concurrent editing conflicts
    • WebSocket updates to other viewers

Technical Considerations

  • Current annotation system uses character offsets
  • Editing text will shift all subsequent offsets
  • Need to update annotation database after text edits
  • Should integrate with existing popover UI (PopoverManager)

Proposed UI Flow

  1. User selects text in markdown body
  2. Annotation toolbar appears with new "Edit" action
  3. Click "Edit" → text becomes editable inline
  4. User modifies text
  5. Press Enter/Save → write back to markdown file
  6. Update all affected annotations (or remove them)
  7. Refresh view with updated content

Related Files

  • assets/js/managers/popover-manager.js - Toolbar UI
  • assets/js/managers/annotation-manager.js - Annotation handling
  • Server-side markdown file write logic (needs implementation)

Open Questions

  • Should this be a separate permission/mode?
  • How to handle conflicts with live editing?
  • What if the file has changed on disk?

Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions