)]}'
{
  "commit": "2a2a79d36624ad55d237579f7aae766d94eb2124",
  "tree": "bfc4fc9087a674f64ffb59e31dd5ff869fb0f3a3",
  "parents": [
    "5f8d728e02f4a54791debbcc510a764ce1f12cc9"
  ],
  "author": {
    "name": "Elliott Brooks",
    "email": "21270878+elliette@users.noreply.github.com",
    "time": "Wed Jul 22 17:04:35 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jul 22 17:04:35 2026 +0000"
  },
  "message": "Clear cached directional focus history on a non-directional focus request  (#187957)\n\nFixes https://github.com/flutter/flutter/issues/85941\n\nWhen a user traverses focus nodes directionally (e.g. using `up`, `down`\narrow keys), we maintain a history stack of visited nodes (called\n`policyData`). This allows us to avoid\n[hysteresis](https://en.wikipedia.org/wiki/Hysteresis) when a user\nswitches direction (i.e. switching from `down` to `up`) - meaning, the\nforward traversal path and the reversed traversal path should match.\n\nHowever, before this change, we were not detecting when a focus request\noccurred due to some outside event (e.g. a direct focus request from a\ntap on the screen). That means when a user switched direction, we would\ninclude the node they had tapped on in the history stack, and\nunexpectedly visit it.\n\nWe now clear the stack (see method `propagateFocusRequest`) if a node is\nfocused on outside of a directional navigation event.\n\n**Before:**\n\n\u003cimg width\u003d\"454\" height\u003d\"656\" alt\u003d\"before\"\nsrc\u003d\"https://github.com/user-attachments/assets/26e3cdd2-2f39-4dc8-9616-4f21d4afcc52\"\n/\u003e\n\n**With fix:**\n\n\u003cimg width\u003d\"454\" height\u003d\"656\" alt\u003d\"fixed\"\nsrc\u003d\"https://github.com/user-attachments/assets/0e795e0c-8e07-4422-beed-f371407b4ae6\"\n/\u003e\n\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\nIf you need help, consider asking for advice on the #hackers-new channel\non [Discord].\n\nIf this change needs to override an active code freeze, provide a\ncomment explaining why. The code freeze workflow can be overridden by\ncode reviewers. See pinned issues for any active code freezes with\nguidance.\n\n**Note**: The Flutter team is currently trialing the use of [Gemini Code\nAssist for\nGitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).\nComments from the `gemini-code-assist` bot should not be taken as\nauthoritative feedback from the Flutter team. If you find its comments\nuseful you can update your code accordingly, but if you are unsure or\ndisagree with the feedback, please feel free to wait for a Flutter team\nmember\u0027s review for guidance on which automated comments should be\naddressed.\n\n\u003c!-- Links --\u003e\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview\n[AI contribution guidelines]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n[test-exempt]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md\n[Features we expect every widget to implement]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement\n[CLA]: https://cla.developers.google.com/\n[flutter/tests]: https://github.com/flutter/tests\n[breaking change policy]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes\n[Discord]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md\n[Data Driven Fixes]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "137aa549b36a31ff3ed8f055b67575e54d65e5a9",
      "old_mode": 33188,
      "old_path": "packages/flutter/lib/src/widgets/focus_traversal.dart",
      "new_id": "e54eb5fbcd3b80659d3676d1f53fff9b98830939",
      "new_mode": 33188,
      "new_path": "packages/flutter/lib/src/widgets/focus_traversal.dart"
    },
    {
      "type": "modify",
      "old_id": "e16e5247082be53d7f71b4aa245c2998d29c1ccc",
      "old_mode": 33188,
      "old_path": "packages/flutter/test/widgets/focus_traversal_test.dart",
      "new_id": "0d5697b8e571cb5e6e1abd1591cc77168e14da01",
      "new_mode": 33188,
      "new_path": "packages/flutter/test/widgets/focus_traversal_test.dart"
    }
  ]
}
