Skip to content

feat: Add ContactCard state, primitives and small components - #820

Open
Elouan1411 wants to merge 10 commits into
vcard-2-setup-modulefrom
vcard-3-viewmodel-primitives
Open

feat: Add ContactCard state, primitives and small components#820
Elouan1411 wants to merge 10 commits into
vcard-2-setup-modulefrom
vcard-3-viewmodel-primitives

Conversation

@Elouan1411

Copy link
Copy Markdown
Contributor

No description provided.

@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from 2af33ef to 74b2c73 Compare July 24, 2026 06:59
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from 74b2c73 to 4772e69 Compare July 24, 2026 07:23
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from 4772e69 to d1fb95a Compare July 24, 2026 07:28
@Elouan1411 Elouan1411 changed the title feat: Add ContactCard state, primitives and small components  feat: Add ContactCard state, primitives and small components Jul 24, 2026
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch 3 times, most recently from 71026ed to fdb1a22 Compare July 24, 2026 08:09
@Elouan1411
Elouan1411 requested a review from Copilot July 24, 2026 08:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds reusable state, styling defaults, and Compose primitives for the Contact Card feature.

Changes:

  • Adds top-bar state and customizable colors.
  • Adds editor, preview, loading, dialog, and layout components.
  • Adds preview fixtures for contact-card UI tooling.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ContactCardTopBarState.kt Defines top-bar modes and callbacks.
ContactCardDefaults.kt Provides theme-aware card colors.
SectionCard.kt Adds section container UI.
PreviewTopBar.kt Adds preview navigation actions.
PreviewData.kt Provides preview model fixtures.
LoadingContent.kt Adds centered loading UI.
FieldDivider.kt Adds field separator styling.
EditorTopBar.kt Adds editor cancel/save actions.
EditorField.kt Adds reusable single-line input.
DefaultValidationErrorDialog.kt Adds validation error dialog.
DefaultDeleteConfirmationDialog.kt Adds deletion confirmation dialog.
ContactInfoRows.kt Displays available contact information.
ContactCardTopBar.kt Adds shared centered top bar.
ContactCardConstants.kt Defines shared card radius.
BottomSheetAction.kt Adds reusable bottom-sheet action row.

@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from fdb1a22 to a3fce2a Compare August 3, 2026 15:05
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from a3fce2a to e082a8f Compare August 11, 2026 10:39
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from e082a8f to 9a91d1e Compare August 12, 2026 12:32
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from 9a91d1e to 3480a38 Compare August 13, 2026 06:54
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from 3480a38 to e314d75 Compare August 13, 2026 06:57
@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from e314d75 to e16e4c4 Compare August 13, 2026 07:26
}
}
Column(modifier = modifier) {
rows.forEachIndexed { index, (label, value) ->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if you don't have anything in rows, no need to have an empty column ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There will always be at least one Row since phone is required

import com.infomaniak.core.ui.compose.contactcard.R

@Composable
internal fun DefaultValidationErrorDialog(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could group DefaultDeleteConfirmationDialog and DefaultValidationErrorDialog. the only thing changing are the strings.

internal fun LoadingContent() {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
CircularProgressIndicator()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was that really necessary instead of just using the CircularProgressIndicator where you needed it ?

import com.infomaniak.core.auth.models.user.preferences.OrganizationPreference
import com.infomaniak.core.auth.models.user.preferences.Preferences

internal fun previewUser(): User {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could use PreviewParameterProvider for that.

)
}
},
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's not really necessary to create a Composable just for the preview. Especially here, it's not that long.

@Elouan1411
Elouan1411 force-pushed the vcard-3-viewmodel-primitives branch from e16e4c4 to e314d75 Compare August 13, 2026 16:09
@sonarqubecloud

Copy link
Copy Markdown

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