Skip to content

EDM-2216: Improve UX of showing results after resuming all devices#358

Merged
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:EDM-2216-improve-result-modal-result-info
Oct 1, 2025
Merged

EDM-2216: Improve UX of showing results after resuming all devices#358
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:EDM-2216-improve-result-modal-result-info

Conversation

@celdrake

@celdrake celdrake commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator

When targeting all devices for resume, the second modal was closing immediately and it was not clear what the outcome had been, since the action is very quick.

Now we show the result explicitly in the second modal, and when it is closed, we also show the details in the first modal.

Pending a more in-depth UX review, this should improve the current experience.

Summary by CodeRabbit

  • New Features

    • Enhanced resume confirmation flow: see a pre-action prompt and a post-action result with success, partial, or error alerts.
    • Displays the exact number of devices successfully resumed.
  • Improvements

    • Plural-aware wording for all resume messages (singular vs. plural) for clearer, locale-ready text.
    • Clearer prompts (e.g., “Resume device?” vs. “Resume devices?”).
    • More robust validation when no selection is made, with helpful feedback.
    • Smoother dialog closing after actions, reflecting accurate results.

@coderabbitai

coderabbitai Bot commented Oct 1, 2025

Copy link
Copy Markdown

Walkthrough

Introduces pluralized i18n keys for resume-related messages, updates MassResume modal to use count-based translations, and refactors the ResumeAllDevicesConfirmationDialog to perform an async resume request, return the resumed count via onClose, and present pre-/post-action modal content with success/warning/error handling.

Changes

Cohort / File(s) Summary
i18n pluralization updates
libs/i18n/locales/en/translation.json
Replaces singular keys with plural-aware variants (_one/_other) for resume prompts, results, and failure messages; adds “Resume devices result”; updates irreversible-action and “about to resume all” messages to plural forms.
Mass resume modal integration
libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx
Adjusts label-selection logic; switches success toast to {{ count }} devices were resumed with count; integrates new confirmation dialog API: devicesToResume prop; onClose(resumedCount) callback; initializes labels as [].
Resume-all confirmation dialog refactor
libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/ResumeAllDevicesConfirmationDialog.tsx
Replaces simple confirm flow with async POST to deviceactions/resume; shows before/after modal content; handles errors via alert; updates props to `{ devicesToResume, onClose(resumedCount

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant M as MassResumeDevicesModal
  participant C as ResumeAllDevicesConfirmationDialog
  participant API as POST /deviceactions/resume

  U->>M: Open mass resume
  M->>C: Open dialog (devicesToResume)
  C->>U: Show confirmation (count-based i18n)

  U-->>C: Confirm
  activate C
  C->>API: Resume devices request
  API-->>C: { resumedCount } or error
  C-->>U: Show result (success/warning/error)
  C-->>M: onClose(resumedCount | undefined)
  deactivate C

  M->>U: Toast with "{{ count }} devices were resumed" (count=resumedCount)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • rawagner

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title includes the issue reference and succinctly summarizes the primary enhancement of showing explicit results after resuming all devices in the UX, directly reflecting the core changes to the result modal and translation updates. It is specific to the main improvement and avoids irrelevant details like file names or generic phrasing. Scanning the history, teammates will immediately understand that this PR focuses on improving the result display flow post-resume.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@celdrake celdrake marked this pull request as draft October 1, 2025 09:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9364082 and 82e08d0.

📒 Files selected for processing (3)
  • libs/i18n/locales/en/translation.json (1 hunks)
  • libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx (3 hunks)
  • libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/ResumeAllDevicesConfirmationDialog.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/ResumeAllDevicesConfirmationDialog.tsx (5)
libs/ui-components/src/hooks/useTranslation.ts (1)
  • useTranslation (5-8)
apps/standalone/src/app/hooks/useFetch.ts (1)
  • useFetch (5-51)
libs/types/models/DeviceResumeRequest.ts (1)
  • DeviceResumeRequest (8-17)
libs/types/models/DeviceResumeResponse.ts (1)
  • DeviceResumeResponse (8-13)
libs/ui-components/src/utils/error.ts (1)
  • getErrorMessage (6-17)
libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx (1)
libs/ui-components/src/types/extraTypes.ts (1)
  • FlightCtlLabel (15-19)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: integration-tests
  • GitHub Check: Lint

@celdrake celdrake marked this pull request as ready for review October 1, 2025 09:27
@celdrake celdrake merged commit 35e3e03 into flightctl:main Oct 1, 2025
6 checks passed
@celdrake celdrake deleted the EDM-2216-improve-result-modal-result-info branch October 1, 2025 12:54
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