Conversation
Placement only took the explicit-row path when the column was also explicit. An item with `grid-row: 3` and no `grid-column` fell through to row-major auto-placement, which starts from the cursor and steps down a row whenever it runs out of columns — discarding the row the item asked for and leaving it in row 1. A definite row with an auto column fixes the row and searches only for a free column within it. Where the row has no free slot the spec grows the grid with implicit columns; those aren't sized here, so the start is clamped to keep the item inside the explicit tracks rather than indexing past them. The item still marks its cell occupied, so later auto-placed items flow around it instead of stacking on top. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grid placement only took the explicit-row path when the column was also explicit:
So an item with
grid-row: 3and nogrid-columnfell through to row-major auto-placement, which starts from the cursor and steps down a row whenever it runs out of columns — discarding the row the item asked for and leaving it in row 1.A definite row with an auto column now fixes the row and searches only for a free column within it. Where the row has no free slot the spec grows the grid with implicit columns; those aren't sized here, so the start is clamped to keep the item inside the explicit tracks rather than indexing past them.
The item still marks its cell occupied, so later auto-placed items flow around it instead of stacking on top — the second assertion in the test covers that, since a fix that only positioned the item without recording the cell would leave them overlapping.
Verification
cargo test --workspacepasses; the new test fails without the change (pinned item should sit in row 3 at y+40, got 0).Confirmed end-to-end through WebDriver: in a 5×5 explicit grid,
grid-row: 3now measures aty+40in the first column, where it previously measured at the origin.This also completes the single-value
grid-areaform from #137 — that PR parsesgrid-area: 3into a definite row with an auto column, which is exactly the case this fixes. The two are independent and merge cleanly in either order; with both applied,grid-area: 3lands in row 3.Made with Cursor