Skip to content

icon_anime: lava/soil condensation under gravity - #284

Merged
steve02081504 merged 2 commits into
masterfrom
split/icon-anime
Aug 7, 2026
Merged

icon_anime: lava/soil condensation under gravity#284
steve02081504 merged 2 commits into
masterfrom
split/icon-anime

Conversation

@steve02081504

@steve02081504 steve02081504 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Condensation film hangs and drains under gravity in icon_anime soil/lava fluid
  • Related physics notes, player/scene tweaks, and gravity/fluid tests

Test plan

  • fount test --no-parallel imgs/icon_anime
  • Spot-check logo / icon_anime animation visually if convenient

新增土壤与熔岩的重力驱动凝结、附着和滴流行为。凝结源会随重力方向定位、迁移,并在失去开放通道时回收或向空气溢流。雨水边界、反向重力熔岩沉降和滴水绘制逻辑同步修正。玩家中止机制改为一次触发,避免重复回调;相关文档和回归测试已补齐。

主要风险在流体状态转移、边界判定和渲染逻辑之间耦合增加,复杂度偏高。当前未见明显架构破坏或审美风险,但应重点验证反向重力下的视觉连续性与水量守恒。

@cursor

cursor Bot commented Aug 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@steve02081504, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3603c309-ca47-49fa-9bca-58804cd034f7

📥 Commits

Reviewing files that changed from the base of the PR and between 98f41a2 and eaa2d96.

📒 Files selected for processing (6)
  • imgs/icon_anime/fluid/soil.mjs
  • imgs/icon_anime/player.mjs
  • imgs/icon_anime/scene.mjs
  • imgs/icon_anime/test/anim.test.mjs
  • imgs/icon_anime/test/fluid.test.mjs
  • imgs/icon_anime/test/gravity_lava.test.mjs
📝 Walkthrough

Walkthrough

本次变更更新重力感知的土壤凝结、滴水绘制、降雨和熔岩边界行为,并使 Ctrl+C 与长按 ESC 在单次播放周期内只触发一次中止。

Changes

流体与重力行为

Layer / File(s) Summary
重力感知的土壤凝结
imgs/icon_anime/fluid/soil.mjs, imgs/icon_anime/fluid/index.mjs, imgs/icon_anime/test/fluid.test.mjs
新增 condenseDripSource。凝结沿重力方向转移。失去开放下沿时,凝结优先回填土壤湿度,剩余部分溢流到空气格。测试覆盖侧向和反向重力及水量守恒。
凝结滴水绘制接入
imgs/icon_anime/compose.mjs, imgs/icon_anime/physics-notes.md, imgs/icon_anime/test/fluid.test.mjs
滴水绘制通过 condenseDripSource 获取土壤源,并按实际重力定位。文档和测试同步描述该行为。
降雨与熔岩边界规则
imgs/icon_anime/scene.mjs, imgs/icon_anime/physics-notes.md, imgs/icon_anime/test/gravity_lava.test.mjs
构图底边的降雨权重固定为 0。反向重力测试覆盖降雨禁用和达到暴露阈值后从顶部边界生成熔岩。

播放中止控制

Layer / File(s) Summary
一次性用户中止闩锁
imgs/icon_anime/player.mjs, imgs/icon_anime/test/anim.test.mjs, imgs/icon_anime/AGENTS.md
createEscHold 触发后锁定重复检查。player.start 统一处理 Ctrl+C 和长按 ESC,并只调用一次 abortonUserAbortreset() 可重新启用长按检测。文档同步更新。

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
审美与简洁 ⚠️ Warning 未通过:soil.mjs:45-50 重复定义已有的 ORTHO;soil.mjs:326-327、scene.mjs:550 引入单次别名,且 left/rightCondense 在重力侧向后失真。 复用 hash.mjs 的 ORTHO_DX/ORTHO_DY;内联 sideB 与 edges[0];将 left/rightCondense 改为 current/neighborCondense。
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了在重力作用下实现熔岩与土壤凝结行为这一主要变更,简洁且不是文件列表或空泛表述。
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch split/icon-anime

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.

@codacy-production

codacy-production Bot commented Aug 7, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 31 complexity · 0 duplication

Metric Results
Complexity 31
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@imgs/icon_anime/fluid/soil.mjs`:
- Around line 44-50: Replace abbreviated identifiers with readable full-word
names throughout the affected loops and tests: in imgs/icon_anime/fluid/soil.mjs
lines 44-50 rename ORTHO to ORTHOGONAL_OFFSETS; rename i, sx, sy at lines
110-116, i, bx, by at lines 131-137, and i, bx, by, dx, dy at lines 152-165 to
semantic names while updating all references; in
imgs/icon_anime/test/fluid.test.mjs lines 420 and 437-442 rename i to stepIndex
and saw to a complete name describing the observed behavior.
- Around line 107-165: 移除凝结路径对重力投影的离散化:更新 condenseDripSource、hasOpenUnderside 和
spillToAir,使所有非零 down.w 的邻格参与来源、开放面判断与传递,不再使用 w < 0.5 过滤或 strongestDown 单轴选择。让
stepSoil 的凝结质量按 ĝ⊥ 的双轴投影权重连续分配,并补充斜向单位重力下弱投影面的传递与回收测试。
- Around line 370-382: 更新该凝结回收逻辑及 spillToAir:不要在分配前清零 condense[cell],先将可容纳部分写入
moisture,再让 spillToAir 尝试分配全部 rest,并把其未写入的返回量保留回 condense[cell] 供后续 tick 处理。确保
spillToAir 遍历并分配到所有可用空气邻格,仅允许世界边缘、下边缘擦除和 BODY impact 作为质量汇。

In `@imgs/icon_anime/player.mjs`:
- Around line 79-80: 为 reset() 的 JSDoc 增加一行中文行为摘要,说明该方法会清除 start、last 和 fired
状态,并重新允许一次触发;保留现有的 `@returns` {void} 声明。

In `@imgs/icon_anime/scene.mjs`:
- Around line 550-551: Remove the single-use top binding in the surrounding
edge-processing logic and inline the edges[0] access directly in the following
condition, preserving the existing w > 0.5 check.

In `@imgs/icon_anime/test/anim.test.mjs`:
- Around line 382-391: Rename the loop variable t to elapsedMs and the reset
baseline variable t0 to resetTimestamp throughout this hold.note test block,
updating every reference while preserving the existing timing assertions.

In `@imgs/icon_anime/test/fluid.test.mjs`:
- Around line 437-446: 收紧该测试中的液体分布断言:在循环结束后,独立验证旧屏幕下方位置 `world.liq[idx(world, 7,
6)]` 接近零,并单独验证正确的左侧目标 `world.liq[idx(world, 6, 5)]` 获得液体;移除两者之间的相对比较,保留总水量守恒断言。

In `@imgs/icon_anime/test/gravity_lava.test.mjs`:
- Around line 65-69: 在 gravity_lava 测试相关代码中,将单字母或缩写变量 e、s、i、W、botMelt 分别改为
edge、weightSum、stepIndex、worldWidth、bottomMelt;将仅用于单次断言的 bot 和 top
绑定内联到对应断言中,并将相关 column 变量统一使用完整名称。确保这些命名调整覆盖同一测试中的其他相关代码。
- Around line 89-90: 更新重力翻转测试中的 applyGravityToWorld 调用,直接传入新的向上重力对象,不要先覆盖
world.gravity;保留 world.gravity 的旧值,使 applyGravityToWorld 能检测重力方向变化并更新脏状态。
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b3271c99-b12d-4105-b197-1bd9c0b66021

📥 Commits

Reviewing files that changed from the base of the PR and between 28fc7f3 and 98f41a2.

📒 Files selected for processing (10)
  • imgs/icon_anime/AGENTS.md
  • imgs/icon_anime/compose.mjs
  • imgs/icon_anime/fluid/index.mjs
  • imgs/icon_anime/fluid/soil.mjs
  • imgs/icon_anime/physics-notes.md
  • imgs/icon_anime/player.mjs
  • imgs/icon_anime/scene.mjs
  • imgs/icon_anime/test/anim.test.mjs
  • imgs/icon_anime/test/fluid.test.mjs
  • imgs/icon_anime/test/gravity_lava.test.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)

Comment thread imgs/icon_anime/fluid/soil.mjs
Comment thread imgs/icon_anime/fluid/soil.mjs Outdated
Comment thread imgs/icon_anime/fluid/soil.mjs Outdated
Comment thread imgs/icon_anime/player.mjs Outdated
Comment thread imgs/icon_anime/scene.mjs Outdated
Comment thread imgs/icon_anime/test/anim.test.mjs Outdated
Comment thread imgs/icon_anime/test/fluid.test.mjs Outdated
Comment thread imgs/icon_anime/test/gravity_lava.test.mjs Outdated
Comment thread imgs/icon_anime/test/gravity_lava.test.mjs Outdated
@steve02081504
steve02081504 merged commit 1f29949 into master Aug 7, 2026
11 checks passed
@steve02081504
steve02081504 deleted the split/icon-anime branch August 7, 2026 09:05
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