Skip to content

Preserve foreground paint order for content with decorative tails #1074

Description

@chubes4

Problem

Sibling stacking heuristics can classify an entire text-bearing foreground component as a decorative underlay because one descendant protrudes from its box. In Fisiostetic, a speech bubble with a decorative tail is ranked below the hero image even though source order paints the bubble above it.

Fresh Fisiostetic trunk evidence:

  • Hero image node 20:72 emits z-index:2.
  • Bubble instance 20:64 emits z-index:1.
  • The bubble appears after the image in source/emission order and contains visible text.
  • LayoutIntentClassifier::siblingLayerRole() treats hasProtrudingDecorativeUnderlay() as evidence that the containing node itself is an underlay.

Owning contract

A content-bearing foreground node may own decorative protrusions without becoming a decorative underlay. Semantic role heuristics must not invert explicit/source paint order for overlapping foreground content.

Acceptance

  • A text-bearing speech bubble with a protruding tail remains above an earlier overlapping image.
  • The tail can still extend outside the bubble and participate in local isolation.
  • True decorative plates/tracks remain underlays.
  • Existing hero top-strip behavior remains covered without treating arbitrary foreground content as underlay.
  • Add deterministic stacking contract coverage for both cases.

AI assistance

OpenAI GPT-5.6 Sol via OpenCode reproduced the defect on current trunk, traced the sibling-role ranking, and helped formulate the acceptance contract. Chris Huber remains responsible for the resulting change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions