Skip to content

Add contextual editor markers and the context popup #17

Description

@Azganoth

Summary

Implement Leafdown's object-specific Markdown marker presentation and contextual editor popup behavior.

Expected behavior

  • Marker presentation follows the documented per-object rules:
    • Headings, blockquotes, ordered lists, unordered lists, and task lists show subtle caret-based markers.
    • Horizontal rules, code blocks, and tables remain rendered visual objects with focused controls or affordances rather than raw delimiter editing.
    • Strong, emphasis, strikethrough, inline code, links, images, footnote references, autolinks, and raw HTML expose editable raw Markdown syntax when active.
    • Footnote definitions show a persistent subtle marker.
    • Paragraphs and hard breaks do not add custom marker UI.
  • Selection alone does not reveal syntax markers.
  • Focused code blocks edit code content directly and expose the language identifier as metadata/control, without turning the block into raw fenced Markdown.
  • Selecting a rendered or placeholder image exposes the raw image Markdown for editing alt text and target path.
  • The context popup opens from selection or right-click, preserves or moves the caret according to the click target, and exposes the documented MVP command groups.
  • Escape, typing, outside clicks, or scrolling the popup out of view close it.

Related docs

Done when

  • Marker presentation matches the documented per-object behavior.
  • Selection alone does not reveal raw syntax markers.
  • Code blocks, tables, and horizontal rules keep rendered object editing behavior rather than raw delimiter editing.
  • Inline/source-oriented objects expose editable raw Markdown syntax when active.
  • Footnote references and footnote definitions follow their separate marker rules.
  • Image focus/selection exposes editable raw image Markdown.
  • Selection and right-click popup opening rules preserve or reposition editor context as specified.
  • Editor right-click handling uses Leafdown popup behavior rather than the default webview context menu.
  • Popup close behavior and command grouping match the MVP context surface.
  • Tests cover marker presentation transitions and popup context/close behavior; visual verification confirms the editor surface remains readable.

Metadata

Metadata

Assignees

Labels

FeatureNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions