Skip to content

feat(app): create DeleteRecordsModal#21856

Open
ncdiehl11 wants to merge 4 commits into
edgefrom
app_feat-deleterecordsmodal
Open

feat(app): create DeleteRecordsModal#21856
ncdiehl11 wants to merge 4 commits into
edgefrom
app_feat-deleterecordsmodal

Conversation

@ncdiehl11

@ncdiehl11 ncdiehl11 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Overview

This PR builds a flexible DeleteRecordsModal component for confirming deleting batches of run records or compliance log periods. This modal is triggered in a few places:

  1. from the Recent Protocols Run tab of a device's details ('allRuns' variant)
  2. from the Compliance Ready Softare files section of a robot's file manager settings page (for compliance ready robots only, 'allLogs' variant), and
  3. from the Protocol Run Records section of a robot's file manager settings page ('selectedRuns' variant).

I also wire up this modal in Recent Protocol Runs for smoke testing that variant.

Closes EXEC-2801

Test Plan and Hands on Testing

  • unit tests for new DeleteRecordsModal component
  • smoke tested modal live when clicking "Delete all" button on Recent Protocol Runs tab of device detail (safe— the onConfirm handler is not yet wired up)

Changelog

  • create new DeleteRecordModal component, types, tests, and hook for switching text on variant
  • wire up in RecentProtocolRuns for minimal smoke testing

Review requests

see test plan

Risk assessment

⬇️

This PR builds a flexible DeleteRecordsModal component for confirming deleting batches of run
records or compliance log periods. This modal is triggered in a few places- 1) from the Recent
Protocols Run tab of a device's details ('allRuns' variant), 2) from the Compliance Ready Softare
files section of a robot's file manager settings page (for compliance ready robots only, 'allLogs'
variant), and 3) from the Prtoocol Run Records section of a robot's file manager settings page
('selectedRuns' variant).

Closes EXEC-2801
@ncdiehl11 ncdiehl11 self-assigned this Jun 26, 2026
@ncdiehl11 ncdiehl11 marked this pull request as ready for review June 26, 2026 14:25

import type { DeleteRecordsType } from '../types'

export function useDeleteRecordsText(type: DeleteRecordsType): {

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.

maybe tweaking the name since this hook doesn't delete anything 🤔
and this can be an util function can't it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I see what you mean regarding the name— the "Delete" comes from the name of the component that this hook is relevant to.

I used a hook since we directly call useTranslation here. I suppose we can keep it as a util, but that would require passing in the translation object in as an arg. I don't feel strongly about this either way, but I think there's precedent for this pattern in protocol-designer/src/components/organisms/AnnouncementModal/announcements.tsx

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.

honestly don’t think the implementation in ‎protocol-designer/src/components/organisms/AnnouncementModal/announcements.tsx is something we should treat as a recommended pattern. The reason is that it’s structured in a way where code just keeps getting added to the component, even though the component’s core functionality itself isn’t actually changing.

@@ -0,0 +1 @@
export type DeleteRecordsType = 'allRuns' | 'selectedRuns' | 'allLogs'

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.

nit
defining this in the modal component?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I can do that, but I moved the hook that also uses this type to its own file, so I thought it might be better to have a types.ts file

alignItems={ALIGN_CENTER}
gridGap={SPACING.spacing8}
justifyContent={JUSTIFY_SPACE_BETWEEN}
marginBottom="6rem"

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.

do you think you can use padding? margin may be a blocker for responsiveness and the design never uses margin.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep, I can do that. I was trying to update this file while making minimal changes to it. It could probably use a larger refactor, but not sure we want to do that here.

@koji koji Jun 26, 2026

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 possible, switching from styled-components to CSS Modules would be great.

  • switch LegacyStyledText to StyledText

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep, let me do a larger refactor on all the Flexs

@ncdiehl11 ncdiehl11 requested a review from koji June 26, 2026 16:50
display: flex;
width: 100%;
flex-direction: column;
gap: 0.25rem;

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.

var(--spacing-4)

padding: 0.5rem;
margin-right: 12%;
color: var(--grey-60);
gap: 1.25rem;

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.

var(--spacing-24(

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