Skip to content

Fix grid-area resolution edge cases in resolve_absolute_grid_area - #1167

Merged
nicoburns merged 3 commits into
mainfrom
devin/1787430000-grid-area-fixes-standalone
Aug 25, 2026
Merged

Fix grid-area resolution edge cases in resolve_absolute_grid_area#1167
nicoburns merged 3 commits into
mainfrom
devin/1787430000-grid-area-fixes-standalone

Conversation

@nicoburns

Copy link
Copy Markdown
Member

Objective

Fix edge cases in DetailedGridTracksInfo::resolve_absolute_grid_area where the resolved area diverged from browser behaviour (verified against Chrome via new generated fixtures):

  • Out-of-grid check ran before normalization. Placements are now resolved to a pair of sorted lines first, and only then are lines falling outside the grid treated as auto. Pseudo-diff:
      placement
        .resolve_line_names(...)
        .into_origin_zero(...)
    -   .map(|p| if line out of [min_line, max_line] { Auto } else { p })
        .resolve_absolutely_positioned_grid_tracks()
    +   .map(|line| line.filter(|l| min_line <= l && l <= max_line))
    This makes e.g. grid-column: 3 / 1 (swapped lines) and a non-existent named line like foo / 3 (which resolves past the explicit grid end) match Chrome: on a 2-column grid, foo / 3 resolves to the area between line 3 and the end padding edge.
  • Empty axes. An axis with no tracks still contains one grid line, positioned by content alignment. DetailedGridTracksInfo gains a pub empty_axis_line: Option<f32> field recording that line's position, used as a fallback before the padding-edge fallback.

Context

Extracted from the OOF-hoisting stack (#1147, originally in #1145) since it applies to main independently — resolve_absolute_grid_area already exists here. The stack will be restacked without this commit once it lands.

Also adds named-line support (grid-template-columns/rows line names and named placements) to the gentest fixture format, plus 5 Chrome-generated fixtures covering out-of-range lines, unknown/known named lines, padding-edge lines, and empty grids.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/65c5463061c8403bade7888271d5eeb4
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/65c5463061c8403bade7888271d5eeb4?variant=devin-insiders
Requested by: @nicoburns

@staging-devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nicoburns
nicoburns merged commit 9ba171a into main Aug 25, 2026
28 checks passed
@nicoburns
nicoburns deleted the devin/1787430000-grid-area-fixes-standalone branch August 25, 2026 16:57
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.

1 participant