Skip to content

Commit cd2bc14

Browse files
authored
feat(grid): part2 & part3 (#762)
1. add repeat auto-fill/fit-content parsing & serialization 2. add repeat auto-fill/fit-content parsing & serialization 3. support auto-flow and grid-area 4. add some integration tests <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** - Expanded CSS Grid: named lines, template areas, auto-fit/auto-fill, minmax/fit-content sizing, per-item alignment, and new shorthand support (grid, grid-template, place-content, place-self, grid-area); added justify-items and justify-self. * **Tests** - Large suite of new and enhanced grid integration/unit tests covering auto-placement, track sizing, shorthands, template areas, dense flows, and visual snapshots. * **Documentation** - Updated roadmap/plan with Phase 4/5 progress and next steps for shorthands, parsing, and hardening. * **Chore** - Added ignore rule for .preview-bundles/* in VCS ignore. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents d271d68 + 5286e4b commit cd2bc14

File tree

67 files changed

+12587
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+12587
-229
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ pubspec.lock
6969
.fvm
7070

7171
**/.claude/settings.local.json
72+
.preview-bundles/*

CSS_GRID_PLAN.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
- **Phase 4 – Alignment & Template Features**
4747
- Add `justify-content`, `align-content`, `justify-items`, `align-items`, per-item overrides, and template serialization (`grid-template-rows/columns`).
4848
- Extend parsing for `repeat()`, `minmax()`, and named lines/areas if planned for MVP.
49+
- Status: per-item alignment plus `place-*` shorthands now have widget + integration coverage, and `grid-auto-flow: row|column dense` behavior is verified through layout assertions.
4950
- Tests: alignment-focused widget suites, computed-style integration checks.
5051

5152
- **Phase 5 – Hardening & Docs**
@@ -67,18 +68,23 @@
6768
- **Docs & Communication:** Keep `dev_css_grid_process.md` and CSS_GRID_PLAN.md updated; highlight new capabilities in release notes when features stabilize.
6869

6970
**Next Steps**
70-
Computed-style serialization + tests for grid templates/placements are now in tree (see `grid_computed_style_test.dart` and `css-grid/computed-style.ts`). Upcoming focus areas:
71+
Track sizing/placement for MVP grids now ships with widget + integration coverage, and per-item alignment plumbing is partially in-tree. Upcoming focus areas:
7172

72-
1. Continue Phase 3 track sizing/placement: add implicit rows + column-flow growth, improve gap accounting, and honor fr/percentage mixes for auto tracks.
73-
2. Add alignment/template serialization refinements plus docs as features land.
74-
3. Capture layout/perf findings in `dev_css_grid_process.md` alongside new coverage as features flip on.
73+
1. Begin Phase 5 hardening by profiling `RenderGridLayout` hot paths (auto-placement + track resolution), enumerating slow cases, and sketching caching/intrinsic sizing fixes.
74+
2. Implement the `grid` shorthand property (per MDN / CSS Grid 1) as a thin layer over existing longhands (`grid-template-*`, `grid-auto-*`), covering the common `none`, template, and auto-flow forms and deferring subgrid/masonry keywords per non-goals.
75+
3. Add a basic `grid-template` shorthand (rows/columns/areas) parser to align with authors’ expectations for shorthand usage while still delegating storage to existing typed fields.
76+
4. Expand track-size parsing to gracefully ignore unsupported keywords like `min-content`/`max-content` in grid track lists (where they are not yet wired into layout), and document the current support level in `dev_css_grid_process.md`.
77+
5. Stress-test grid layouts inside representative app flows (dashboard, list virtualization) to validate performance/behavioral stability before GA.
78+
6. Flip on `DebugFlags.enableCssGridProfiling` during perf sessions to capture per-grid timing for materialization, placement, and child layout.
79+
7. Continue filling integration matrix: template-area happy-path + auto-fit/place-content + template-area overlap/unknown-area cases landed; next targets are shorthand-centric specs (e.g., `grid` / `grid-template`) and dense auto-fill dashboards with per-item overrides.
7580

7681
**TODOs**
7782
- [x] Capture overview/goals/scope plus risks and rollout strategy.
78-
- [ ] Land Phase 1 plumbing (display enum, CSSGridMixin, shorthand parsing, auxiliary helpers).
79-
- [ ] Add Phase 1 widget + integration tests (parsing/computed style) and wire to spec group.
83+
- [x] Land Phase 1 plumbing (display enum, CSSGridMixin, shorthand parsing, auxiliary helpers).
84+
- [x] Add Phase 1 widget + integration tests (parsing/computed style) and wire to spec group.
8085
- [x] Implement `RenderGridLayout` skeleton and hook creation paths.
81-
- [ ] Implement full track sizing/placement (Phase 3) with tests.
82-
- [ ] Extend alignment/template features (Phase 4) with serialization and coverage.
86+
- [x] Implement full track sizing/placement (Phase 3) with tests.
87+
- [x] Extend alignment/template features (Phase 4) with serialization and coverage (per-item alignment + computed styles partially landed).
8388
- [x] Complete computed-style serialization and integration specs for grid properties.
8489
- [ ] Profile and harden grid layout (Phase 5), updating docs/examples.
90+
- [ ] Add `grid` and `grid-template` shorthands on top of existing longhands, with focused integration specs under `integration_tests/specs/css/css-grid`.

integration_tests/lib/playground.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ void main() async {
3939
// FlexLog.enableAll();
4040
// FlowLog.enableAll();
4141
// PositionedLayoutLog.enableAll();
42-
DebugFlags.enableCssGridLayout = true;
4342
// debugPaintBaselinesEnabled = true;
4443
// DebugFlags.enableDomLogs = true;
4544
// DebugFlags.enableCssLogs = true;

0 commit comments

Comments
 (0)