Skip to content

Release v1.0.10: selectable context menu builder + hardened plain-text selection#137

Merged
gazreese merged 4 commits into
mainfrom
release/v1.0.10
Jul 7, 2026
Merged

Release v1.0.10: selectable context menu builder + hardened plain-text selection#137
gazreese merged 4 commits into
mainfrom
release/v1.0.10

Conversation

@gazreese

@gazreese gazreese commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Prepares the v1.0.10 release. Integrates #134 (thanks @momadvisor) and adds regression coverage around the selection behaviour change before shipping it.

Included from #134 (@momadvisor)

  • Adds a contextMenuBuilder parameter to Markdown and MarkdownBody, letting callers customise or suppress (pass null) the text-selection toolbar shown when selectable is enabled. Defaults to the platform-adaptive Flutter selection toolbar, so existing behaviour is unchanged.
  • onSelectionChanged now reports the full selectable plain text via TextSpan.toPlainText() instead of the top-level TextSpan.text.

Added in this branch — regression hardening

The onSelectionChanged change is the one behavioural shift worth de-risking: for any paragraph with more than one inline span (bold, italic, code, links) the parent span is built as TextSpan(children: [...]) with a null .text, so the previous code handed callers null. toPlainText() fixes that, and we've added targeted unit tests to lock the behaviour in and hopefully avoid future regressions:

  • Plain-only paragraph is reported unchanged (no regression for the simple case).
  • Multiple mixed inline styles (**bold** _italic_ code``) are fully concatenated.
  • Link text is included in the reported plain text.
  • The reported string is usable with TextSelection.textInside (a real downstream use, not just a non-null check).

Two of these carry a regression guard asserting the parent span's top-level .text is null for multi-child content — documenting in-test exactly why the old path returned null and why toPlainText() is needed.

Also fixed

Version & changelog

  • Bumped pubspec.yaml to 1.0.10 (patch — additive change with a safe default, consistent with prior patch releases that shipped small features).
  • Added the 1.0.10 CHANGELOG entry crediting @momadvisor.

Validation

  • dart format . -l 120 --set-exit-if-changed — clean
  • flutter analyze --no-pub . — no issues
  • flutter test381 tests pass

Release step

Publishing is tag-triggered: merging this PR then pushing the v1.0.10 tag publishes to pub.dev (irreversible). Tag push happens after merge + green CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_014oVQtXCPb3bSLnL2eDwGrh

momadvisor and others added 4 commits July 1, 2026 04:36
…mp version

Adds targeted unit tests for the onSelectionChanged behaviour change from
PR #134 (reporting TextSpan.toPlainText() instead of the top-level
TextSpan.text). Covers plain-only, mixed inline styles, links, and
TextSelection.textInside usability, with regression guards asserting the
parent span's top-level text is null for multi-child content.

Also registers context_menu_builder_test.dart in test/all.dart (the PR
omitted it), bumps the version to 1.0.10, and adds the CHANGELOG entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014oVQtXCPb3bSLnL2eDwGrh
@gazreese
gazreese merged commit d726f0d into main Jul 7, 2026
2 checks passed
@gazreese
gazreese deleted the release/v1.0.10 branch July 7, 2026 14:51
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.

2 participants