refactor(paint): extract transforms/stacking/clip_path helpers from paint/mod.rs - #164
Conversation
…aint/mod.rs Moves three cohesive helper clusters out of the 2957-line `paint/mod.rs` into dedicated sibling modules: - `paint/transforms.rs` — `transforms_have_3d`, `resolve_transform_origin`, `resolve_perspective_origin`, `compute_transform_matrix`, `compute_transform_offsets` (+ unit tests) - `paint/stacking.rs` — `creates_stacking_context`, `creates_compositing_layer`, `is_positioned` - `paint/clip_path.rs` — `resolve_clip_path_rect`, `intersect_rects` (+ the 3 clip-path tests that lived in mod.rs, plus 2 new `intersect_rects` tests) `paint/mod.rs` keeps these names available via `pub(crate) use` re-exports, so `record.rs` (the only sibling caller, via `super::`) needs no change. `paint_box`'s `preserve3d_child_z` helper stays in mod.rs because it threads `PaintContext`. Result: mod.rs shrinks from 2957 → 2584 lines (-373). All 1954 oasis-browser unit tests pass; workspace clippy is clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Claude AI Security & Correctness ReviewIssues (if any)(none) Previous Issues (for incremental reviews)(none) Suggestions (if any)
Notes
Generated by Claude AI (sonnet). Supplementary to human reviews. |
Openrouter AI General ReviewIssues (if any)
Previous Issues (for incremental reviews)(none) Suggestions (if any)
Notes
Generated by Openrouter AI (qwen/qwen3.6-plus). Supplementary to human reviews. |
Claude AI Incremental Architecture & Quality ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)(none) Previous Issues (for incremental reviews)
Suggestions (if any)
Notes
Generated by Claude AI (sonnet). Supplementary to human reviews. |
Automated fix by Claude in response to AI review feedback. Iteration: 1/5 Co-Authored-By: AI Review Agent <noreply@anthropic.com>
Review Response Agent (Iteration 1)Status: Changes committed, pushing... Commit: Fixed Issues
Ignored Issues
Deferred to Human
Notes
Automated summary of agent fixes. |
Claude AI Incremental Architecture & Quality ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)(none) Previous Issues (for incremental reviews)
Suggestions (if any)
Notes
Generated by Claude AI (sonnet). Supplementary to human reviews. |
Openrouter AI Incremental General ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)(none) Previous Issues (for incremental reviews)
Suggestions (if any)(none) Notes
Generated by Openrouter AI (qwen/qwen3.6-plus). Supplementary to human reviews. |
Claude AI Incremental Security & Correctness ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)(none) Previous Issues (for incremental reviews)
Suggestions (if any)(none) Notes
Generated by Claude AI (sonnet). Supplementary to human reviews. |
Review Response Agent (Iteration 2)Status: No changes needed Fixed Issues
Ignored Issues
Deferred to Human
Notes
The agent reviewed feedback but determined no code changes were required. |


Summary
Splits three cohesive helper clusters out of the 2957-line
crates/oasis-browser/src/paint/mod.rsinto dedicated sibling modules:paint/transforms.rs--transforms_have_3d,resolve_transform_origin,resolve_perspective_origin,compute_transform_matrix,compute_transform_offsets(+ unit tests for each).paint/stacking.rs--creates_stacking_context,creates_compositing_layer,is_positioned.paint/clip_path.rs--resolve_clip_path_rect,intersect_rects. The 3 clip-path tests that lived inmod.rsmove with it, and 2 newintersect_rectstests are added (the helper had none).paint/mod.rskeeps these names available viapub(crate) usere-exports, sopaint/record.rs(the only sibling caller, viasuper::) needs no edits at the call site.paint_box'spreserve3d_child_zhelper stays inmod.rsbecause it threadsPaintContextand is called only from the recursive walker in the same file.Result:
paint/mod.rsshrinks 2957 -> 2584 lines (-373). The remaining bulk is thepaint_boxrecursive walker plus its integration tests.Test plan
cargo build --workspacecargo test -p oasis-browser --lib-- 1954 passed, 0 failedcargo clippy --workspace -- -D warnings-- cleancargo fmt --all -- --check-- cleanGenerated with Claude Code