PatchbayRevealPolicy typedef

PatchbayRevealPolicy = PatchbayRevealDecision Function(PatchbaySemanticsTarget container, PatchbayRevealDirection direction)

接入方对「允不允许把这块区域往内容深处推」的判断。

入参是容器而不是目标:reveal 的核心场景里目标根本不存在,唯一存在的、 也是真正被移动的东西是容器。direction 是本次调用请求的内容序方向,不是最终 落到的 SemanticsAction——否则布局方向知识就要写进 policy 实现。

container.identifier该容器最内层的锚点 identifier,不一定是滚动语义 节点自己的 identifier:锚点按惯例包在 Scrollable 外层,滚动节点自身几乎从不 带 identifier。查找沿 parent 向外取第一个非空 identifier,遇到另一个滚动 节点即停,因此外层容器的身份不会被误安到内层容器上;一个锚点都没有的容器给出 空串,接入方应当把它按「未声明的区域」处理。

Implementation

typedef PatchbayRevealPolicy =
    PatchbayRevealDecision Function(
      PatchbaySemanticsTarget container,
      PatchbayRevealDirection direction,
    );