Skip to content

fix(certifications): text and URLs don't overflow the page in all templates #2275 #2323

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AnastasiaLag
Copy link

@AnastasiaLag AnastasiaLag commented May 30, 2025

Summary by CodeRabbit

  • New Features

    • Added an image cropping step to the profile picture upload process, allowing users to crop and preview their photo before uploading.
    • Certification links now display a specialized "View Certificate" label and layout, improving clarity in the certifications section.
  • Bug Fixes

    • Prevented duplicate or unnecessary links from appearing in the certifications section.
  • Chores

    • Updated and added various package dependencies, including introducing "react-image-crop" and adjusting others for compatibility.

Copy link

coderabbitai bot commented May 30, 2025

📝 Walkthrough

Walkthrough

The updates introduce specialized rendering for certification links across multiple resume templates by adding an isCertification prop to the LinkedEntity component and updating its logic. The certifications section now displays a distinct "View Certificate" link and suppresses redundant separate links. Additional changes include implementing image cropping before profile picture upload, adding new dependencies, and minor configuration updates.

Changes

Files/Paths Change Summary
apps/artboard/src/templates/azurill.tsx
.../bronzor.tsx
.../chikorita.tsx
.../ditto.tsx
.../gengar.tsx
.../glalie.tsx
.../kakuna.tsx
.../leafish.tsx
.../nosepass.tsx
.../onyx.tsx
.../pikachu.tsx
.../rhyhorn.tsx
Added optional isCertification prop to LinkedEntity and updated its rendering logic for certifications; Section and Certifications components updated to support specialized certificate link display and suppress duplicate links in certifications section.
apps/client/src/pages/builder/sidebars/left/sections/picture/section.tsx Added image cropping modal and logic before profile picture upload, including validation and preview, using react-image-crop.
apps/server/project.json Added runtimeArgs: ["--experimental-specifier-resolution=node"] to the serve target configuration.
libs/hooks/package.json
libs/schema/package.json
libs/ui/package.json
libs/utils/package.json
Added self-referential local file dependency in each package's dependencies section.
package.json Downgraded @sindresorhus/slugify to ^1.1.2 and added react-image-crop dependency.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI
  participant LinkedEntity
  participant Section
  participant Certifications

  User->UI: View Certifications section
  UI->Certifications: Render certification item
  Certifications->LinkedEntity: Render with isCertification=true
  alt isCertification and URL valid
    LinkedEntity->UI: Display issuer name + "(View Certificate)" link
  else
    LinkedEntity->UI: Display issuer name only
  end
Loading
sequenceDiagram
  participant User
  participant UI
  participant FileInput
  participant CropModal
  participant UploadService
  participant ResumeStore

  User->FileInput: Select image file
  FileInput->UI: Validate file type/size
  alt Valid image
    UI->CropModal: Open crop modal with preview
    User->CropModal: Adjust and confirm crop
    CropModal->UI: Get cropped image data
    UI->UploadService: Upload cropped image
    UploadService->ResumeStore: Update picture URL
  else
    UI->User: Show error
  end
Loading

Poem

A badge for your skills, a link for your pride,
Now "View Certificate" sits right by your side.
Crop your new picture, make it just right—
With code and with care, your resume’s bright!
🐰✨
— The CodeRabbit

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

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.

Copy link

@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: 5

🧹 Nitpick comments (2)
apps/server/project.json (1)

30-32: Document rationale for experimental flag
The --experimental-specifier-resolution=node flag can alter module loading semantics. Consider adding a comment or updating the README to explain why this flag is required and when it can be removed once Node.js stabilizes this feature.

apps/client/src/pages/builder/sidebars/left/sections/picture/section.tsx (1)

318-324: Consider fixing prop sorting for consistency

Static analysis indicates props should be sorted according to your project's ESLint rules.

 <ReactCrop
   crop={crop}
-  aspect={1}
   circularCrop
+  aspect={1}
   className="max-w-full mx-auto"
   onChange={(newCrop) => setCrop(newCrop)}
 >

And for the Button:

-<Button onClick={onCropComplete} disabled={isLoading}>
+<Button disabled={isLoading} onClick={onCropComplete}>

Also applies to: 341-341

🧰 Tools
🪛 ESLint

[error] 321-321: Shorthand props must be listed before all other props

(react/jsx-sort-props)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cd21860 and 37b1c31.

⛔ Files ignored due to path filters (5)
  • libs/hooks/package-lock.json is excluded by !**/package-lock.json
  • libs/schema/package-lock.json is excluded by !**/package-lock.json
  • libs/ui/package-lock.json is excluded by !**/package-lock.json
  • libs/utils/package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • apps/artboard/src/templates/azurill.tsx (5 hunks)
  • apps/artboard/src/templates/bronzor.tsx (5 hunks)
  • apps/artboard/src/templates/chikorita.tsx (5 hunks)
  • apps/artboard/src/templates/ditto.tsx (5 hunks)
  • apps/artboard/src/templates/gengar.tsx (5 hunks)
  • apps/artboard/src/templates/glalie.tsx (5 hunks)
  • apps/artboard/src/templates/kakuna.tsx (5 hunks)
  • apps/artboard/src/templates/leafish.tsx (5 hunks)
  • apps/artboard/src/templates/nosepass.tsx (6 hunks)
  • apps/artboard/src/templates/onyx.tsx (5 hunks)
  • apps/artboard/src/templates/pikachu.tsx (5 hunks)
  • apps/artboard/src/templates/rhyhorn.tsx (5 hunks)
  • apps/client/src/pages/builder/sidebars/left/sections/picture/section.tsx (3 hunks)
  • apps/server/project.json (1 hunks)
  • libs/hooks/package.json (1 hunks)
  • libs/schema/package.json (1 hunks)
  • libs/ui/package.json (1 hunks)
  • libs/utils/package.json (1 hunks)
  • package.json (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (12)
apps/artboard/src/templates/gengar.tsx (1)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
apps/artboard/src/templates/ditto.tsx (1)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
apps/artboard/src/templates/nosepass.tsx (1)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
apps/artboard/src/templates/onyx.tsx (1)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
apps/artboard/src/templates/azurill.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
apps/artboard/src/templates/bronzor.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
apps/artboard/src/templates/rhyhorn.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
apps/artboard/src/templates/kakuna.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
apps/artboard/src/templates/leafish.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
apps/artboard/src/templates/glalie.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
apps/artboard/src/templates/pikachu.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
apps/artboard/src/templates/chikorita.tsx (2)
libs/utils/src/namespaces/string.ts (1)
  • isUrl (15-21)
libs/utils/src/namespaces/style.ts (1)
  • cn (14-14)
🪛 ESLint
apps/client/src/pages/builder/sidebars/left/sections/picture/section.tsx

[error] 321-321: Shorthand props must be listed before all other props

(react/jsx-sort-props)


[error] 341-341: Callbacks must be listed after all other props

(react/jsx-sort-props)

🔇 Additional comments (63)
libs/utils/package.json (1)

12-12: Self-referential dependency added
The local "@reactive-resume/utils": "file:" entry aligns with other monorepo packages and enables internal linking during development and build.

libs/ui/package.json (1)

16-18: Consistent self-dependency entry
Adding "@reactive-resume/ui": "file:" standardizes dependency declarations across the monorepo and supports local package resolution.

package.json (2)

175-175: Review slugify version downgrade
The version of "@sindresorhus/slugify" was rolled back from ^2.2.1 to ^1.1.2, which may include breaking API changes. Please verify that all existing slugify calls remain compatible with v1.x.


232-232: New image cropping dependency
Introducing "react-image-crop": "^11.0.7" supports the client-side image cropping feature. Ensure the import and tree-shaking are configured correctly in production builds.

libs/schema/package.json (1)

19-21: Self-referential dependency addition
The "@reactive-resume/schema": "file:" entry follows the pattern of other library manifests, enabling local linkage without external registry publishing.

apps/artboard/src/templates/leafish.tsx (1)

154-196: Well-implemented certification link handling!

The LinkedEntity component changes effectively address the PR objective by providing specialized rendering for certification links. The three rendering paths are clearly defined and the "View Certificate" label provides a concise, user-friendly alternative to displaying full URLs.

apps/artboard/src/templates/chikorita.tsx (6)

150-150: LGTM: Clean type definition enhancement.

The addition of the optional isCertification prop follows TypeScript best practices and provides the necessary typing for the component enhancement.


210-210: LGTM: Proper section detection and link suppression.

The certification section detection and conditional link suppression logic is correctly implemented and aligns with the PR objective of preventing duplicate links in the certifications section.

Also applies to: 232-234


365-370: LGTM: Correct certification flag implementation.

The addition of isCertification={true} properly enables the specialized rendering behavior for certification entries.


150-150: LGTM: Clean interface extension

The addition of the optional isCertification prop to LinkedEntityProps is a clean, backward-compatible interface extension that enables specialized rendering for certification links.


210-210: LGTM: Effective solution for preventing duplicate links

The certification section detection and conditional link suppression effectively prevents duplicate or redundant links in the certifications section while maintaining separate links for other sections.

Also applies to: 232-234


365-370: LGTM: Enables certification-specific rendering

The addition of isCertification={true} to the LinkedEntity component in the certifications section correctly enables the specialized rendering behavior for certification links.

apps/artboard/src/templates/onyx.tsx (7)

165-165: LGTM: Consistent type definition enhancement.

The optional isCertification prop addition is correctly implemented and consistent with the pattern across templates.


168-196: LGTM: Clean and consistent certification link implementation.

The conditional rendering logic is well-structured and uses consistent "View Certificate" text. The implementation properly handles all scenarios with appropriate security attributes.


219-219: LGTM: Consistent section detection and link suppression.

The certification section detection and link suppression logic is correctly implemented and consistent with the pattern across templates.

Also applies to: 241-243


355-360: LGTM: Proper certification flag usage.

The isCertification={true} flag is correctly passed to enable specialized certification rendering.


165-165: LGTM: Specialized certification rendering with different priority

The implementation correctly adds certification-specific rendering. Note that this template prioritizes the certification check before the separateLinks check, ensuring certifications always use the specialized "(View Certificate)" format regardless of the separateLinks setting.

Also applies to: 168-183


219-219: LGTM: Consistent duplicate link prevention

The certification section detection and conditional link suppression follows the same effective pattern used across templates to prevent duplicate links in the certifications section.

Also applies to: 241-243


355-360: LGTM: Activates certification-specific behavior

The isCertification={true} prop correctly enables the specialized certification rendering in the LinkedEntity component.

apps/artboard/src/templates/rhyhorn.tsx (7)

146-146: LGTM: Consistent type enhancement.

The isCertification prop addition follows the established pattern and is correctly implemented.


149-183: LGTM: Well-structured certification link handling.

The implementation correctly handles all certification link scenarios with consistent "View Certificate" text and proper security attributes. The conditional logic is clear and follows the established pattern.


206-206: LGTM: Proper certification section handling.

The section detection and link suppression logic is correctly implemented and consistent across templates.

Also applies to: 228-230


361-366: LGTM: Correct certification flag implementation.

The certification flag is properly passed to enable specialized rendering behavior.


146-146: LGTM: Consistent certification rendering implementation

The LinkedEntity component correctly implements the certification-specific rendering logic, following the same pattern as the chikorita template with proper conditional flow and appropriate security attributes.

Also applies to: 149-182


206-206: LGTM: Effective duplicate link prevention

The certification section detection and conditional link suppression effectively prevents redundant links while maintaining the intended behavior for other sections.

Also applies to: 228-230


361-366: LGTM: Enables certification-specific rendering

The isCertification={true} prop correctly activates the specialized certification link behavior in the LinkedEntity component.

apps/artboard/src/templates/azurill.tsx (7)

154-154: LGTM: Consistent type definition.

The isCertification prop addition is correctly implemented and follows the established pattern across all templates.


157-191: LGTM: Consistent and secure certification link implementation.

The conditional rendering logic correctly handles all certification scenarios with consistent "View Certificate" text and appropriate security attributes (rel="noopener noreferrer").


214-214: LGTM: Consistent section detection and link suppression.

The certification section detection and conditional link suppression is correctly implemented and aligns with the pattern across all templates.

Also applies to: 264-264


363-368: LGTM: Proper certification flag usage.

The isCertification={true} flag is correctly passed to enable the specialized certification rendering behavior.


154-154: LGTM: Consistent certification rendering logic

The LinkedEntity component implementation follows the established pattern with proper conditional rendering for certifications and appropriate security attributes for external links.

Also applies to: 157-190


214-214: LGTM: Consistent duplicate link prevention

The certification section detection and conditional link suppression maintains consistency with other templates and effectively prevents duplicate links in the certifications section.

Also applies to: 264-264


363-368: LGTM: Activates certification-specific behavior

The isCertification={true} prop correctly enables the specialized certification rendering behavior in the LinkedEntity component.

apps/artboard/src/templates/gengar.tsx (4)

152-152: LGTM: Clean prop addition for certification handling

The optional isCertification prop is well-designed and maintains backward compatibility.


155-184: Excellent implementation of certification-specific rendering

The logic correctly handles different scenarios:

  • Provides clear "(View Certificate)" text for certifications
  • Maintains existing Link component behavior for non-certifications
  • Includes proper security attributes (rel="noopener noreferrer")
  • Uses descriptive link text for accessibility

208-208: Smart solution to prevent duplicate links in certifications

The isCertificationsSection flag effectively prevents redundant separate links when the LinkedEntity component already handles certification link display. This maintains clean UI without duplicate or conflicting links.

Also applies to: 230-232


363-368: Correct activation of certification-specific rendering

The addition of isCertification={true} properly enables the specialized rendering logic for certification links while maintaining all existing functionality.

apps/artboard/src/templates/pikachu.tsx (3)

180-180: LGTM: Consistent prop addition

The optional isCertification prop addition is consistent with other templates.


240-240: LGTM: Consistent duplicate link prevention

The isCertificationsSection logic correctly prevents duplicate links in the certifications section.

Also applies to: 262-264


395-400: LGTM: Proper certification flag activation

The isCertification={true} correctly enables the specialized rendering for certification items.

apps/artboard/src/templates/nosepass.tsx (4)

149-149: LGTM: Consistent prop addition

The optional isCertification prop maintains consistency across templates.


152-181: Excellent clean implementation of certification rendering

This implementation has clear separation of concerns:

  • Maintains original Link behavior when !separateLinks
  • Provides specialized certification rendering when isCertification is true
  • No overlapping conditions that could cause rendering issues
  • Proper security attributes and accessibility

204-204: LGTM: Comprehensive duplicate link prevention

The isCertificationsSection logic is properly applied in both rendering paths (with and without dateKey) to prevent duplicate links consistently.

Also applies to: 238-238, 276-276


383-388: LGTM: Proper certification activation

The isCertification={true} correctly enables specialized rendering for certification items.

apps/artboard/src/templates/ditto.tsx (4)

165-165: LGTM: Consistent prop addition

The optional isCertification prop maintains consistency across all templates.


168-197: Excellent implementation following best practices

This implementation demonstrates clean separation of concerns:

  • Clear conditional logic without overlapping cases
  • Maintains existing Link component behavior for non-certifications
  • Specialized certification rendering with descriptive text
  • Proper security attributes (rel="noopener noreferrer")
  • Good accessibility with clear link text

221-221: LGTM: Effective duplicate link prevention

The isCertificationsSection flag correctly prevents redundant separate links in the certifications section.

Also applies to: 247-247


383-388: LGTM: Proper certification flag usage

The isCertification={true} correctly activates the specialized rendering logic for certification items.

apps/artboard/src/templates/bronzor.tsx (5)

145-145: LGTM! Well-typed optional prop addition.

The new isCertification prop is properly typed as optional, ensuring backward compatibility while enabling the new certification-specific behavior.


148-182: Excellent implementation addressing certification link overflow.

The three-case rendering logic effectively solves the URL overflow issue by:

  1. Using consistent "View Certificate" text instead of potentially long URLs
  2. Providing clear, readable link presentation for certifications
  3. Maintaining proper accessibility with security attributes

The implementation is clean, well-structured, and maintains backward compatibility.


205-206: Smart section detection for preventing duplicate links.

The isCertificationsSection flag effectively identifies when to suppress separate link rendering, preventing UI clutter and potential confusion.


229-229: Proper conditional logic to prevent duplicate certification links.

The condition !isCertificationsSection && ensures that separate links are not rendered in the certifications section, where the specialized LinkedEntity rendering already handles URLs appropriately.


360-365: Perfect integration enabling certification-specific rendering.

The addition of isCertification={true} activates the specialized link handling for certification items while preserving all existing functionality and styling.

apps/artboard/src/templates/kakuna.tsx (5)

164-165: Consistent prop addition across templates.

The isCertification prop is implemented identically to other templates, ensuring consistent behavior across all resume templates.


167-201: Consistent LinkedEntity implementation.

The three-case rendering logic matches the implementation in other templates, providing uniform certification link handling across all resume designs.


224-225: Consistent section detection logic.

The isCertificationsSection detection maintains consistency with other template implementations.


261-261: Consistent link suppression logic.

The conditional logic for preventing duplicate links matches the pattern established in other templates.


339-344: Consistent certification component integration.

The isCertification={true} prop is passed consistently with other template implementations.

apps/artboard/src/templates/glalie.tsx (5)

160-161: Consistent prop addition across all templates.

The isCertification prop implementation matches the other templates perfectly, ensuring uniform behavior.


163-197: Consistent LinkedEntity implementation across templates.

The three-case rendering logic is implemented identically to other templates, providing consistent certification link handling.


220-221: Consistent section detection implementation.

The isCertificationsSection detection maintains the established pattern across templates.


244-246: Consistent link suppression logic with improved formatting.

The conditional logic prevents duplicate links consistently with other templates. The multi-line formatting enhances readability while maintaining identical functionality.


377-382: Consistent certification component integration.

The isCertification={true} prop integration matches the pattern established in other templates.

Comment on lines +16 to +17
"dependencies": {
"@reactive-resume/hooks": "file:"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove the self-referential dependency

A package cannot declare itself as a dependency. This creates a circular dependency that will cause issues during package installation and build processes.

Remove the self-referential dependency:

-  },
-  "dependencies": {
-    "@reactive-resume/hooks": "file:"
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dependencies": {
"@reactive-resume/hooks": "file:"
}
🤖 Prompt for AI Agents
In libs/hooks/package.json at lines 16 to 17, remove the dependency entry
"@reactive-resume/hooks": "file:" because a package cannot depend on itself.
This self-referential dependency causes circular dependency issues during
installation and build. Simply delete this line from the dependencies section to
fix the problem.

Comment on lines +155 to +156
ctx.fillStyle = t`rgba(0, 0, 0, 0)`;
ctx.fillRect(0, 0, canvas.width, canvas.height);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix incorrect use of the translation function

The t function is for internationalization, not for creating template literals. Use a regular string for the fillStyle color value.

-    ctx.fillStyle = t`rgba(0, 0, 0, 0)`;
+    ctx.fillStyle = "rgba(0, 0, 0, 0)";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ctx.fillStyle = t`rgba(0, 0, 0, 0)`;
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = "rgba(0, 0, 0, 0)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
🤖 Prompt for AI Agents
In apps/client/src/pages/builder/sidebars/left/sections/picture/section.tsx at
lines 155-156, the fillStyle is incorrectly set using the translation function
`t` instead of a plain string. Replace the use of `t` with a regular string
literal for the rgba color value to correctly set the fillStyle without invoking
the translation function.

Comment on lines +153 to 187
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{isCertification ? "Certification URL" : (url.label || url.href)}
</a>
</div>
);
}

if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}

return <div className={className}>{name}</div>;
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistent certification link text.

The implementation logic is sound, but there's an inconsistency in the link text. Line 164 displays "Certification URL" while other templates (onyx.tsx, rhyhorn.tsx, azurill.tsx) consistently use "View Certificate". This inconsistency could confuse users and harm the user experience.

Apply this diff to standardize the link text:

-          {isCertification ? "Certification URL" : (url.label || url.href)}
+          {isCertification ? "View Certificate" : (url.label || url.href)}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{isCertification ? "Certification URL" : (url.label || url.href)}
</a>
</div>
);
}
if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}
return <div className={className}>{name}</div>;
};
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{isCertification ? "View Certificate" : (url.label || url.href)}
</a>
</div>
);
}
if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}
return <div className={className}>{name}</div>;
};
🤖 Prompt for AI Agents
In apps/artboard/src/templates/chikorita.tsx between lines 153 and 187, the link
text for certification URLs is inconsistent; line 164 uses "Certification URL"
whereas other templates use "View Certificate". To fix this, change the text on
line 164 from "Certification URL" to "View Certificate" to standardize the user
experience across templates.

⚠️ Potential issue

Fix text inconsistency in certification link

The logic implementation is sound, but there's a text inconsistency on line 164. While other templates use "View Certificate", this template uses "Certification URL".

Apply this diff to maintain consistency across templates:

-          {isCertification ? "Certification URL" : (url.label || url.href)}
+          {isCertification ? "View Certificate" : (url.label || url.href)}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{isCertification ? "Certification URL" : (url.label || url.href)}
</a>
</div>
);
}
if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}
return <div className={className}>{name}</div>;
};
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{isCertification ? "View Certificate" : (url.label || url.href)}
</a>
</div>
);
}
if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}
return <div className={className}>{name}</div>;
};
🤖 Prompt for AI Agents
In apps/artboard/src/templates/chikorita.tsx between lines 153 and 187, the text
for the certification link is inconsistent; it uses "Certification URL" instead
of the standard "View Certificate". Update the text inside the anchor tag in the
first conditional block from "Certification URL" to "View Certificate" to align
with other templates.

Comment on lines +183 to +216
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary group-[.summary]:text-background" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{isCertification ? "View Certificate" : (url.label || url.href)}
</a>
</div>
);
}

if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}

return <div className={className}>{name}</div>;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix logic issue with overlapping conditions

There's a logic problem when both !separateLinks and isCertification are true. The first condition will execute and show only "View Certificate" text without the issuer name, which may not be the intended behavior.

Consider refactoring the logic to handle certification cases explicitly first:

 const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
+  if (isCertification && isUrl(url.href)) {
+    return (
+      <div className={cn("flex items-center gap-x-1.5", className)}>
+        <span>{name}</span>
+        <a 
+          href={url.href} 
+          target="_blank"
+          rel="noopener noreferrer"
+          className="ml-1.5 hover:underline"
+        >
+          (View Certificate)
+        </a>
+      </div>
+    );
+  }
+
   if (!separateLinks && isUrl(url.href)) {
     return (
       <div className={cn("flex items-center gap-x-1.5", className)}>
         <i className="ph ph-bold ph-globe text-primary group-[.summary]:text-background" />
         <a href={url.href} target="_blank" rel="noopener noreferrer" className="hover:underline">
-          {isCertification ? "View Certificate" : (url.label || url.href)}
+          {url.label || url.href}
         </a>
       </div>
     );
   }

-  if (isCertification && isUrl(url.href)) {
-    return (
-      <div className={cn("flex items-center gap-x-1.5", className)}>
-        <span>{name}</span>
-        <a 
-          href={url.href} 
-          target="_blank"
-          rel="noopener noreferrer"
-          className="ml-1.5 hover:underline"
-        >
-          (View Certificate)
-        </a>
-      </div>
-    );
-  }

   return <div className={className}>{name}</div>;
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary group-[.summary]:text-background" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{isCertification ? "View Certificate" : (url.label || url.href)}
</a>
</div>
);
}
if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}
return <div className={className}>{name}</div>;
const LinkedEntity = ({ name, url, separateLinks, className, isCertification }: LinkedEntityProps) => {
// Handle certification links first, so we always show issuer name + "(View Certificate)"
if (isCertification && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<span>{name}</span>
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="ml-1.5 hover:underline"
>
(View Certificate)
</a>
</div>
);
}
// Then handle normal external links (when separateLinks is false)
if (!separateLinks && isUrl(url.href)) {
return (
<div className={cn("flex items-center gap-x-1.5", className)}>
<i className="ph ph-bold ph-globe text-primary group-[.summary]:text-background" />
<a
href={url.href}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{url.label || url.href}
</a>
</div>
);
}
// Fallback: just show the name
return <div className={className}>{name}</div>;
};
🤖 Prompt for AI Agents
In apps/artboard/src/templates/pikachu.tsx around lines 183 to 216, the current
logic causes the first condition to execute when both !separateLinks and
isCertification are true, resulting in missing the issuer name display. To fix
this, reorder the conditions to check for isCertification and isUrl(url.href)
first, rendering the certification view with the issuer name and link, then
handle the !separateLinks case afterward. This ensures certification cases are
handled explicitly and correctly before the general link rendering.

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.

2 participants