2code icon indicating copy to clipboard operation
2code copied to clipboard

add simple notes field to profiles

Open AkaraChen opened this issue 6 months ago • 3 comments

Feature Description

Add one Markdown note per profile, stored directly on the profile record, and edit it through an in-app Markdown editor.

Each profile should have exactly one notes field/document associated with it. This is not a separate notes system and not user-managed external Markdown files. It is a profile-owned note that helps preserve task context for that profile.

Motivation

Profiles are the unit of work in 2code. A profile can represent a feature, bugfix, experiment, issue, or agent work lane. A single built-in note per profile gives users a lightweight place to keep context such as:

  • task goal / spec
  • TODOs
  • design decisions
  • links and references
  • manual test notes
  • agent handoff notes
  • PR/checklist notes

Because this is part of the profile itself, users do not need to choose or manage file paths. Opening a profile should make its notes available immediately.

Proposed Solution

1. Store one notes field per profile

  • Add a notes field to the profile database table/model.
  • Existing profiles should migrate cleanly with empty/default notes.
  • The notes content can be Markdown text.
  • The field belongs to the profile; there is one note per profile.

2. Expose notes through existing profile APIs

  • Update Rust model/repo/service DTOs as needed.
  • Expose read/update through existing profile commands or a focused profile-notes update command.
  • Regenerate Tauri bindings after command/model changes.

3. Markdown editor UI

  • Add UI to view/edit the current profile's note using a Markdown editor.
  • A rich Markdown editor such as Milkdown would be a good fit, but implementation can choose the best compatible editor.
  • The editor should save notes back to the profile record.
  • Keep the first version focused: edit Markdown content reliably; advanced note organization is out of scope.

Possible UI placements:

  • A profile notes tab/panel in the current profile workspace
  • A notes section in the profile detail/header/settings area
  • A profile tab alongside terminal/file/browser tabs if that matches the existing layout

4. Persistence behavior

  • Notes persist after app restart.
  • Switching profiles shows the note for that profile.
  • Updating one profile's note does not affect other profiles.

Out of Scope

  • User-managed .md filepath attachment
  • Creating or selecting external notes files
  • Reveal in Finder / open external notes file flows
  • Multiple notes per profile
  • Project-wide notes
  • A separate notes table/document system unless required by implementation details
  • Full knowledge-base / backlink / tag system

Acceptance Criteria

  • [ ] Each profile has exactly one persisted notes field/document.
  • [ ] Existing profiles migrate cleanly with empty/default notes.
  • [ ] Users can open and edit the active profile's note in a Markdown editor UI.
  • [ ] Notes are saved to the profile record and persist after restart.
  • [ ] Switching profiles shows the correct note for that profile.
  • [ ] Updating one profile's note does not affect another profile.
  • [ ] Existing profile create/update/list flows continue to work.
  • [ ] Relevant i18n strings are added if new UI labels are introduced.

AkaraChen avatar May 23 '26 04:05 AkaraChen

Simplified scope based on product direction: this should just add a notes field to the profile database/model and a small UI to edit it. External Markdown filepath/document management is explicitly out of scope for this issue.

AkaraChen avatar May 23 '26 08:05 AkaraChen

Updated scope: notes are one per profile, stored on the profile record, and edited through an in-app Markdown editor UI. Milkdown is called out as a good candidate editor. External Markdown filepath management remains out of scope.

AkaraChen avatar May 23 '26 08:05 AkaraChen

@copilot please implement this feature and open a PR. Scope: one Markdown note per profile, stored on the profile record as a notes field, edited through an in-app Markdown editor such as Milkdown. Do not implement external Markdown filepath management or a separate notes system.

AkaraChen avatar May 23 '26 08:05 AkaraChen