Skip to content

Allow opt-in task toggles in read-only editors - #178

Open
yvos wants to merge 4 commits into
nodes-app:mainfrom
yvos:nofray/read-only-task-checkbox
Open

yvos wants to merge 4 commits into
nodes-app:mainfrom
yvos:nofray/read-only-task-checkbox

Conversation

@yvos

@yvos yvos commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Why

A common embedding shows a note read-only and still lets the user tick its checklist, like the preview in most notes apps. With isEditable = false the checkbox click is rejected by shouldChangeText, so today that requires making the whole editor editable.

What changes

allowsTaskCheckboxInteractionWhenReadOnly: Bool (default false). When it is on:

  • a checkbox click toggles [ ]/[x] as one undoable edit;
  • all other edits stay rejected.

The opt-in native checkbox behavior remains the complete scope of this PR. It does not introduce the separate A2 host-decided activation direction.

This update merges upstream/main at 7c626334d2e87146b0c34e340af3b9bb37a3ba81 with the published topic ancestry intact; the demo conflict retained both the checkbox opt-in and upstream directive completion demo.

Tests

ReadOnlyTaskCheckboxTests covers the default staying off, the opt-in click toggling the binding while ordinary edits stay blocked, the exact three-character mutation, and undo/redo. Full swift test --no-parallel passed 589 core tests in 76 suites and 1 LaTeX test.

The separate host-decided activation proposal remains outside this PR.

Keep the contribution current with upstream while retaining its published ancestry.
…178-upstream-20261008

# Conflicts:
#	Demo/MarkdownEngineDemo/ContentView.swift
@yvos

yvos commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer update: the branch is current through upstream 7c626334 via ordinary merge, retaining the opt-in read-only checkbox behavior with default-off semantics. No A2 host activation was added. Full swift test --no-parallel passed 589 core tests plus 1 LaTeX test. Please re-review the updated head and approve the checks when green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant