Skip to content

feat(memory): Obsidian-style live Markdown notes in Memory & Collaboration #511

Description

@PeterGuy326

Product intent

Turn Memory & Collaboration → Position Documents / Shared Knowledge from a read-only document browser plus modal/manual editing into an Obsidian-style, filesystem-first note workspace.

This is a focused follow-up to #347 / #505. #505 supplies the safe document lifecycle and write seam; this issue owns the live note-editing interaction and should land after that prerequisite rather than expanding #505 during review.

User experience

  • Selecting a Markdown note opens it directly in an editable note surface; reading and editing are one continuous experience, not separate viewer and textarea pages.
  • Support source/edit, reading, and live-preview modes. Markdown structure should stay legible while typing.
  • Autosave local edits after a short idle debounce and show truthful states: 已保存, 正在保存…, 未保存, 保存失败, 外部修改冲突.
  • Preserve cursor, selection, active note, scroll position, and draft when switching the source sidebar, employee, focus mode, or returning to the module.
  • Cmd/Ctrl+S forces save; save failures never discard the draft.
  • Detect filesystem changes made outside RoleWeave and refresh clean documents. If the local editor is dirty, do not overwrite it: surface a compare/reload/keep-mine conflict choice.
  • Support Obsidian-style [[wikilinks]] and normal Markdown links. Clicking an internal note link opens the target in this workspace; missing targets offer safe note creation.
  • File and link affordances use meaningful icons by target type (Markdown note, folder, web link, attachment, missing note) and remain keyboard accessible.
  • Keep the existing file list/search and allow create/rename/archive/delete from feat(knowledge): document lifecycle ops for Knowledge Base #505 without losing an active draft.

Authority and storage boundaries

  • Markdown files remain the source of truth on disk; do not create a second hidden note database.
  • Use the existing validated position-document APIs from feat(knowledge): document lifecycle ops for Knowledge Base #505. Preserve path traversal, symlink, byte-limit, workspace/position ownership, and atomic-write protections.
  • Bound package files such as SKILL.md and non-knowledge/* files remain read-only unless the existing authority contract explicitly permits writes.
  • A write must carry the version read by the editor (or equivalent compare token). The server rejects stale writes instead of silently overwriting external changes.
  • Autosave is per file and serialized; late responses from a previous employee/file must not mutate the current editor.

Acceptance criteria

  • Markdown note opens in an inline editable surface with source/live-preview/reading modes.
  • Editing triggers debounced autosave and visible truthful save state.
  • Cmd/Ctrl+S performs an immediate save.
  • Switching views and returning preserves unsaved text and cursor/scroll state.
  • External clean-file changes refresh; dirty-file changes produce an explicit conflict flow.
  • Stale-version writes are rejected and covered by server tests.
  • [[wikilinks]] and relative Markdown links navigate between notes; missing-note creation is explicit.
  • Links include correct target icons and accessible names/focus behavior.
  • Agent and external filesystem edits converge through the same file/version contract.
  • Full renderer, server, IPC, i18n/CJK, packaging, and macOS/Windows verification remain green.

Dependency and delivery sequence

  1. Review and merge feat(knowledge): document lifecycle ops for Knowledge Base #505 (document write/lifecycle contract).
  2. Rebase this implementation on the resulting main.
  3. Deliver this issue as a separate focused PR with exact-head review.

Refs #347
Depends on #505

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions