Skip to content

chore: fmt#605

Merged
softmarshmallow merged 3 commits intomainfrom
canary
Mar 28, 2026
Merged

chore: fmt#605
softmarshmallow merged 3 commits intomainfrom
canary

Conversation

@softmarshmallow
Copy link
Copy Markdown
Member

@softmarshmallow softmarshmallow commented Mar 28, 2026

Summary by CodeRabbit

  • Refactor
    • Large-scale code formatting and signature/layout cleanup across the codebase for consistency; no functional or behavioral changes.
  • Tests
    • Test and benchmark code reformatted; assertions and helpers unchanged in logic.
  • Chores
    • CI now enforces formatting checks.

No end-user visible changes or API/behavioral regressions introduced.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 28, 2026

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

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Mar 28, 2026 7:31pm
docs Ready Ready Preview, Comment Mar 28, 2026 7:31pm
grida Error Error Mar 28, 2026 7:31pm
viewer Ready Ready Preview, Comment Mar 28, 2026 7:31pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
backgrounds Ignored Ignored Preview Mar 28, 2026 7:31pm
code Ignored Ignored Mar 28, 2026 7:31pm
legacy Ignored Ignored Mar 28, 2026 7:31pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 61ab2d01-7d79-4329-95e1-7127b40513b3

📥 Commits

Reviewing files that changed from the base of the PR and between 2fdaba6 and 3fe2f72.

⛔ Files ignored due to path filters (1)
  • crates/grida-canvas/src/io/generated/mod.rs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • .github/workflows/test-crates.yml

Walkthrough

A wide code-formatting and minor control-flow normalization pass across grida-canvas and related crates. Changes are mostly whitespace/signature formatting and call-site reflow; wasm_text_edit.rs adds explicit multiline early-return branches for null/pointer checks in several extern "C" entrypoints. No API or behavioral semantics were changed.

Changes

Cohort / File(s) Summary
WASM Text Edit
crates/grida-canvas-wasm/src/wasm_text_edit.rs
Added explicit multiline else { return ... } early-return blocks for null/app and pointer-length validation across many #[no_mangle] extern "C" entrypoints; reformatted function parameter layouts. No signature/type changes.
Formatting: Benchmarks & Examples
crates/grida-canvas/benches/*, crates/grida-canvas/examples/*, crates/grida-dev/examples/*
Collapsed/expanded multi-line argument lists, reflowed closures and struct literals; import list tidy-ups. Pure formatting changes, no behavior changes.
Formatting: Core Library Files
crates/grida-canvas/src/** (cache/, compositor/, painter/, surface/, svg/, text_edit/, text/, runtime/, shape/, io/, query.rs, lib.rs)
Reordered some imports, reformatted function signatures and struct literals (multi-line vs single-line), simplified some chained expressions. Mostly cosmetic; notable logical early-return style changes confined to wasm_text_edit.rs.
Tests
crates/grida-canvas/tests/*, crates/grida-canvas/src/text_edit/tests.rs, session_tests.rs, other test files
Reflowed assert!/assert_eq!/println! macros and test literals for readability. No test logic or assertions altered.
CI Workflow
.github/workflows/test-crates.yml
Added fmt job (runs cargo fmt --all -- --check), pinned toolchain in that job, and extended PR trigger paths to include Cargo.lock and rust-toolchain.toml.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: fmt' accurately describes the changeset, which consists entirely of code formatting and refactoring changes across multiple files with no functional modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch canary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/grida-canvas/examples/golden_type_attributed.rs (1)

959-964: ⚠️ Potential issue | 🟠 Major

Resolve the alignement typo flagged by CI.

The struct field ImagePaint::alignement is misspelled. Line 963 uses the field correctly according to the struct definition, but the struct itself uses non-standard English. Either rename the field to alignment throughout the codebase (struct definition + all call sites), or add an exception in .typos.toml if the current spelling is intentional.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/grida-canvas/examples/golden_type_attributed.rs` around lines 959 -
964, The field name ImagePaint::alignement is misspelled; update the ImagePaint
struct definition to use alignment (replace alignement with alignment) and
update every usage site (e.g., the instance construction in
golden_type_attributed.rs and any other references to ImagePaint::alignement) to
the new name; alternatively, if the misspelling is intentional, add an entry to
.typos.toml to whitelist "alignement" so CI stops flagging it—ensure changes are
applied consistently across all modules and tests that reference the field.
🧹 Nitpick comments (1)
crates/grida-canvas/benches/bench_viewport_culling.rs (1)

103-108: Unconventional but valid method formatting.

The multi-line method access pattern (splitting renderer.camera.set_center(...) across 3 lines) is unusual compared to typical Rust formatting, which would keep the entire call on one line. However, this appears to be intentional formatting from oxfmt and doesn't affect functionality.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/grida-canvas/benches/bench_viewport_culling.rs` around lines 103 -
108, This is a stylistic formatting note: the chained method calls for
renderer.camera.set_center(...) and renderer.camera.set_zoom(...) are split
across multiple lines by oxfmt but are functionally correct; if you prefer
conventional Rust formatting, collapse each chained call into a single line
(e.g., call renderer.camera.set_center(...) and renderer.camera.set_zoom(...))
for clarity, otherwise no code change is required since behavior is unaffected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/grida-canvas/examples/golden_type_attributed.rs`:
- Around line 959-964: The field name ImagePaint::alignement is misspelled;
update the ImagePaint struct definition to use alignment (replace alignement
with alignment) and update every usage site (e.g., the instance construction in
golden_type_attributed.rs and any other references to ImagePaint::alignement) to
the new name; alternatively, if the misspelling is intentional, add an entry to
.typos.toml to whitelist "alignement" so CI stops flagging it—ensure changes are
applied consistently across all modules and tests that reference the field.

---

Nitpick comments:
In `@crates/grida-canvas/benches/bench_viewport_culling.rs`:
- Around line 103-108: This is a stylistic formatting note: the chained method
calls for renderer.camera.set_center(...) and renderer.camera.set_zoom(...) are
split across multiple lines by oxfmt but are functionally correct; if you prefer
conventional Rust formatting, collapse each chained call into a single line
(e.g., call renderer.camera.set_center(...) and renderer.camera.set_zoom(...))
for clarity, otherwise no code change is required since behavior is unaffected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73ed2cda-78cc-44b8-afd4-92d3942f0501

📥 Commits

Reviewing files that changed from the base of the PR and between 89b9e84 and 2fdaba6.

⛔ Files ignored due to path filters (1)
  • crates/grida-canvas/src/io/generated/grida.rs is excluded by !**/generated/**
📒 Files selected for processing (74)
  • crates/grida-canvas-wasm/src/wasm_text_edit.rs
  • crates/grida-canvas/benches/bench_camera.rs
  • crates/grida-canvas/benches/bench_viewport_culling.rs
  • crates/grida-canvas/examples/fixtures/l0_type_attributed.rs
  • crates/grida-canvas/examples/golden_corner_radius_backends.rs
  • crates/grida-canvas/examples/golden_curve_decoration.rs
  • crates/grida-canvas/examples/golden_stroke_decoration.rs
  • crates/grida-canvas/examples/golden_stroke_decoration_presets.rs
  • crates/grida-canvas/examples/golden_type_attributed.rs
  • crates/grida-canvas/examples/headless_gpu.rs
  • crates/grida-canvas/examples/skia_bench/skia_bench_atlas.rs
  • crates/grida-canvas/examples/skia_bench/skia_bench_downscale.rs
  • crates/grida-canvas/examples/skia_bench/skia_bench_effects.rs
  • crates/grida-canvas/examples/skia_bench/skia_bench_opacity.rs
  • crates/grida-canvas/examples/skia_bench/skia_bench_primitives.rs
  • crates/grida-canvas/examples/tool_gen_bench_fixture.rs
  • crates/grida-canvas/examples/tool_gen_fixtures.rs
  • crates/grida-canvas/examples/tool_io_grida.rs
  • crates/grida-canvas/examples/tool_svg_batch.rs
  • crates/grida-canvas/src/cache/atlas/atlas.rs
  • crates/grida-canvas/src/cache/atlas/atlas_set.rs
  • crates/grida-canvas/src/cache/compositor/cache.rs
  • crates/grida-canvas/src/cache/compositor/invalidation.rs
  • crates/grida-canvas/src/cache/paragraph.rs
  • crates/grida-canvas/src/cache/scene.rs
  • crates/grida-canvas/src/cg/svg.rs
  • crates/grida-canvas/src/devtools/surface_overlay.rs
  • crates/grida-canvas/src/devtools/text_edit_decoration_overlay.rs
  • crates/grida-canvas/src/hittest/hit_tester.rs
  • crates/grida-canvas/src/io/io_grida.rs
  • crates/grida-canvas/src/io/io_grida_fbs.rs
  • crates/grida-canvas/src/io/io_grida_file.rs
  • crates/grida-canvas/src/io/io_svg.rs
  • crates/grida-canvas/src/layout/engine.rs
  • crates/grida-canvas/src/lib.rs
  • crates/grida-canvas/src/painter/layer.rs
  • crates/grida-canvas/src/painter/painter.rs
  • crates/grida-canvas/src/query.rs
  • crates/grida-canvas/src/runtime/camera.rs
  • crates/grida-canvas/src/runtime/image_repository.rs
  • crates/grida-canvas/src/runtime/pixel_preview.rs
  • crates/grida-canvas/src/runtime/render_policy.rs
  • crates/grida-canvas/src/shape/marker.rs
  • crates/grida-canvas/src/shape/rrect.rs
  • crates/grida-canvas/src/surface/event.rs
  • crates/grida-canvas/src/surface/state.rs
  • crates/grida-canvas/src/surface/ui/render.rs
  • crates/grida-canvas/src/svg/pack.rs
  • crates/grida-canvas/src/svg/sanitize.rs
  • crates/grida-canvas/src/text/attributed_paragraph.rs
  • crates/grida-canvas/src/text/paragraph_cache_layout.rs
  • crates/grida-canvas/src/text_edit/attributed_text/conv.rs
  • crates/grida-canvas/src/text_edit/attributed_text/html.rs
  • crates/grida-canvas/src/text_edit/attributed_text/mod.rs
  • crates/grida-canvas/src/text_edit/history.rs
  • crates/grida-canvas/src/text_edit/layout.rs
  • crates/grida-canvas/src/text_edit/mod.rs
  • crates/grida-canvas/src/text_edit/selection_rects.rs
  • crates/grida-canvas/src/text_edit/session.rs
  • crates/grida-canvas/src/text_edit/session_tests.rs
  • crates/grida-canvas/src/text_edit/simple_layout.rs
  • crates/grida-canvas/src/text_edit/skia_layout.rs
  • crates/grida-canvas/src/text_edit/tests.rs
  • crates/grida-canvas/tests/camera_change_kind.rs
  • crates/grida-canvas/tests/compositor_effects.rs
  • crates/grida-canvas/tests/fbs_roundtrip.rs
  • crates/grida-canvas/tests/flatten_rendiff.rs
  • crates/grida-canvas/tests/shape_to_vector_network.rs
  • crates/grida-canvas/tests/svg_pack.rs
  • crates/grida-canvas/tests/translate_fold_accuracy.rs
  • crates/grida-canvas/tests/viewport_culling.rs
  • crates/grida-dev/examples/bench_cache_picture.rs
  • crates/grida-dev/src/bench/load_bench.rs
  • crates/grida-dev/src/main.rs

… on it

Regenerate committed bindings from format/grida.fbs. Add #[rustfmt::skip]
on the generated module so stable rustfmt does not rewrite flatc output,
keeping the check-generated-fbs CI diff clean.
@vercel vercel Bot temporarily deployed to Preview – blog March 28, 2026 18:20 Inactive
@vercel vercel Bot temporarily deployed to Preview – backgrounds March 28, 2026 18:20 Inactive
@vercel vercel Bot temporarily deployed to Preview – grida March 28, 2026 18:20 Inactive
@vercel vercel Bot temporarily deployed to Preview – viewer March 28, 2026 18:20 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant