Skip to content

Conversation

smurflo2
Copy link
Collaborator

@smurflo2 smurflo2 commented Aug 28, 2025

Overview

🎟 Relevant Jira Issues

LC-1081

📚 What is the context and goal of this PR?

We had some handling for the alignments field, but it wasn't quite right. So this is mostly just changing the field name from alignment to alignments. It also adds updates some types and adds the alignments field to the storybook AllFieldsCredential test credential

🥴 TL; RL:

Properly handle Obv3 alignments field

💡 Feature Breakdown (screenshots & videos encouraged!)

image image

🛠 Important tradeoffs made:

🔍 Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (refactor, documentation update, etc)

💳 Does This Create Any New Technical Debt? ( If yes, please describe and add JIRA TODOs )

  • No
  • Yes

Testing

🔬 How Can Someone QA This?

  • pnpm storybook (from LearnCard dir)
  • Check CertificateDisplayCard and VCDisplayCard2 -> All Fields Test
  • On the back (Details) of the credential, you should see the Alignments box

📱 🖥 Which devices would you like help testing on?

🧪 Code Coverage

Documentation

📜 Gitbook

📊 Storybook

✅ PR Checklist

  • Related to a Jira issue (create one if not)
  • My code follows style guidelines (eslint / prettier)
  • I have manually tested common end-2-end cases
  • I have reviewed my code
  • I have commented my code, particularly where ambiguous
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to gitbook documentation

🚀 Ready to squash-and-merge?:

  • Code is backwards compatible
  • There is not a "Do Not Merge" label on this PR
  • I have thoughtfully considered the security implications of this change.
  • This change does not expose new public facing endpoints that do not have authentication

✨ PR Description

Purpose: Add OBv3 alignments field support to VC templates and React components to properly display credential alignments.
Main changes:

  • Updated VC templates to include optional alignments field and proper conditional rendering
  • Fixed component naming inconsistencies between AlignmentsBox and AlignmentRow
  • Added type definitions for Alignment import from @learncard/types
  • Added test credential with alignments field for storybook demonstration

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀

Copy link

changeset-bot bot commented Aug 28, 2025

🦋 Changeset detected

Latest commit: ef94948

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@learncard/vc-templates-plugin Patch
@learncard/react Patch
@learncard/init Patch
@learncard/network-brain-service Patch
@learncard/learn-cloud-service Patch
@learncard/chapi-example Patch
@learncard/snap-chapi-example Patch
@learncard/create-http-bridge Patch
@learncard/cli Patch
learn-card-discord-bot Patch
@learncard/network-brain-client Patch
@learncard/learn-cloud-client Patch
@learncard/learn-cloud-plugin Patch
@learncard/network-plugin Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

netlify bot commented Aug 28, 2025

Deploy Preview for learncarddocs canceled.

Name Link
🔨 Latest commit ef94948
🔍 Latest deploy log https://app.netlify.com/projects/learncarddocs/deploys/68caf6494b57d7000742d5d0

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The PR properly implements the change from 'alignment' to 'alignments' field throughout the codebase. The changes are consistent across components and templates, with appropriate type updates and test data additions.

1 issues detected:

🧹 Maintainability - Code is removed and immediately re-added in identical form, creating unnecessary version history noise.

Details: The address field code is removed and then immediately re-added in the exact same form, creating unnecessary diff noise without functional changes.
File: packages/plugins/vc-templates/src/templates.ts

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀

Copy link
Contributor

gitstream-cm bot commented Aug 28, 2025

🥷 Code experts: gerardopar, TaylorBeeston

gerardopar, TaylorBeeston have most 👩‍💻 activity in the files.
smurflo2, gerardopar have most 🧠 knowledge in the files.

See details

packages/plugins/vc-templates/src/templates.ts

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL 558 additions & 534 deletions 191 additions & 563 deletions
JUN
MAY
APR

Knowledge based on git-blame:
gerardopar: 22%

packages/plugins/vc-templates/src/types.ts

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL 3 additions & 0 deletions 4 additions & 1 deletions
JUN
MAY
APR

Knowledge based on git-blame:
gerardopar: 58%

packages/react-learn-card/src/components/CertificateDisplayCard/AlignmentRow.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL
JUN
MAY
APR

Knowledge based on git-blame:

packages/react-learn-card/src/components/CertificateDisplayCard/AlignmentsBox.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL
JUN
MAY
APR

Knowledge based on git-blame:

packages/react-learn-card/src/components/CertificateDisplayCard/CertificateBackFace.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL 7 additions & 2 deletions
JUN
MAY
APR

Knowledge based on git-blame:
smurflo2: 58%
gerardopar: 39%

packages/react-learn-card/src/components/CertificateDisplayCard/CertificateDisplayCard.stories.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL
JUN
MAY
APR

Knowledge based on git-blame:
smurflo2: 100%

packages/react-learn-card/src/components/MeritBadgeDisplayCard/AlignmentRow.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL
JUN
MAY
APR

Knowledge based on git-blame:
smurflo2: 100%

packages/react-learn-card/src/components/MeritBadgeDisplayCard/AlignmentsBox.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL
JUN
MAY
APR

Knowledge based on git-blame:
smurflo2: 100%

packages/react-learn-card/src/components/MeritBadgeDisplayCard/MeritBadgeBackFace.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL 7 additions & 2 deletions
JUN
MAY
APR

Knowledge based on git-blame:
smurflo2: 95%
gerardopar: 5%

packages/react-learn-card/src/components/VCDisplayCard2/VC2BackFace.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL 5 additions & 0 deletions
JUN
MAY
APR

Knowledge based on git-blame:
gerardopar: 55%
smurflo2: 36%

packages/react-learn-card/src/components/svgs/ThreeDotVertical.tsx

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL 41 additions & 0 deletions
JUN
MAY
APR

Knowledge based on git-blame:
gerardopar: 100%

packages/react-learn-card/src/helpers/test.helpers.ts

Activity based on git-commit:

gerardopar TaylorBeeston
SEP
AUG
JUL
JUN 62 additions & 0 deletions
MAY
APR

Knowledge based on git-blame:
smurflo2: 91%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The PR properly implements the transition from singular alignment to plural alignments field to comply with Open Badges v3 specification. The changes are consistent across the codebase and include proper test data updates.

2 issues detected:

🧾 Readability - Type and component names should follow consistent naming conventions for better code readability and maintainability.

Details: The type interface is named AlignmentsRowProps while the component function is named AlignmentRow, creating inconsistent naming convention that differs from the CertificateDisplayCard version which uses AlignmentRowProps.
File: packages/react-learn-card/src/components/MeritBadgeDisplayCard/AlignmentRow.tsx (4-4)

🧹 Maintainability - Duplicated code across multiple components increases maintenance burden and risk of inconsistent updates.

Details: The AlignmentRow component in MeritBadgeDisplayCard is identical to the one in CertificateDisplayCard, creating unnecessary code duplication that increases maintenance overhead and potential for inconsistencies.
File: packages/react-learn-card/src/components/MeritBadgeDisplayCard/AlignmentRow.tsx

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀

import React from 'react';
import CaretRightFilled from '../../assets/images/CaretRightFilled.svg';

type AlignmentsRowProps = {
Copy link
Contributor

Choose a reason for hiding this comment

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

🧾 Readability - Inconsistent Naming: Rename the type from AlignmentsRowProps to AlignmentRowProps to maintain consistency with the component name and match the pattern used in the CertificateDisplayCard version.

Suggested change
type AlignmentsRowProps = {
type AlignmentRowProps = {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant