LivelyKernel / LivelyKernel/lively.next

Embedded `Morphs` in `Text` should behave correctly with and without `Document`

Open
#600 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

✨ enhancement 🧑‍🎨 renderer
Dominant language
JavaScript
Stars
90
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Right now, we force `Document`s on `Text` with embedded `Morphs`. It would be nice to have them work without `Document`s as well.

This spans multiple different problem spaces:

1. [ ] It should be possible to add lines either via drag-and-drop in interactive mode and programmatically by including them in `textAndAttributes`. The second scenario should work with document and without.
2. [ ] Regardless of whether a Text has a document or not, its submorph-array should always contain its embedded morphs. They should also be correctly referenced in the embeddedMorphMap of the text.
3. [ ] When a morph A is embedded into a text, calling A.owner should return the text. This should work with or without document.
4. [ ] When a Morph gets removed from a text (either via drag-and-drop in interactive mode) or because the textAndAttributes of a Text were changed, the submorphs array of the text, its embeddedMorphMap and the owner of the previously embedded morph should be in a consistent state.
5. [ ] Regardless of whether a text is backed by a document or not, embedded morphs should update their positions correctly.

Contributor guide

Open the 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.

Research direction

Start by locating the Text implementation and the code handling textAndAttributes, embeddedMorphMap, submorphs, and owner relationships. Trace embedded morph insertion, removal, and position updates with and without a Document, then verify that all five listed behaviors remain consistent for both paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.