Skip to content

Set or change the project on an existing paper project #32

Description

@SongshGeo

#25 added the project link to the new-paper scaffold only — a deliberate scope decision at the time. The consequence is that every project created before 2.4.0-beta.5, and every project created by any other route, still has no project: key and stays invisible to Project Manager's deliverable count.

There is currently no way to set it except editing frontmatter by hand in four separate notes.

Scope

Somewhere to pick or change the project for an existing paper, writing project: into every draft index note of that project (and removing it when cleared). Two plausible homes:

  • src/view/metadata-modal/ — already the place you edit a project's metadata, and it round-trips unknown JSON fields. But project: lives in note frontmatter, not metadata.json, so this modal would be writing outside its current remit.
  • src/view/explorer/ProjectDetails.svelte — sits in the project pane, already project-scoped.

Notes

  • Use app.fileManager.processFrontMatter rather than rewriting note text — the same approach src/commands/convert-to-project.ts uses for longform:.
  • Reuse projectOptions() and the host/free-text fallback from the new-paper modal rather than growing a second copy of that logic. That may mean lifting the control-swap out of new-paper-modal/index.ts into something shared.
  • Must handle both project forms: legacy (a longform: note per draft) and the single format: project index. In project form the drafts' own notes carry no longform:, so where project: belongs needs deciding — probably the index note only.
  • Reuse yamlScalar (src/model/scaffold/parts.ts) if writing raw text anywhere.

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