Skip to content

Merge origin/main into origin/feat/2.5 #1045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 30, 2025
Merged

Merge origin/main into origin/feat/2.5 #1045

merged 5 commits into from
Jun 30, 2025

Conversation

yiiqii
Copy link
Collaborator

@yiiqii yiiqii commented Jun 27, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Resolved an issue causing character overlap in rich-text rendering.
    • Fixed a problem where composition playback could freeze unexpectedly.
  • Refactor

    • Improved the accuracy and clarity of rich-text width and height calculations.
    • Refined internal time management for smoother composition updates.
  • Tests

    • Enhanced test coverage for dynamic text scenarios and applied stricter image comparison thresholds.
  • Chores

    • Updated package versions to 2.4.8 across multiple modules.
    • Added and structured variable data for dynamic asset testing.

wumaolinmaoan and others added 5 commits June 17, 2025 20:27
* fix: fix rich-text character overlapping bug

* test: 补充富文本字体遮挡的帧对比 case

---------

Co-authored-by: yiiqii <[email protected]>
Merge origin/dev into origin/main
@yiiqii yiiqii requested a review from wumaolinmaoan June 27, 2025 03:58
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

Walkthrough

This update increments the version to 2.4.8 across multiple packages and plugins, documents the release in changelogs, and introduces fixes for rich-text character overlapping and composition freeze issues. It refactors time advancement logic in the Composition class, improves rich-text rendering calculations, and enhances test cases to support dynamic variables and stricter image comparison.

Changes

Files / Groups Change Summary
CHANGELOG.md, CHANGELOG-zh_CN.md Added 2.4.8 release notes with fixes for rich-text overlap and composition freeze.
All package.json files across packages and plugins Bumped version from 2.4.7 to 2.4.8.
packages/effects-core/src/composition.ts Refactored composition time advancement and update logic; removed rounding/clamping; renamed and updated method signatures.
packages/effects-core/src/plugins/timeline/track.ts Removed rounding of local clip time in RuntimeClip.evaluateAt.
plugin-packages/rich-text/src/rich-text-component.ts Improved text width calculation, line handling, and rendering logic with additional comments and refined measurement.
web-packages/test/case/src/2d/assets/dynamic.ts Added/updated variables property to several entries for dynamic text substitution.
web-packages/test/case/src/2d/dynamic.spec.ts Tightened image comparison thresholds; passed variables into scene initialization and test functions.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner
    participant Scene
    participant Player

    TestRunner->>Scene: Extract url, name, variables
    TestRunner->>Player: Initialize with url and variables
    Player->>Scene: Render with variables
    TestRunner->>Player: Compare rendered output (stricter thresholds)
Loading
sequenceDiagram
    participant Composition
    participant RootItem
    participant Video
    participant Plugins
    participant Scene

    Composition->>Composition: forwardTime(deltaTime)
    Composition->>Composition: updateCompositionTime(scaledDeltaTime)
    Composition->>RootItem: Update time, handle end behavior
    Composition->>Video: Update with actual deltaTime
    Composition->>Plugins: Update loaders
    Composition->>Scene: Tick with deltaTime
Loading

Possibly related PRs

Suggested reviewers

  • wumaolinmaoan
  • Fryt1

Poem

A hop, a skip, a version bump anew,
Rich text aligns, its bounding box true.
Timelines tick with careful grace,
No more freeze or overlap in place.
Variables dance in tests so neat—
2.4.8, a rabbit’s treat!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/effects-core/src/composition.ts (1)

587-587: Address the FIXME comment for optimization.

The FIXME comment indicates a known issue where the update process might modify composition time, requiring optimization of the update logic.

Since this relates to the composition freeze fix, would you like me to help analyze potential race conditions or timing issues that could arise from composition time modifications during updates?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec2656c and 32991aa.

📒 Files selected for processing (21)
  • CHANGELOG-zh_CN.md (1 hunks)
  • CHANGELOG.md (1 hunks)
  • packages/effects-core/package.json (1 hunks)
  • packages/effects-core/src/composition.ts (4 hunks)
  • packages/effects-core/src/plugins/timeline/track.ts (1 hunks)
  • packages/effects-helper/package.json (1 hunks)
  • packages/effects-threejs/package.json (1 hunks)
  • packages/effects-webgl/package.json (1 hunks)
  • packages/effects/package.json (1 hunks)
  • plugin-packages/alipay-downgrade/package.json (1 hunks)
  • plugin-packages/downgrade/package.json (1 hunks)
  • plugin-packages/editor-gizmo/package.json (1 hunks)
  • plugin-packages/model/package.json (1 hunks)
  • plugin-packages/multimedia/package.json (1 hunks)
  • plugin-packages/orientation-transformer/package.json (1 hunks)
  • plugin-packages/rich-text/package.json (1 hunks)
  • plugin-packages/rich-text/src/rich-text-component.ts (8 hunks)
  • plugin-packages/spine/package.json (1 hunks)
  • plugin-packages/stats/package.json (1 hunks)
  • web-packages/test/case/src/2d/assets/dynamic.ts (1 hunks)
  • web-packages/test/case/src/2d/dynamic.spec.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (7)
packages/effects-helper/package.json (2)
Learnt from: liuxi150
PR: galacean/effects-runtime#0
File: :0-0
Timestamp: 2024-07-26T21:12:19.313Z
Learning: Imports in `plugin-packages/model/src/utility/plugin-helper.ts` do not need to be merged as per project preference or coding standards.
Learnt from: liuxi150
PR: galacean/effects-runtime#0
File: :0-0
Timestamp: 2024-10-17T07:15:16.523Z
Learning: Imports in `plugin-packages/model/src/utility/plugin-helper.ts` do not need to be merged as per project preference or coding standards.
plugin-packages/rich-text/package.json (2)
Learnt from: liuxi150
PR: galacean/effects-runtime#0
File: :0-0
Timestamp: 2024-07-26T21:12:19.313Z
Learning: Imports in `plugin-packages/model/src/utility/plugin-helper.ts` do not need to be merged as per project preference or coding standards.
Learnt from: liuxi150
PR: galacean/effects-runtime#0
File: :0-0
Timestamp: 2024-10-17T07:15:16.523Z
Learning: Imports in `plugin-packages/model/src/utility/plugin-helper.ts` do not need to be merged as per project preference or coding standards.
packages/effects-core/src/plugins/timeline/track.ts (1)
Learnt from: wumaolinmaoan
PR: galacean/effects-runtime#691
File: packages/effects-core/src/plugins/timeline/playables/color-property-mixer-playable.ts:39-42
Timestamp: 2024-10-18T09:15:08.038Z
Learning: In `packages/effects-core/src/plugins/timeline/playables/color-property-mixer-playable.ts`, when accumulating color components, avoid using `clone()` methods because it can cause additional garbage collection overhead.
plugin-packages/model/package.json (2)
Learnt from: liuxi150
PR: galacean/effects-runtime#0
File: :0-0
Timestamp: 2024-07-26T21:12:19.313Z
Learning: Imports in `plugin-packages/model/src/utility/plugin-helper.ts` do not need to be merged as per project preference or coding standards.
Learnt from: liuxi150
PR: galacean/effects-runtime#0
File: :0-0
Timestamp: 2024-10-17T07:15:16.523Z
Learning: Imports in `plugin-packages/model/src/utility/plugin-helper.ts` do not need to be merged as per project preference or coding standards.
web-packages/test/case/src/2d/assets/dynamic.ts (1)
Learnt from: yiiqii
PR: galacean/effects-runtime#214
File: packages/effects/src/player.ts:416-429
Timestamp: 2024-10-17T07:15:16.523Z
Learning: Data compatibility or processing logic related to replacing text variables in scene compositions should be handled in the AssetManager class through the updateOptions method, not in the Player class.
web-packages/test/case/src/2d/dynamic.spec.ts (1)
Learnt from: wumaolinmaoan
PR: galacean/effects-runtime#691
File: packages/effects-core/src/plugins/timeline/playables/color-property-mixer-playable.ts:39-42
Timestamp: 2024-10-18T09:15:08.038Z
Learning: In `packages/effects-core/src/plugins/timeline/playables/color-property-mixer-playable.ts`, when accumulating color components, avoid using `clone()` methods because it can cause additional garbage collection overhead.
packages/effects-core/src/composition.ts (1)
Learnt from: wumaolinmaoan
PR: galacean/effects-runtime#691
File: packages/effects-core/src/plugins/timeline/playables/color-property-mixer-playable.ts:39-42
Timestamp: 2024-10-18T09:15:08.038Z
Learning: In `packages/effects-core/src/plugins/timeline/playables/color-property-mixer-playable.ts`, when accumulating color components, avoid using `clone()` methods because it can cause additional garbage collection overhead.
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (34)
packages/effects/package.json (1)

3-3: Version bump looks good and follows SemVer patch semantics
No further issues spotted for this package.json.

packages/effects-helper/package.json (1)

3-3: Patch release number correctly updated
Change is minimal and consistent with the overall 2.4.8 release train.

packages/effects-core/package.json (2)

3-3: Core package version properly incremented
No metadata, script, or dependency anomalies detected.


1-60: Verify every workspace package now reports 2.4.8
A quick sanity-check helps catch any stragglers that may have been missed in the version sweep.

#!/bin/bash
# List every package.json version in the repo to confirm they are at 2.4.8
fd -t f package.json | while read -r f; do
  name=$(jq -r '.name' "$f")
  ver=$(jq -r '.version' "$f")
  printf '%-60s %s\n' "$name" "$ver"
done | sort
plugin-packages/spine/package.json (1)

3-3: Spine plugin aligned with 2.4.8 tag
All good here.

plugin-packages/stats/package.json (1)

3-3: Stats plugin version sync confirmed
Nothing else to address.

packages/effects-webgl/package.json (1)

3-3: Version bump to 2.4.8 looks good and consistent with the release train.
No further changes required.

plugin-packages/rich-text/package.json (1)

3-3: Rich-text plugin correctly aligned to 2.4.8.
Nothing else stands out—good to go.

plugin-packages/orientation-transformer/package.json (1)

3-3: Orientation-transformer plugin version updated correctly.
No additional adjustments needed.

plugin-packages/alipay-downgrade/package.json (1)

3-3: Alipay-downgrade plugin now at 2.4.8—change looks straightforward.
All good from my side.

plugin-packages/multimedia/package.json (1)

3-3: Multimedia plugin version increment verified.
Change is minimal and consistent.

plugin-packages/model/package.json (2)

3-3: Version bump looks good – matches the global 2.4.8 release.
No other metadata impacted.


3-3: (Optional) sanity-check all workspace packages share the same new version.
A quick script can prevent an accidental mismatch.

#!/usr/bin/env bash
# List any package.json whose version is NOT 2.4.8
fd package.json | xargs jq -r '.name + " " + .version' | grep -v ' 2.4.8$' || echo "✅  all packages on 2.4.8"
plugin-packages/downgrade/package.json (1)

3-3: Consistent patch upgrade – no issues.

packages/effects-threejs/package.json (1)

3-3: Three-js bridge package correctly bumped to 2.4.8.

plugin-packages/editor-gizmo/package.json (1)

3-3: Gizmo plugin version updated; everything else unchanged.

CHANGELOG.md (1)

10-16: Changelog entry added and formatted correctly.
Links, dates and authors render fine.

CHANGELOG-zh_CN.md (1)

11-17: LGTM! Properly documents the version 2.4.8 fixes.

The changelog entries correctly document the rich-text character overlapping fix and composition freeze issue resolution, with proper PR references and contributor attribution.

packages/effects-core/src/plugins/timeline/track.ts (1)

232-232: Good precision improvement by removing unnecessary rounding.

Removing the toFixed(3) rounding preserves full floating-point precision in time calculations, which should improve timing accuracy and help resolve composition freeze issues.

web-packages/test/case/src/2d/dynamic.spec.ts (3)

1-1: Good addition of spec type for template variables support.

Adding the spec import enables proper typing for the template variables functionality being tested.


8-9: Appropriately stricter test thresholds for improved rendering precision.

The significantly tightened thresholds (accumRatioThreshold: 0.02 → 0.0002, pixelDiffThreshold: 10 → 1) reflect confidence in the rich-text character overlapping fixes and ensure high-precision validation of the rendering improvements.


31-33: Excellent integration of template variables into the testing framework.

The addition of variables extraction and passing to player initialization enables comprehensive testing of dynamic text scenarios, which is crucial for validating the rich-text improvements.

Also applies to: 38-38, 44-45

web-packages/test/case/src/2d/assets/dynamic.ts (1)

5-6: Comprehensive template variables for rich-text testing.

The added variables provide excellent test coverage for various rich-text scenarios including multiline text, size formatting, and color formatting, which are essential for validating the character overlapping fixes.

Also applies to: 11-14, 19-21, 23-29

plugin-packages/rich-text/src/rich-text-component.ts (4)

45-46: Clear documentation of line spacing calculation.

The comment effectively explains the relationship between font height and line spacing, improving code maintainability.


150-161: Excellent improvement in text width calculation precision.

The enhanced width calculation using actualBoundingBoxLeft and actualBoundingBoxRight when available, combined with measureText().width, provides more accurate text measurements and should help resolve character overlapping issues.


169-170: Good detailed explanation of width calculation formula.

The comment clearly explains the complex width calculation involving font size, scale factors, and letter spacing, which aids in understanding and maintaining this critical rendering logic.


239-239: Simplified and more efficient rendering approach.

The change from character-by-character rendering to segment-based fillText calls should improve both performance and rendering accuracy, addressing the character overlapping bug effectively.

Also applies to: 250-250, 252-252, 255-255

packages/effects-core/src/composition.ts (7)

581-581: Time calculation precision looks good.

The millisecond conversion maintains precision for the delta time calculation in the forwardTime method.


633-636: Excellent refactor for accurate time delta calculation.

This change improves time management by:

  • Capturing the composition time before updates
  • Using the actual time difference after updateCompositionTime
  • Providing more accurate delta time for downstream systems

This approach is much more robust than using the input deltaTime directly, especially when dealing with end behaviors that might clamp or modify the composition time.


640-643: Consistent usage of recalculated delta time.

Good implementation using deltaTimeInMs for both plugin loaders and scene ticking updates, ensuring all downstream systems receive the actual time progression rather than the requested time change.


706-706: Method rename improves clarity.

The rename from updateRootComposition to updateCompositionTime better reflects the method's primary responsibility of updating composition time rather than the broader composition updates.


711-716: Robust handling of negative time scenarios.

The improved logic handles edge cases better:

  • Calculates local time relative to start time more clearly
  • Prevents negative local time when deltaTime is negative
  • This should help resolve composition freeze issues when time calculations go negative

721-721: Clean variable initialization.

Moving the isEnded declaration to the top improves code readability and follows better scoping practices.


750-750: Correct composition time assignment.

The time assignment this.rootComposition.time = localTime + this.startTime properly combines the calculated local time with the start time, maintaining the absolute time reference for the composition.

@yiiqii yiiqii merged commit ee72f0d into feat/2.5 Jun 30, 2025
3 of 4 checks passed
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.

3 participants