Skip to content

[LWDM] feat(contacts): render desktop address label (LIVE-33919) - #20268

Closed
deepyjr wants to merge 2 commits into
developfrom
feat/contacts-LIVE-33919-render-address-label-desktop
Closed

[LWDM] feat(contacts): render desktop address label (LIVE-33919)#20268
deepyjr wants to merge 2 commits into
developfrom
feat/contacts-LIVE-33919-render-address-label-desktop

Conversation

@deepyjr

@deepyjr deepyjr commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • Desktop Contacts add-address dialog padding and layout
    • Address and label validation, including the shared 32-character limit
    • Navigation from the double-input form to review and success states

📝 Description

Contacts on Desktop did not compose the address-label state exposed by the shared flow, so users could not enter the address and its name together before review.

This PR displays the editable address and prefilled address-name inputs together in the Desktop dialog immediately after asset selection. The single Continue to review CTA is enabled only when both fields are valid, and the 32-character maximum is enforced in the shared domain model and input. Review and success states remain in the same dialog.

Cap.2026-07-31.at.11.46.58.mp4

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copilot AI review requested due to automatic review settings July 31, 2026 08:08
@live-github-bot live-github-bot Bot added desktop Has changes in LLD translations Translation files have been touched labels Jul 31, 2026
@live-github-bot live-github-bot Bot changed the title feat(contacts): render desktop address label (LIVE-33919) [LWD] feat(contacts): render desktop address label (LIVE-33919) Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ⏭️ Skipped
Native Storybook Build ⏭️ Skipped
React Storybook Build ⏭️ Skipped

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

This PR updates the Desktop Contacts “Add address” flow to explicitly render the address naming, review, and success steps within the same dialog, while enforcing a shared 32-character maximum for address labels at both UI and domain levels.

Changes:

  • Added shared web UI for the address-name step and a shared completion placeholder (review/success) step.
  • Composed the new naming/review/success steps into the Desktop MVVM dialog flow and added i18n labels.
  • Enforced and tested a shared 32-character address-label limit in the contact entity schema + validation logic.

Reviewed changes

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

Show a summary per file
File Description
features/flow/contacts/src/steps/AddAddress/web.ts Re-exports new shared web steps (name + completion) for Desktop composition.
features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.web.test.ts Adds a test ensuring review is blocked when label exceeds 32 chars.
features/flow/contacts/src/steps/AddAddress/Completion/ContactsAddAddressCompletion.web.tsx Adds a shared web “completion” view used for review/success screens.
features/flow/contacts/src/steps/AddAddress/AddressName/useContactsAddAddressNameViewModel.web.ts New view-model mapping shared state/labels to the web address-name view.
features/flow/contacts/src/steps/AddAddress/AddressName/types.ts Defines props/labels/view-props for the shared address-name web step.
features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressNameView.web.tsx Implements shared web address-name UI with max length enforcement.
features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressName.web.tsx Wires view + view-model for the shared address-name step.
features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressName.web.test.tsx Unit tests for prefill, validation error rendering, and continue gating.
domain/entity/contact/src/validation.ts Adds “too long” validation/exception behavior for address labels.
domain/entity/contact/src/validation.test.ts Updates tests to cover too-long address labels and thrown error class.
domain/entity/contact/src/schema.ts Introduces a shared CONTACT_ADDRESS_LABEL_MAX_LENGTH and schema .max(32).
domain/entity/contact/src/schema.test.ts Adds schema-level test for rejecting labels longer than 32 chars.
domain/entity/contact/src/errors.ts Adds ContactAddressLabelTooLongError + error-name constant to the union.
apps/ledger-live-desktop/static/i18n/en/app.json Adds Desktop translations for naming/review/success steps and errors.
apps/ledger-live-desktop/src/mvvm/features/Contacts/screens/Contacts/useContactsViewModel.ts Composes naming/review/success labels and hooks the new flow actions into the dialog props.
apps/ledger-live-desktop/src/mvvm/features/Contacts/screens/Contacts/components/ContactsAddAddressFlowDialog/types.ts Extends dialog props for entry/name/review labels and new callbacks.
apps/ledger-live-desktop/src/mvvm/features/Contacts/screens/Contacts/components/ContactsAddAddressFlowDialog/index.ts Re-exports the new review-labels type.
apps/ledger-live-desktop/src/mvvm/features/Contacts/screens/Contacts/components/ContactsAddAddressFlowDialog/ContactsAddAddressFlowDialog.tsx Adds “name”, “review”, and “success” screens to the Desktop add-address dialog flow.
apps/ledger-live-desktop/src/mvvm/features/Contacts/integrations/Contacts.integration.test.tsx Integration test validating in-dialog navigation + prefill + validation gating.
.changeset/live-33919-desktop-address-label.md Declares package version bumps for the new shared flow + entity validation changes.
Suppressed comments (1)

domain/entity/contact/src/validation.ts:90

  • Same issue as above: parseContactAddressLabel checks draftLabel.length before trimming, so a label that becomes <= 32 characters after trimming can incorrectly throw ContactAddressLabelTooLongError. Use the trimmed length to stay consistent with ContactAddressLabelSchema.
  if (draftLabel.length > CONTACT_ADDRESS_LABEL_MAX_LENGTH) {
    throw new ContactAddressLabelTooLongError();
  }

Comment thread domain/entity/contact/src/validation.ts Outdated
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 7 projects with changes.

📊 Quick Summary
Project Total Size Change
desktop-main 2.3 MB -
desktop-preloader 7.1 KB -
desktop-renderer 80.7 MB -
desktop-webviewDappPreloader 36.9 KB -
desktop-webviewPreloader 200.0 B -
desktop-workers 36.8 KB -
mobile 261.4 MB -
📋 Detailed Reports (Click to expand)

📁 desktop-main

Path: rsdoctor/desktop-main/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.3 MB - -
📄 JavaScript 2.2 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 135.3 KB - -

📁 desktop-preloader

Path: rsdoctor/desktop-preloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 7.1 KB - -
📄 JavaScript 5.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 1.8 KB - -

📁 desktop-renderer

Path: rsdoctor/desktop-renderer/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 80.7 MB - -
📄 JavaScript 29.3 MB - -
🎨 CSS 183.2 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 51.2 MB - -

📁 desktop-webviewDappPreloader

Path: rsdoctor/desktop-webviewDappPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.9 KB - -
📄 JavaScript 36.9 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-webviewPreloader

Path: rsdoctor/desktop-webviewPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 200.0 B - -
📄 JavaScript 200.0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-workers

Path: rsdoctor/desktop-workers/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.8 KB - -
📄 JavaScript 36.8 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 261.4 MB - -
📄 JavaScript 110.4 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 151.0 MB - -

Generated by Rsdoctor GitHub Action

@deepyjr
deepyjr force-pushed the feat/contacts-LIVE-33919-render-address-label-desktop branch from 65435a1 to 6d92dcc Compare July 31, 2026 09:08
Copilot AI review requested due to automatic review settings July 31, 2026 09:08
@deepyjr
deepyjr force-pushed the feat/contacts-LIVE-33919-render-address-label-desktop branch from 6d92dcc to 87c4002 Compare July 31, 2026 09:17

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

Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.

Suppressed comments (3)

domain/entity/contact/src/validation.ts:58

  • The new max-length check uses the raw string length, but the schema trims input (NonEmptyStringSchema.trim). This can incorrectly flag labels as too long when they only exceed 32 characters due to leading/trailing spaces (and can also turn an all-spaces draft into a too-long error instead of “no error”). Align the check with the schema by measuring the trimmed length.
  const trimmedDraftLabel = draftLabel.trim();

  if (trimmedDraftLabel.length > CONTACT_ADDRESS_LABEL_MAX_LENGTH) {

domain/entity/contact/src/validation.ts:90

  • Same issue as above: parseContactAddressLabel checks draftLabel.length before the schema trims. This can throw ContactAddressLabelTooLongError for inputs that would be valid after trimming. Use the trimmed length for the pre-check so behavior matches ContactAddressLabelSchema.
  existingLabels: readonly ContactAddressLabel[] = [],
): ContactAddressLabel {
  const trimmedDraftLabel = draftLabel.trim();

features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressName.web.test.tsx:96

  • This test asserts the validation message via a "helpertext" attribute, which couples the test to a specific DOM implementation detail of TextInput. Elsewhere in the codebase (e.g. apps/ledger-live-desktop/src/mvvm/features/Contacts/integrations/Contacts.integration.test.tsx:288) validation messages are asserted as visible text, which is both user-facing and less brittle.
    expect(screen.getByTestId("contacts-add-address-name-input")).toHaveAttribute(
      "helpertext",
      message,
    );

Copilot AI review requested due to automatic review settings July 31, 2026 09:18

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

Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.

@live-github-bot

live-github-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Desktop Bundle Checks

Comparing cf8a443 against 08a0454.

✅ Previous issues have all been fixed.

Mobile Bundle Checks

Comparing cf8a443 against 08a0454.

✅ Previous issues have all been fixed.

Base automatically changed from feat/contacts-LIVE-33918-model-address-label to develop July 31, 2026 09:32
@deepyjr
deepyjr force-pushed the feat/contacts-LIVE-33919-render-address-label-desktop branch from 87c4002 to c8abf08 Compare August 3, 2026 07:09
Copilot AI review requested due to automatic review settings August 3, 2026 07:09

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

Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 3, 2026 07:36
@live-github-bot live-github-bot Bot added the mobile Has changes in LLM label Aug 3, 2026
@live-github-bot live-github-bot Bot changed the title [LWD] feat(contacts): render desktop address label (LIVE-33919) [LWDM] feat(contacts): render desktop address label (LIVE-33919) Aug 3, 2026

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

Copilot reviewed 30 out of 30 changed files in this pull request and generated no new comments.

Suppressed comments (1)

domain/entity/contact/src/schema.ts:16

  • CONTACT_ADDRESS_LABEL_MAX_LENGTH is now defined in @domain/entity-contact (here) while the add-address flow still has its own features/flow/contacts/.../model/constants.ts with the same constant. This creates two sources of truth for the same business constraint (the label max length) and makes future changes error-prone (UI and flow validation could drift). Prefer keeping the constant only in the domain entity package and importing it everywhere else (flow + UI), or re-exporting it from the flow package without redefining it.
export const CONTACT_ADDRESS_LABEL_MAX_LENGTH = 32;

@deepyjr
deepyjr marked this pull request as ready for review August 3, 2026 08:01
@deepyjr
deepyjr requested a review from a team as a code owner August 3, 2026 08:01
@deepyjr
deepyjr requested a review from a team as a code owner August 3, 2026 08:01
@deepyjr
deepyjr marked this pull request as draft August 3, 2026 08:12
Copilot AI review requested due to automatic review settings August 3, 2026 08:22
@deepyjr
deepyjr force-pushed the feat/contacts-LIVE-33919-render-address-label-desktop branch from ffe3097 to f20a5e4 Compare August 3, 2026 08:22
@deepyjr

deepyjr commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by a focused stacked split: the Flow and compatibility changes move to #20316, while the Desktop integration will be recreated on top of it.

@deepyjr deepyjr closed this Aug 3, 2026

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

Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.

Suppressed comments (2)

features/flow/contacts/src/steps/AddAddress/useContactsAddAddressEntryViewModel.web.ts:96

  • isConfirmEnabled is gated by isNameValid, but isNameValid currently depends only on addressLabel being defined. Since the view only renders the name input when addressLabel && nameLabels && onAddressLabelChange, it’s possible to hide the name field while still blocking confirmation due to an invalid addressLabel. Consider tying the "name required" logic to the same conditions used for rendering the name input.
  const isNameValid = addressLabel === undefined || addressLabel.status === "valid";

  return {
    value: addressEntry.value,
    labels,

domain/entity/contact/src/schema.ts:16

  • CONTACT_ADDRESS_LABEL_MAX_LENGTH is now defined in @domain/entity-contact (schema), but @features/flow-contacts also defines/exports the same constant (features/flow/contacts/src/steps/AddAddress/model/constants.ts). Having two sources of truth for the same limit risks them drifting over time; consider consolidating so both domain validation and UI inputs reference a single exported constant.
export const CONTACT_ADDRESS_LABEL_MAX_LENGTH = 32;

@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

Labels

desktop Has changes in LLD mobile Has changes in LLM translations Translation files have been touched

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants