Motif: Open as Markdown… for a whole record

Open
#138 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with parent issue #73 and textediting ADR 0035 §2, then read the listed ADRs, especially 0095, 0101, 0102, 0103, and 0106. The issue describes a GDR-only Markdown editing flow, but acceptance criteria are still unwritten and key design decisions and lowering behavior remain unsettled. Work is done once those decisions are resolved, criteria are defined, and the full-record Draft flow meets them.

Written by the indexing model from the issue text.

Description

Parent

#73 · textediting ADR 0035 §2

What to build

"Open as Markdown…" in the GDR preview window shows the whole GDR as one .fw.md document and saves it as one Draft, through the field operations of each changed field.

Design (owner, 2026-11-12, Q2–Q8)

  • Document: fwmd: 1 front matter plus read-only record: /lists/GDR/GDR-n and guid. Each field is a Pandoc fenced div ::: {field=title|description|discussion}, and other writing-system alternatives get their own div with ws=.
  • Editable: the title, the description (all alternatives) and the discussion. The ID, GUID, parent and list position are read-only, and editing them is a finding that holds back the save.
  • Save: one Draft, with text/setParagraphs for the discussion and text/setRichString for each changed alternative (ADR 0095). Unchanged fields stage nothing. Any error holds back the whole save: findings are shown and "Throw away my Markdown changes" is offered. Warnings never block. No new write route.
  • Where: inside the GDR preview window only, with "Back to fields". No external file or editor.
  • Agents: App-only for now. A separate ticket covers agents reading the same document.
  • Changed underneath: Save refuses each stale field by name and keeps the Markdown, offering Reload or copy-out. Per-field Compare comes later.
  • Undo and leaving: one undo step, "Edit as Markdown". Closing or switching records with unsaved Markdown is refused. Opening returns any single field that is in source mode to rich text first.

Open

  • Q1, GDRs only? Decided yes (owner, 2026-11-12). Entry and sense documents wait for motif-bible's log design. GDR edits stay a Draft that a person applies, like a word approval (owner, 2026-11-12); motif-bible is asked to align ADR 0101 §5. Findings that led here:
    • LcmCrdt check (2026-11-12), done: FW Lite's own types can't hold a whole GDR. RichString keeps named styles, ObjData links and the ws on each span (MiniLcm RichString.cs:258,301), so Name and Description fit. But there are no paragraph objects (StText/StTxtPara) and no custom possibility lists, so the Discussion and the list itself don't fit. A rich string is also replaced whole per ws on concurrent edits. Draft PR #149 already works around this: ADR 0102 stores grammar as Motif-registered Harmony types that FW Lite carries opaquely, and ADR 0106 keeps .fwdata as the phase-1 source. ADR 0083's custom list still holds for now, and Q7's per-field stale refusal has the same shape as ADR 0103's per-property stale check.
    • Gaps for the Source/Build round (#149): (1) the .fwdata→log export spike carries no CmPossibilityList, CmPossibility, StText or StTxtPara, so an export today drops every GDR (and ADR 0110's Source list); (2) ADR 0101 §5 makes GDR text edits instant, while ADR 0083 §3 and Q4 above send them through a Draft and Apply: the owner must choose; (3) ADR 0102 §1 (per-class types, Markdown never stored) vs ADR 0103 §2 (a Proposal is "a document like a GDR"): which shape a GDR takes in a log decides what this record document is a view over. Unverified: whether ADR 0095's text/setParagraphs and text/setRichString have a lowering to Harmony change JSON, which ADR 0106 §2 requires.
    • Effect: nothing blocks GDRs-only as a view over the field-addressed seam; settle (2) and (3) before entry or sense documents or Markdown as a store.

Acceptance criteria

  • To be written once Q1 is settled.
Dominant language
C#
Stars
1
Forks
0
Avg merge
3h 55m
Merged PRs (30d)
36

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sillsdev/motif

All issues in sillsdev/motif

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.