Skip to content

fix: Modify some version issue#1280

Merged
hexqi merged 2 commits intoopentiny:release/v2.4.0from
xuanlid:fix/2.4.0
Apr 7, 2025
Merged

fix: Modify some version issue#1280
hexqi merged 2 commits intoopentiny:release/v2.4.0from
xuanlid:fix/2.4.0

Conversation

@xuanlid
Copy link
Copy Markdown
Contributor

@xuanlid xuanlid commented Apr 2, 2025

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

  1. 页面管理搜索问题
  2. 去掉区块复制图标
  3. 编辑区块点击没反应问题
  4. engine-cli中unpkg替换成npmmirror

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Chores
    • Updated CDN settings across all environments to use a new, reliable mirror for asset delivery.
  • New Features
    • Enhanced the block editing flow with immediate re-initialization after saving changes.
  • Refactor
    • Removed the block copy option from the settings panel for a cleaner interface.
  • Bug Fixes
    • Improved node filtering to ensure consistent, case-insensitive matching.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 2, 2025

Walkthrough

This pull request updates CDN configuration for the engine CLI by modifying environment files to use the npmmirror CDN. It replaces the previous CDN domain with a new one and introduces a new environment variable. Additionally, the PR removes a block copy button from the block settings component, adds block initialization logic in the main block editor, and refines the filtering logic in the page tree component to enforce case-insensitive matching.

Changes

File(s) Summary of Changes
packages/engine-cli/.../env/.env.alpha
packages/engine-cli/.../env/.env.development
packages/engine-cli/.../env/.env.production
Updated VITE_CDN_DOMAIN from https://unpkg.com to https://registry.npmmirror.com and added VITE_CDN_TYPE=npmmirror (with inline comment in Chinese where applicable).
packages/plugins/block/src/BlockSetting.vue Removed the <svg-button name="text-copy-page"> element, eliminating the block copy functionality.
packages/plugins/block/src/Main.vue Introduced useBlock().initBlock(block, {}, isEdit) in the editBlock function to initialize the block immediately after saving changes.
packages/plugins/page/src/Tree.vue Updated the filtering logic to convert both the node label and filter value to lowercase for improved case-insensitive matching.

Sequence Diagram(s)

sequenceDiagram
    participant User as Developer/User
    participant UI as Main.vue
    participant BlockSvc as useBlock()
    
    User->>UI: Saves block edits
    UI-->>User: Confirmation dialog (if needed)
    UI->>BlockSvc: initBlock(block, {}, isEdit)
    BlockSvc-->>UI: Block initialized
Loading

Possibly related PRs

Suggested labels

bug, refactor-main

Suggested reviewers

  • hexqi
  • chilingling

Poem

I'm a little rabbit, hopping through code,
Changing domains and variables in each mode.
Removed a button, added a new call,
Filtering and initializing to please one and all.
Hop along, dear coder, let these changes unfold 🐰✨


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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@github-actions github-actions Bot added the bug Something isn't working label Apr 2, 2025
Copy link
Copy Markdown
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/engine-cli/template/designer/env/.env.alpha (1)

4-4: Optional Cleanup of Deprecated Comment:
Consider removing the commented out line #VITE_CDN_DOMAIN=https://unpkg.com if it is no longer required for historical reference. This will help reduce clutter in the configuration file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f912d39 and 987caec.

📒 Files selected for processing (6)
  • packages/engine-cli/template/designer/env/.env.alpha (1 hunks)
  • packages/engine-cli/template/designer/env/.env.development (1 hunks)
  • packages/engine-cli/template/designer/env/.env.production (1 hunks)
  • packages/plugins/block/src/BlockSetting.vue (0 hunks)
  • packages/plugins/block/src/Main.vue (1 hunks)
  • packages/plugins/page/src/Tree.vue (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/plugins/block/src/BlockSetting.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: push-check
🔇 Additional comments (6)
packages/engine-cli/template/designer/env/.env.production (1)

4-7:

Details

✅ Verification successful

CDN source updated from unpkg to npmmirror

The configuration changes the CDN source from unpkg.com to registry.npmmirror.com and adds the necessary VITE_CDN_TYPE variable required for npmmirror integration. This change aligns with the PR objective to replace "unpkg" with "npmmirror" in the engine-cli.


🏁 Script executed:

#!/bin/bash
# Check if this change is consistent across all environment files
echo "Checking for consistency across environment files..."
grep -r "VITE_CDN_DOMAIN=" packages/engine-cli/template/designer/env/
grep -r "VITE_CDN_TYPE=" packages/engine-cli/template/designer/env/

Length of output: 1397


CDN Configuration Update Verified Across All Environment Files
The change from using unpkg.com to npmmirror has been verified in all environment files (.env.alpha, .env.development, and .env.production). The active settings now correctly point to https://registry.npmmirror.com for VITE_CDN_DOMAIN, and the required VITE_CDN_TYPE=npmmirror variable is present as intended.

  • Files Affected:
    • packages/engine-cli/template/designer/env/.env.production
    • packages/engine-cli/template/designer/env/.env.alpha
    • packages/engine-cli/template/designer/env/.env.development

No further changes appear to be necessary, and this update aligns perfectly with the PR's objectives.

packages/engine-cli/template/designer/env/.env.development (1)

4-7: CDN source updated from unpkg to npmmirror

The configuration changes the CDN source from unpkg.com to registry.npmmirror.com and adds the necessary VITE_CDN_TYPE variable required for npmmirror integration. This change maintains consistency with the updates in the production environment file.

packages/plugins/page/src/Tree.vue (1)

115-115: Enhanced case-insensitive filtering for page search

The improvement ensures consistent case-insensitive filtering by explicitly converting both the node label and the filter value to lowercase before performing the includes check. This fixes the search functionality in the page management feature mentioned in the PR objectives.

packages/plugins/block/src/Main.vue (1)

329-329:

Details

✅ Verification successful

Fixed block initialization in edit mode

Added block initialization when the block is confirmed to be saved, ensuring proper rendering of the block in edit mode. This addresses the issue mentioned in the PR objectives where "clicking on an edit block did not yield any response."


🏁 Script executed:

#!/bin/bash
# Check if this block initialization is properly implemented in other similar functions
echo "Checking for similar block initialization patterns..."
rg "useBlock\(\).initBlock\(" packages/plugins/block/src/

Length of output: 660


Block Initialization Verified and Correct

The updated code in packages/plugins/block/src/Main.vue using

useBlock().initBlock(block, {}, isEdit)

is consistent with similar patterns found in the codebase (e.g., in blockSetting.tsx and BlockSetting.vue). This proper initialization in edit mode confirms that the block is rendered correctly after being saved, which addresses the issue where clicking on an edit block was unresponsive.

  • Verified consistency with similar implementations across the repository.
  • No additional changes are needed.
packages/engine-cli/template/designer/env/.env.alpha (2)

4-5: CDN Domain Update:
The CDN domain has been updated from the unpkg.com endpoint to "https://registry.npmmirror.com". This change aligns with the project’s requirement to switch CDNs and ensures consistency with the other environment files.


6-7: Introducing VITE_CDN_TYPE Variable:
The new environment variable VITE_CDN_TYPE set to "npmmirror" is well introduced and accompanied by a clarifying comment. Ensure that any downstream code consuming these variables is updated to handle the new configuration.

@hexqi hexqi merged commit 2610875 into opentiny:release/v2.4.0 Apr 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants