Release v1.0.10: selectable context menu builder + hardened plain-text selection#137
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
contextMenuBuilderparameter toMarkdownandMarkdownBody, letting callers customise or suppress (passnull) the text-selection toolbar shown whenselectableis enabled. Defaults to the platform-adaptive Flutter selection toolbar, so existing behaviour is unchanged.onSelectionChangednow reports the full selectable plain text viaTextSpan.toPlainText()instead of the top-levelTextSpan.text.Added in this branch — regression hardening
The
onSelectionChangedchange 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 asTextSpan(children: [...])with a null.text, so the previous code handed callersnull.toPlainText()fixes that, and we've added targeted unit tests to lock the behaviour in and hopefully avoid future regressions:**bold** _italic_code``) are fully concatenated.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
.textisnullfor multi-child content — documenting in-test exactly why the old path returnednulland whytoPlainText()is needed.Also fixed
context_menu_builder_test.dart(added in Add selectable markdown context menu builder #134) was never registered intest/all.dart, soflutter test test/all.dartsilently skipped it. Now registered.Version & changelog
pubspec.yamlto 1.0.10 (patch — additive change with a safe default, consistent with prior patch releases that shipped small features).Validation
dart format . -l 120 --set-exit-if-changed— cleanflutter analyze --no-pub .— no issuesflutter test— 381 tests passRelease step
Publishing is tag-triggered: merging this PR then pushing the
v1.0.10tag publishes to pub.dev (irreversible). Tag push happens after merge + green CI.🤖 Generated with Claude Code
https://claude.ai/code/session_014oVQtXCPb3bSLnL2eDwGrh