Skip to content

feat: CSS Grid UI#5614

Open
kof wants to merge 58 commits intomainfrom
grid
Open

feat: CSS Grid UI#5614
kof wants to merge 58 commits intomainfrom
grid

Conversation

@kof
Copy link
Member

@kof kof commented Feb 12, 2026

Description

  1. What is this PR about (link the issue and add a short description)

Steps for reproduction

  1. click button
  2. expect xyz

Code Review

  • hi @kof, I need you to do
    • conceptual review (architecture, feature-correctness)
    • detailed review (read every line)
    • test it on preview

Before requesting a review

  • made a self-review
  • added inline comments where things may be not obvious (the "why", not "what")

Before merging

  • tested locally and on preview environment (preview dev login: 0000)
  • updated test cases document
  • added tests
  • if any new env variables are added, added them to .env file

kof added 30 commits February 11, 2026 17:52
- Add 'grid' and 'inline-grid' to display dropdown options
- Implement GridVisual component showing grid structure (2×2 default)
- Visual grid preview with Figma-style bordered cells
- Color-coded by style source (local/remote/overwritten)
- Accessible with keyboard navigation and ARIA labels
- Performance optimized with useMemo for grid cells
- Parse grid-template-columns/rows to show accurate track counts
kof added 13 commits February 11, 2026 17:52
…oning modes

- Add Position mode toggle with Auto/Area/Manual options
- Auto mode: Column/Row span inputs using SpanInput component
- Area mode: Named grid area selection from parent grid
- Manual mode: Grid line position inputs with validation
- Automatic property conversion when switching between modes
- Use useLocalValue for proper state management in Manual mode
- Add Select min-width CSS to match trigger width
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
@vercel
Copy link

vercel bot commented Feb 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webstudio-builder Error Error Feb 15, 2026 11:49am

Request Review

kof added 13 commits February 15, 2026 11:52
The position tab (Auto/Area/Manual) now correctly reflects the
actual grid positioning of each instance when switching between
them, rather than always defaulting to 'Auto'.

- Add derivePositionMode function to analyze CSS values
- Detect manual mode when numeric line values exist
- Detect area mode when named grid areas are used
- Detect auto mode when values are 'auto' or span tuples
- Add comprehensive tests for derivePositionMode
Remove the ref indirection and inline the swap logic directly
in the onSort callback, matching the pattern used in repeated-style.tsx
Replace titleCase conversions with explicit singular/plural labels map
for better clarity and i18n readiness
…arser

- Add parseGridTemplateTrackList/serializeGridTemplateTrackList to @webstudio-is/css-data
  - Supports minmax(), fit-content(), repeat() expansion, line names
  - 23 comprehensive test cases

- Rename components for clarity:
  - FlexVisual → FlexAlignment
  - GridVisual → GridGenerator + GridAlignment (split)
  - GridSizePicker → GridGenerator

- Consolidate grid-areas.utils.ts into grid-areas.tsx

- Improve state management in LayoutSectionGrid:
  - Single openPanel state prevents multiple panels open simultaneously

- Fix CssValueListItem label truncation with overflow: hidden

- Update imports in grid-child.tsx for new file structure
- Add parseMinmax/serializeMinmax functions to @webstudio-is/css-data
- TrackItem editor shows checkbox to toggle between single value and min/max mode
- When minmax is enabled, displays two inputs for min and max values
- Auto-detects existing minmax() values and parses them into the inputs
- Syncs state when track prop changes (supports undo/redo, external edits)
- Add checkGridTemplateSupport() to detect unsupported grid features
- Support CSS variables (resolved via computedValue)
- Show disabled state with tooltips for subgrid, masonry, line-names
- Allow auto-fit/auto-fill in grid generator with DOM-based counts
- Fix grid outlines to use computed style for track counts
- Rename grid-overlay to grid-outlines for consistency
- Add columnCount/rowCount to GridCellData for grid generator
- Add GridAxisMode type and getGridAxisMode() to analyze grid values
- Add isImplicitGridMode() to detect modes needing DOM probing
- Add isEditableGridMode() to detect modes editable in visual UI
- Add getGridAxisLabel() for consistent label generation
- Refactor grid-generator.tsx to use new pure functions
- Refactor grid-settings.tsx to use new pure functions
- Fix grid-areas.tsx to use parseGridTemplateTrackList
- Update tests to match correct parser behavior
Show '?' for unknown track counts instead of blocking the UI.
Users can still override with explicit grid values.
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