Skip to content

v2.26.1#1841

Merged
prafull-opensignlabs merged 1 commit intostagingfrom
updates-16144605887
Jul 8, 2025
Merged

v2.26.1#1841
prafull-opensignlabs merged 1 commit intostagingfrom
updates-16144605887

Conversation

@nxglabs
Copy link
Collaborator

@nxglabs nxglabs commented Jul 8, 2025

v2.26.1

Copilot AI review requested due to automatic review settings July 8, 2025 13:27
@vercel
Copy link

vercel bot commented Jul 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
open-sign ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 1:28pm

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates image and signature handling utilities, integrates new conversion helpers, refactors widget modal logic, and applies UI and translation tweaks to support a “Done” button label.

  • Introduces convertBase64ToImg and convertJpegToPng for scalable image conversion and format normalization.
  • Refactors onSaveSign/onSaveImage in Utils and removes imgWH state in WidgetsValueModal, updating handler signatures.
  • Adds object-contain layout classes in placeholders and updates the i18n key from “finish” to “done” (with translations).

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/OpenSign/src/constant/Utils.jsx Added image conversion functions and refactored save logic
apps/OpenSign/src/components/pdf/WidgetsValueModal.jsx Removed imgWH state, updated handler parameters
apps/OpenSign/src/components/pdf/PlaceholderType.jsx Added object-contain class and conditional styling
apps/OpenSign/src/components/Header.jsx Added alt attribute and object-contain class for logo
apps/OpenSign/public/locales/*/translation.json Added “done” translations across all supported locales
Comments suppressed due to low confidence (4)

apps/OpenSign/src/constant/Utils.jsx:1409

  • New utility convertBase64ToImg was added but there are no corresponding unit tests. Consider adding tests to verify scaling, centering, and output format.
/**

apps/OpenSign/src/constant/Utils.jsx:3682

  • The JSDoc for convertJpegToPng claims to return Promise<File>, but the function can also return a plain string synchronously when the input is already PNG. Update the @returns to reflect both possible return types (e.g., Promise<File|string>).
 * @returns {Promise<File>}     - A promise that resolves with a new PNG File.

apps/OpenSign/src/components/pdf/PlaceholderType.jsx:110

  • [nitpick] There is a trailing space in select-none-cls which can be removed to keep class names consistent.
          src={props.pos.SignUrl}

apps/OpenSign/src/constant/Utils.jsx:1343

  • The default and initials branches were removed, so when isTypeText is false getIMGWH stays undefined and dimensions fall back to 150x60. Restore or replace the logic that calculates dimensions for default signatures/initials (e.g., using updatedImgWH or calculateImgAspectRatio).
      if (isTypeText) {

Comment on lines +1357 to +1358
...(type === "type" ? { Width: posWidth } : {}),
...(type === "type" ? { Height: posHeight } : {}),
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

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

[nitpick] You spread Width and Height in two separate objects only when type === "type". Consider combining them in one conditional spread for clarity: ...(type === "type" && { Width: posWidth, Height: posHeight }).

Suggested change
...(type === "type" ? { Width: posWidth } : {}),
...(type === "type" ? { Height: posHeight } : {}),
...(type === "type" && { Width: posWidth, Height: posHeight }),

Copilot uses AI. Check for mistakes.
Comment on lines +1426 to +1429
img.src = base64Image;
await new Promise((resolve, reject) => {
img.onload = resolve;
img.onerror = reject;
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

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

It's safer to add an onerror handler on the Image before setting src to catch invalid or corrupted base64 data and reject the promise explicitly.

Suggested change
img.src = base64Image;
await new Promise((resolve, reject) => {
img.onload = resolve;
img.onerror = reject;
await new Promise((resolve, reject) => {
img.onload = resolve;
img.onerror = reject;
img.src = base64Image;

Copilot uses AI. Check for mistakes.
@prafull-opensignlabs prafull-opensignlabs changed the title Merge pull request #963 from nxglabs/staging v2.26.1 Jul 8, 2025
@prafull-opensignlabs prafull-opensignlabs merged commit 75ad566 into staging Jul 8, 2025
5 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