Skip to content

Change data structure behind app data model#97

Draft
tmueller wants to merge 1 commit intomainfrom
81-order-of-contact-information-on-the-card-should-be-same-as-the-order-of-url-parameters-in-url
Draft

Change data structure behind app data model#97
tmueller wants to merge 1 commit intomainfrom
81-order-of-contact-information-on-the-card-should-be-same-as-the-order-of-url-parameters-in-url

Conversation

@tmueller
Copy link
Collaborator

Resolves #81 and #51

@tmueller tmueller changed the title 🚧 Implement changes to app data model Change data structure behind app data model Apr 23, 2025
@kirkone kirkone requested a review from Copilot July 24, 2025 17:24
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 refactors the AppData model from individual optional fields for contact information to a unified array-based structure. The change consolidates all contact/social media fields (phone, email, web, social platforms, etc.) from separate O.Option<string> properties into a single info array containing tuples of type and value pairs.

  • Replaces individual optional contact fields with a unified info: Array<[type, value]> structure
  • Updates all consuming components and functions to work with the new array-based data model
  • Introduces helper functions like getAppDataInfo to extract specific contact information types

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Cards/src/model/app-data.ts Replaces individual contact fields with unified info array structure and adds helper function
src/Cards/src/model/v-card-url.ts Updates vCard generation to work with new data structure using getAppDataInfo helper
src/Cards/src/components/card.tsx Refactors component to process info array instead of individual contact fields
src/Cards/src/components/card.stories.tsx Updates test data generation to use new array-based structure
Comments suppressed due to low confidence (1)

src/Cards/src/model/v-card-url.ts:76

  • The variable name 'a' is used twice in the same expression with different meanings - once for the AppData parameter and once for the avatar object. Consider renaming the inner variable to 'avatar' for clarity.
        avatarBase64: pipe(a.avatar, O.map(a => a.url)),

export const WithThreeMediaExpandVisible: Story = {
args: {
...WithThreeMediaExpandNotVisible.args,
expanded: false,
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The 'expanded' property is set to false, but this story is meant to show the expand functionality as visible. This should likely be true or removed to use the default.

Suggested change
expanded: false,
expanded: true,

Copilot uses AI. Check for mistakes.
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.

Order of contact information on the card should be same as the order of URL parameters in URL Same info should be able to occur multiple times

2 participants