Skip to content

Conversation

@jeffredodd
Copy link
Contributor

@jeffredodd jeffredodd commented Oct 23, 2025

Overview

This PR creates a new DescriptionList component following the patterns established in the SDK and removes global dl styles from _Base.scss.

Changes

New DescriptionList Component

  • Created in src/components/Common/UI/DescriptionList/
  • Follows existing UI component patterns
  • Supports flexible HTML <dl> patterns per MDN spec:
    • Single term → Single description (1:1 key-value pairs)
    • Multiple terms → Single description (aliases/synonyms)
    • Single term → Multiple descriptions
    • Mixed patterns in the same list

Refactoring

  • Replaced raw <dl> usage in AccountView.tsx with Components.DescriptionList
  • Removed global dl styles from _Base.scss (lines 17-24)
  • Moved styles to component-scoped module styles

Usage Examples

Simple key-value pairs

<Components.DescriptionList
  items={[
    { term: 'Routing Number', description: '123456789' },
    { term: 'Account Number', description: '****1234' }
  ]}
/>

Multiple terms, one description

<Components.DescriptionList
  items={[{
    term: ['Firefox', 'Mozilla Firefox', 'Fx'],
    description: 'A free, open-source web browser'
  }]}
/>

One term, multiple descriptions

<Components.DescriptionList
  items={[{
    term: 'Firefox',
    description: [
      'A web browser',
      'The Red Panda'
<img width="451" height="409" alt="Screenshot 2025-10-23 at 2 24 52 PM" src="https://github.com/user-attachments/assets/a2bf82ab-c012-493e-8073-6225f77afd1a" />
<img width="301" height="260" alt="Screenshot 2025-10-23 at 2 24 48 PM" src="https://github.com/user-attachments/assets/59a5926c-4ddb-4ae5-a656-60ef723912ce" />

    ]
  }]}
/>

Screenshots

Screenshot 2025-10-23 at 2 24 56 PM Screenshot 2025-10-23 at 2 24 52 PM Screenshot 2025-10-23 at 2 24 48 PM

@jeffredodd jeffredodd marked this pull request as ready for review October 23, 2025 21:37
@Copilot Copilot AI review requested due to automatic review settings October 23, 2025 21:37
Copy link
Contributor

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 introduces a new DescriptionList component that provides a structured, reusable way to render HTML <dl> elements with flexible support for various term-description patterns. The component follows established SDK patterns and replaces raw <dl> usage in the codebase.

Key Changes:

  • Created DescriptionList component with support for 1:1, many:1, 1:many, and mixed term-description patterns
  • Refactored AccountView.tsx to use the new component instead of raw HTML
  • Migrated global dl styles from _Base.scss to component-scoped styles

Reviewed Changes

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

Show a summary per file
File Description
src/styles/_Base.scss Removed global dl styles
src/contexts/ComponentAdapter/useComponentContext.ts Added DescriptionList type to context interface
src/contexts/ComponentAdapter/componentAdapterTypes.ts Exported DescriptionListProps type
src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx Registered DescriptionList in default adapter
src/components/Company/BankAccount/BankAccountList/AccountView.tsx Refactored to use new DescriptionList component
src/components/Common/UI/DescriptionList/index.ts Component barrel export
src/components/Common/UI/DescriptionList/DescriptionListTypes.ts Type definitions for the component
src/components/Common/UI/DescriptionList/DescriptionList.tsx Component implementation
src/components/Common/UI/DescriptionList/DescriptionList.test.tsx Comprehensive test coverage
src/components/Common/UI/DescriptionList/DescriptionList.stories.tsx Storybook examples
src/components/Common/UI/DescriptionList/DescriptionList.module.scss Component-scoped styles
.ladle/adapters/PlainComponentAdapter.tsx Plain adapter implementation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@serikjensen serikjensen left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -0,0 +1,13 @@
@use '@/styles/Helpers' as *;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: this can be removed, cursor likes to add in the import but it is already globally made available with vite at build time

Suggested change
@use '@/styles/Helpers' as *;

@jeffredodd jeffredodd enabled auto-merge (squash) October 24, 2025 15:44
…pport

- Create DescriptionList component in Common/UI directory
- Support single or multiple terms per description
- Support single or multiple descriptions per term
- Add component to adapter system (default and plain adapters)
- Replace dl usage in AccountView with DescriptionList component
- Remove global dl styles from Base.scss
- Add comprehensive tests and Ladle stories
@jeffredodd jeffredodd force-pushed the jdj/dl-component-adapter branch from ffee6ec to 036eb38 Compare October 24, 2025 15:44
@jeffredodd jeffredodd merged commit 6eb3a70 into main Oct 24, 2025
7 checks passed
@jeffredodd jeffredodd deleted the jdj/dl-component-adapter branch October 24, 2025 15:46
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