Skip to content

Small changes for DeviceSelectorModa props API#3381

Merged
ancorgs merged 2 commits intofeature-reuse-vg-uifrom
reuse-vg-ui-component-api-changes
Apr 13, 2026
Merged

Small changes for DeviceSelectorModa props API#3381
ancorgs merged 2 commits intofeature-reuse-vg-uifrom
reuse-vg-ui-component-api-changes

Conversation

@dgdavid
Copy link
Copy Markdown
Contributor

@dgdavid dgdavid commented Apr 13, 2026

Changes

Before:

  <DeviceSelectorModal                                                                                             
    disksSideEffects={<DiskNote />}
    mdRaidsSideEffects={<MdNote />}                                                                                  
    volumeGroupsSideEffects={<VgNote />}
    disksIntro="Choose a disk..."                                                                                  
    mdRaidsIntro="Choose a RAID..."                                                                                
    volumeGroupsIntro="Choose a VG..."                                                                             
    volumeGroupsEmptyTitle="No VGs"                                                                                
    newVolumeGroupLinkText="Create LVM"                                                                            
  />

After:

  <DeviceSelectorModal
    sideEffects={{ disks: <DiskNote />, mdRaids: <MdNote />, volumeGroups: <VgNote /> }}
    tabIntros={{ disks: "Choose a disk...", mdRaids: "Choose a RAID...", volumeGroups: "Choose a VG..." }}
    emptyStateTitles={{ volumeGroups: "No VGs" }}                                                                  
    newDeviceLinkTexts={{ volumeGroups: "Create LVM" }}
  />                                                                                                               

Benefits

  • Type-safe: compiler enforces valid tab keys
  • Cleaner: groups related config by concern
  • Extensible: adding new tabs only requires updating TabKey type

dgdavid added 2 commits April 13, 2026 16:20
Replace individual props (disksSideEffects, mdRaidsSideEffects, etc.)
with unified structured props keyed by tab type.

The new API groups related configuration by concern rather than
scattering it across multiple props, making it easier to discover what
content can be customized for each tab. The structure is more
maintainable and reduces errors since the compiler enforces consistent
keys across all props. Adding support for new device types becomes
trivial as the shape automatically scales with the available tabs.
@dgdavid dgdavid requested review from ancorgs and joseivanlopez and removed request for ancorgs April 13, 2026 15:29
@dgdavid
Copy link
Copy Markdown
Contributor Author

dgdavid commented Apr 13, 2026

@ancorgs this is the props API change I told you during the morning. Please review and merge it if you find it useful or, at least, not that harmful.

Copy link
Copy Markdown
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

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

LGTM

@ancorgs ancorgs merged commit 0356bb9 into feature-reuse-vg-ui Apr 13, 2026
4 checks passed
@ancorgs ancorgs deleted the reuse-vg-ui-component-api-changes branch April 13, 2026 18:43
@imobachgs imobachgs mentioned this pull request Apr 14, 2026
imobachgs added a commit that referenced this pull request Apr 14, 2026
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.

2 participants