)]}'
{
  "commit": "f53cc85d4dce4f2ae574dfdf0e2aec3acbc86f7e",
  "tree": "f64f98acfd2f88bdd0b68d8e26fa4abcabda84e2",
  "parents": [
    "5d536e7b801c6b2bb9d2645041a78f9c1408df42"
  ],
  "author": {
    "name": "Renzo Olivares",
    "email": "rmolivares@renzo-olivares.dev",
    "time": "Thu Apr 02 13:08:06 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Apr 02 20:08:06 2026 +0000"
  },
  "message": "Fix line breaks being lost when copying after selection gesture in SelectableRegion (#184421)\n\nOriginal discussion: https://github.com/flutter/flutter/pull/184043\n\nFixes #154253 \n\nBefore this change the `_rect` used by `_SelectableFragment` was\ncalculated using `getBoxesForSelection` which defaults to a\n`BoxHeightStyle` of `BoxHeightStyle.tight`. This style ensures the boxes\nreturned from `getBoxesForSelection` tightly wrap each character. This\nwas causing an issue when text ended or was split on new lines because\nthe `SelectableFragment._rect` did not include the region that actually\nhad the new lines. So when `_SelectableFragment` internally used\n`SelectionUtils.adjustDragOffset` to clamp the position to the\nselectable rect, the selectable rect is inaccurate and always results in\na position that is above the new line and not on it.\n\nAfter this change the `_rect` used by `_SelectableFragment` is\ncalculated using `getBoxesForSelection` with a `BoxHeightStyle` of\n`BoxHeightStyle.max`. This style ensures the boxes returned from\n`getBoxesForSelection` cover the entire height of the line, and as a\nresult including the new line character region.\n\nOther notes:\n\n`TextPainter.getBoxesForSelection` explicitly notes that leading or\ntrailing new line characters will be represented by zero-width boxes.\n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [x] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [x] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [x] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [x] I signed the [CLA].\n- [x] I listed at least one issue that this PR fixes in the description\nabove.\n- [x] I updated/added relevant documentation (doc comments with `///`).\n- [x] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [x] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [x] All existing and new tests are passing.\n\n---------\n\nCo-authored-by: Renzo Olivares \u003croliv@google.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "91ed4ac4b910ea5c8eaee6483fe898bfe15ec5be",
      "old_mode": 33188,
      "old_path": "examples/api/test/material/selection_area/selection_area.2_test.dart",
      "new_id": "d97c35bc2db506b11a857c5b61649bf6b8fa68fb",
      "new_mode": 33188,
      "new_path": "examples/api/test/material/selection_area/selection_area.2_test.dart"
    }
  ]
}
