Skip to content

Conversation

@ashuralyk
Copy link
Contributor

@changeset-bot
Copy link

changeset-bot bot commented Jan 27, 2026

⚠️ No Changeset found

Latest commit: 0cc5099

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for docsccc ready!

Name Link
🔨 Latest commit 0cc5099
🔍 Latest deploy log https://app.netlify.com/projects/docsccc/deploys/697820b12674f10007732d97
😎 Deploy Preview https://deploy-preview-356--docsccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 79 (🟢 up 12 from production)
Accessibility: 88 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for liveccc ready!

Name Link
🔨 Latest commit 0cc5099
🔍 Latest deploy log https://app.netlify.com/projects/liveccc/deploys/697820b180fee80008611951
😎 Deploy Preview https://deploy-preview-356--liveccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 33 (🔴 down 4 from production)
Accessibility: 88 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for apiccc ready!

Name Link
🔨 Latest commit 0cc5099
🔍 Latest deploy log https://app.netlify.com/projects/apiccc/deploys/697820b17ae79c0008527e5a
😎 Deploy Preview https://deploy-preview-356--apiccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 80 (🔴 down 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 94 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ashuralyk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates a new "Deploy Script" tool into the demo application, empowering users to interact with the CKB blockchain by deploying files as Type ID cells. This enhancement provides a robust mechanism for both initial deployment and subsequent updates of on-chain data, complete with comprehensive UI feedback and validation.

Highlights

  • New Script Deployment Feature: Introduces a DeployScript page that allows users to deploy files as CKB cells with Type ID traits.
  • Create or Update Type ID Cells: Users can either create a new Type ID cell by leaving the Type ID args empty or update an existing one by providing its Type ID args.
  • Interactive User Interface: Features a drag-and-drop file upload area, displays file details, and includes a confirmation modal for transaction status.
  • On-chain Cell Validation: Automatically checks for the existence of Type ID cells on-chain and validates the provided Type ID arguments, including address matching for updates.
  • Navigation Integration: A new "Deploy Script" tab has been added to the connected tools section of the demo application.
  • Minor UI Component Refinement: The Message component's content wrapper was changed from a <p> tag to a <div> for improved layout flexibility.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for appccc ready!

Name Link
🔨 Latest commit 0cc5099
🔍 Latest deploy log https://app.netlify.com/projects/appccc/deploys/697820b1c929b70008d8d699
😎 Deploy Preview https://deploy-preview-356--appccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 74 (🔴 down 12 from production)
Accessibility: 89 (🟢 up 1 from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new feature for deploying scripts, which is a great addition to the demo application. The main component, DeployScript, is well-structured but has grown quite large. For future maintainability, consider breaking it down into smaller components and custom hooks. For instance, the file upload UI and the Type ID checking logic could be extracted. I've provided a couple of specific suggestions to improve error handling and reduce code duplication in the new component. The other changes in the pull request are solid, including a necessary fix in the Message component to ensure valid HTML.

Comment on lines +109 to +111
signer.getRecommendedAddress().then((addr) => {
setUserAddress(addr);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The promise returned by signer.getRecommendedAddress() doesn't handle potential rejections. If this promise fails, it will result in an unhandled promise rejection in the application. It's a good practice to add a .catch() block to handle such errors gracefully, for instance by logging the error and notifying the user.

    signer.getRecommendedAddress().then((addr) => {
      setUserAddress(addr);
    }).catch((e) => {
      console.error("Failed to get recommended address:", e);
      error("Failed to get user address.");
    });

Comment on lines +198 to +217
try {
const typeIdBytes = ccc.bytesFrom(normalizedTypeIdArgs);
if (typeIdBytes.length !== 32) {
setFoundCell(null);
setFoundCellAddress("");
setIsAddressMatch(null);
setCellCheckError(
"Type ID args must be 32 bytes (64 hex characters)",
);
isCheckingRef.current = false;
return;
}
} catch {
setFoundCell(null);
setFoundCellAddress("");
setIsAddressMatch(null);
setCellCheckError("Invalid Type ID args format");
isCheckingRef.current = false;
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The state reset logic for foundCell, foundCellAddress, etc., is duplicated in this try...catch block and in other places within the useEffect hook. This duplication makes the code harder to read and maintain. You can refactor this by consolidating the error handling and state reset logic into a single catch block, which will make the code cleaner and less error-prone.

      try {
        const typeIdBytes = ccc.bytesFrom(normalizedTypeIdArgs);
        if (typeIdBytes.length !== 32) {
          throw new Error(
            "Type ID args must be 32 bytes (64 hex characters)",
          );
        }
      } catch (e: unknown) {
        const message =
          e instanceof Error && e.message.startsWith("Type ID")
            ? e.message
            : "Invalid Type ID args format";
        setFoundCell(null);
        setFoundCellAddress("");
        setIsAddressMatch(null);
        setCellCheckError(message);
        isCheckingRef.current = false;
        return;
      }

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