Playground Markdown tab: normalise before the no-change check, and match moved paragraphs' keys

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
desktop

Research direction

Read ApplyMarkdown and CarryKeys in samples/SIL.TextEditing.Playground/PlaygroundView.cs, along with the review of sillsdev/SIL.TextEditing#171 and the plan in issue #57. Check how normalization relates to AreEquivalent, then trace how paragraph keys are matched when paragraphs move. Done means normalization happens before the no-change check and moved unchanged paragraphs retain their keys through an LCS match.

Written by the indexing model from the issue text.

Description

textediting

Follow-ups from the review of sillsdev/SIL.TextEditing#171 (ApplyMarkdown in samples/SIL.TextEditing.Playground/PlaygroundView.cs):

  • Runs are normalised to Document.Normalization after the AreEquivalent no-change check, so Markdown that differs only in composed vs decomposed form records an undo step that changes nothing. Normalise first.
  • CarryKeys matches each new paragraph to the first equivalent old one in order, so moving a paragraph upward drops the keys of the paragraphs it passes. A longest-common-subsequence match would keep them. This matters for the real source mode (#57), whose plan keeps keys of unchanged paragraphs.

🤖 Generated with Claude Code

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.