Skip to content

[FIX] copy paste urls handling in markdown edit view - #3078

Open
rutvik-at-pieces wants to merge 38 commits into
Flutter-Bounty-Hunters:mainfrom
pieces-app:fix_copy_paste_urls_handling
Open

[FIX] copy paste urls handling in markdown edit view#3078
rutvik-at-pieces wants to merge 38 commits into
Flutter-Bounty-Hunters:mainfrom
pieces-app:fix_copy_paste_urls_handling

Conversation

@rutvik-at-pieces

Copy link
Copy Markdown

Summary

What changed

Checklist

  • I have reviewed the code changes
  • I have updated documentation if needed
  • Any relevant GitHub Actions or workflows are included

sam-p-at-pieces and others added 30 commits June 9, 2025 16:07
feat: remove ignore pointer so gesture detection works
Introduces ContentTapExclusion to allow subtree widgets to bypass SuperReader's tap gesture handling, enabling direct tap handling for inline widgets such as placeholders. Updates gesture recognizers to consult a pointer predicate, preventing tap interception when over inline placeholders. Refactors hit testing in sliver hybrid stack for correct child hit aggregation.
Moved tap exclusion logic for inline placeholders to a shared function, isTapAllowedAtDocumentPosition, in content_tap_exclusion.dart. Updated Android, iOS, and mouse interactors to use this function for consistent tap handling over inline widgets.
Introduces a markdown document explaining the rationale, implementation, and usage of tap exclusion for inline widgets in SuperEditor. Details the ContentTapExclusion marker, shared tap-allowance utility, and updates to interactors for consistent tap handling across platforms.
Enable tap exclusion for inline widgets in SuperReader
Introduces a scrollingEnabled property to SuperReader, DocumentScaffold, DocumentScrollable, and related touch/mouse interactors. This flag allows enabling or disabling user scrolling and auto-scrolling behaviors, providing more control over document interaction. All relevant auto-scroller logic and gesture handlers now respect this flag.
Rename constant from displayLatextAttribution to displayLatexAttribution and add a brief doc comment. The underlying attribution key ('display-latex') is unchanged; this cleans up a typo in the API name and may require updating any external references to the old identifier.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Bump Dart SDK constraint to `>=3.6.0` across all sub-packages
- Add `resolution: workspace` to all `pubspec.yaml` files
- Create `pubspec_overrides.yaml` where required for workspace unification
- Unify dependency versions within the Pieces dev environment mono-workspace

Branch: chore/unify-dependencies
Base: main
Related to: cross-repo workspace change affecting 50 repositories
- Update imageBuilder lambda signatures in 3 test files to match
  new API requiring named parameters:
  - super_editor/test/super_editor/supereditor_components_test.dart
  - super_editor/test/super_editor/supereditor_test_tools.dart
  - super_editor_markdown/test/test_tools.dart
- Old signature: (context, imageUrl) => ...
  New signature: (context, {required String imageUrl, String altText = ''}) => ...
- The upstream ImageComponentBuilder now passes imageUrl and altText
  as named parameters; these test fakes must match the new typedef
- Enables workspace compatibility with the unified super_editor version

Branch: chore/unify-dependencies
…ditor packages

- Bump Dart SDK constraints to >=3.6.0 across all sub-packages
  (super_editor, super_editor_markdown, super_editor_quill,
  super_editor_spellcheck, super_keyboard)
- Fix deprecated API usage in magnifier, gesture, and spellcheck files
…ncies

# Conflicts:
#	super_editor/example/pubspec.yaml
#	super_editor/example_chat/pubspec.lock
#	super_editor/lib/src/super_reader/read_only_document_android_touch_interactor.dart
#	super_editor/lib/src/super_reader/read_only_document_ios_touch_interactor.dart
#	super_editor/lib/src/super_reader/read_only_document_mouse_interactor.dart
#	super_editor/lib/super_editor.dart
#	super_editor/pubspec.yaml
#	super_editor_clipboard/pubspec.yaml
#	super_editor_spellcheck/example/pubspec.lock
#	super_editor_spellcheck/lib/src/super_editor/spelling_error_suggestion_overlay.dart
#	super_editor_spellcheck/pubspec.yaml
#	super_keyboard/example/pubspec.lock
- super_editor_quill: Convert 7 src files to re-export from
  super_editor core (serialization code consolidated upstream).
  Resolves 124 ambiguous_import errors.
- super_editor core: Apply 273 dart fix auto-fixes
  (use_super_parameters, always_use_package_imports, etc.)
- super_editor_markdown: Already fixed (re-exports from core)
- super_editor_clipboard: Already fixed (vendored html2md)
- Website/docs: Fix .text -> .toPlainText() deprecation
- super_editor_markdown tests: Remove redundant package:super_editor_markdown
  imports from 9 test files (symbols now exported via super_editor core)
- super_editor_quill tests: Update import to use core test barrel
- super_editor core: Fix 5 warnings (2 override_on_non_overriding_member,
  1 unused_element, 2 unused_field)
- Remaining 7 invalid_use_of_protected_member warnings are intentional
  upstream test utilities accessing protected members
Version corrected to 0.3.0-dev.48. Added upstream sync history
documenting the February 2026 merge, package consolidations, and
issues encountered.
- Fix 7 compilation errors: update translateByDouble/scaleByDouble
  to 4-arg signatures (Flutter 3.27), fix showWithItems to pass
  default menu items for iOS system context menu
- Migrate computeTextSpan -> computeInlineSpan in attributed text
  styles tests (9 sites, converted to testWidgets for BuildContext)
- Remove disableLongPressSelectionForSuperlist from Android/iOS
  selection tests (Superlist-only flag, not needed)
- Suppress 32 RegExp deprecation warnings (Dart 3.6 will make RegExp
  final; can't migrate because markdown package requires RegExp
  getter overrides)
- Add ignore comments for intentional backward-compat bridges
  (textInputAction, onRightClick)

Result: "No issues found!" across all 4 sub-packages.
- Fix upstream copy-paste bug in ios_textfield.dart: toolbarTopAnchor
  was used for both top and bottom anchors, creating a zero-height rect
  for iOS system context menu positioning. Changed line 847 to use
  toolbarBottomAnchor.
- Convert super_editor_quill testing/quill_delta_comparison.dart from
  duplicated code (122 lines) to a re-export from core, consistent
  with all other consolidated files.
- Remove `resolution: workspace` from all `pubspec.yaml` files.
- Unify dependency management across various sub-packages.
- Affected 14 `pubspec.yaml` files including `attributed_text`, `super_editor`, `super_keyboard`, and related example packages.

Branch: dev
Base: main
Related to: cross-repo workspace change affecting 62 repositories
…atures

Merge upstream main, unify dependencies, and enhance editor features
Pin flutter_test_runners to the super_keyboard-compatible range and remove the conflicting example-level super_text_layout path dependency so standalone flutter pub resolution succeeds.
tsavo-at-pieces and others added 8 commits March 2, 2026 15:17
…editor

fix(deps): unblock standalone pub resolution in super_editor
Match super_keyboard and related package test runner constraints to compatible versions and bump super_editor to super_keyboard ^0.3.1 to unblock workspace resolution.
…gnment

fix(deps): align super_editor test runner constraints
Range merged: 068a20d..13e7538 (Feb 16 -- May 7, 2026).

Version bumps adopted from upstream:
  super_editor          0.3.0-dev.48 -> 0.3.0-dev.51
  super_editor_clipboard       0.2.5 -> 0.2.10
  super_text_layout            0.1.19 -> 0.1.20
  super_keyboard               0.3.1 -> 0.4.0
  attributed_text              0.4.5 -> 0.4.7

Highlights gained from upstream:
  - 5 IME stability fixes (Samsung/SwiftKey/GBoard, including the zombie
    IME client bug when one SuperEditor replaces another).
  - Clipboard paste fixes (Flutter-Bounty-Hunters#2919, Flutter-Bounty-Hunters#2926-Flutter-Bounty-Hunters#2929, Flutter-Bounty-Hunters#2933, Flutter-Bounty-Hunters#2935): native paste,
    per-format custom pasting from iOS, Markdown paste, ignore <script>/<style>.
  - Editor UX: multi-trigger tags, auto-convert list items mid-paragraph
    (Flutter-Bounty-Hunters#2984), configurable list continuation (Flutter-Bounty-Hunters#2987), popover toolbars on
    tablets / non-software-keyboard situations (Flutter-Bounty-Hunters#2994).
  - iOS: backspacing empty text nodes (Flutter-Bounty-Hunters#2989).
  - Flutter SDK adapt: TextInputConnectionDecorator.updateStyle (Flutter-Bounty-Hunters#2950).
  - SuperText now supports maxLines + overflow indicator (Flutter-Bounty-Hunters#2922).
  - attributed_text: rewrote getAttributionSpansInRange for performance
    (Flutter-Bounty-Hunters#3010), then a regression fix for SuperEditor pattern tags (Flutter-Bounty-Hunters#3013).
  - super_editor_markdown / super_editor_quill packages deleted upstream
    (consolidated into super_editor core in dev.40/dev.41); we removed
    the orphaned directories as part of this merge.

Conflict resolutions (5 real conflicts):
  - super_editor/lib/src/default_editor/text.dart -- preserved fork PR #1
    (no IgnorePointer wrapper in TextComponent.build) while adopting
    upstream's new SuperText maxLines/overflow props and migrating
    hintText to computeInlineSpan(...). Inline comment added to make
    the divergence intentional and discoverable.
  - super_editor/lib/src/default_editor/default_document_editor_reactions.dart
    -- accepted upstream's two-pattern (empty / non-empty paragraph)
    list-item conversion logic from Flutter-Bounty-Hunters#2984 (strict improvement over our
    single-pattern + deprecated_member_use ignore).
  - super_editor/lib/src/default_editor/document_ime/document_delta_editing.dart
    -- removed duplicate document_serialization.dart import.
  - super_editor/pubspec.yaml -- adopted upstream super_text_layout ^0.1.20
    and super_keyboard ^0.4.0 dep bumps.
  - super_editor/example/pubspec.yaml -- kept fork's monorepo-friendly
    path: deps (instead of upstream's git: URL form), bumped
    super_keyboard to ^0.4.0 and follow_the_leader to ^0.5.3.

Modify/delete conflicts (35+ files): accepted upstream deletions of
super_editor_markdown/** and super_editor_quill/**, and kept fork's
policy of not tracking */example/pubspec.lock files.

All 5 fork-only customizations verified intact post-merge:
  PR #1 -- no IgnorePointer in TextComponent (text.dart)
  PR #3 -- ContentTapExclusion in SuperReader gesture pipeline
  PR #4 -- scrollingEnabled flag on document widgets
  PR #5 -- displayLatexAttribution in attributions.dart
  PR #6 -- ImageComponent custom imageBuilder + altText + pointer events

Note on resolution: workspace: per the runtime_ci pre-commit hook policy,
resolution: workspace lines are intentionally stripped before commit
(committed pubspecs must remain publishable to pub.dev). Workspace-mode
adds remain as local working-tree edits in dev.

FORK_CHANGES.md rewritten:
  - Replaced stale "~0 commits behind" claim with verifiable drift command.
  - Added 2026-05-09 sync entry documenting range, version bumps, and
    every conflict resolution.
  - Documented each fork PR's location so future syncs can grep + verify.
…lutter 3.35-3.40 compat)

Upstream commit b422c32 (PR Flutter-Bounty-Hunters#2950, Feb 2026) added:

  @OverRide
  void updateStyle(TextInputStyle style) => client?.updateStyle(style);

to TextInputConnectionDecorator in anticipation of Flutter's
"Deprecate TextInputConnection.setStyle" breaking change
(flutter/flutter#180436), which adds TextInputConnection.updateStyle(
TextInputStyle) and deprecates setStyle(...).

Per docs.flutter.dev/release/breaking-changes/deprecate-text-input-
connection-set-style (last updated 2026-03-03), the change is "Landed
in version: TBD / In stable release: Not yet."

Our pinned Flutter is 3.35.7 (`flutter --version`):
  - flutter-sdk-3.35.5/packages/flutter/lib/src/services/text_input.dart
    declares only `void setStyle({...})`. There is no `class TextInputStyle`
    and no `void updateStyle(...)` on TextInputConnection.
  - TextInputConnectionDecorator implements TextInputConnection, so the
    override fails to compile: "TextInputStyle isn't a type" + "method
    updateStyle isn't defined for the type TextInputConnection".

There is no Dart conditional-imports trick that can selectively
include an interface override based on host SDK version (conditional
imports switch libraries, not class members).

Fix: drop the override and replace it with a comment block that:
  - Explains the upstream origin (PR Flutter-Bounty-Hunters#2950, commits 4703643 / b422c32).
  - Cites the Flutter breaking-change doc.
  - Documents restore criteria (when Flutter ships TextInputStyle in
    stable AND we upgrade past that release).

This is a no-op functionally on stable Flutter: setStyle(...) above
already covers the entire surviving public API; the framework can't
call a method that doesn't exist on the parent class.

Tracked as fork divergence #6 in FORK_CHANGES.md, marked as
TEMPORARY. Will be re-asserted on each upstream sync until either
upstream gates this on a Flutter version constraint or we upgrade
past the TextInputStyle-shipping stable release.

Refs: #13 (parent merge PR)
Sync upstream/main (2026-05): 40 commits — IME stability, clipboard fixes, attributed_text perf, super_keyboard 0.4.0
…port

Restores the updateStyle method in TextInputConnectionDecorator, which allows for updating text input styles via the client. This change anticipates future Flutter updates that will support TextInputStyle, while currently maintaining compatibility with existing APIs. The previous temporary removal of this method was due to Flutter's lack of support for TextInputStyle in stable releases.
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.

4 participants