feat(ui): add bulk edit notifications modal and floating action bar to uptime monitors#3448
feat(ui): add bulk edit notifications modal and floating action bar to uptime monitors#3448ashu130698 wants to merge 11 commits intobluewave-labs:developfrom
Conversation
ajhollid
left a comment
There was a problem hiding this comment.
Visually looks great 👍
There are some UX issues that need to be resolved, and most importantly selection is not cleared on page change.
Please see my comments in the code review and revise as needed, thanks!
| left: "50%", | ||
| transform: "translateX(-50%)", | ||
| zIndex: theme.zIndex.snackbar, | ||
| padding: theme.spacing(1.5, 3), |
There was a problem hiding this comment.
Please use the Utils/Theme/constants util for all spacing values
| const handleBulkEditSuccess = () => { | ||
| setIsBulkEditModalOpen(false); | ||
| setSelectedMonitors([]); | ||
| refetch(); |
There was a problem hiding this comment.
What about failure? Modal stays open on failure right now.
There was a problem hiding this comment.
This hasn't been addressed yet
| @@ -1,5 +1,6 @@ | |||
| import Stack from "@mui/material/Stack"; | |||
There was a problem hiding this comment.
What about all the other monitor pages? Currently only uptime monitors are bulk editable 🤔
EDIT
I see you addressed this in your PR statement, noted 👍
| }; | ||
|
|
||
| const handleClearSelection = () => { | ||
| setSelectedMonitors([]); |
There was a problem hiding this comment.
This should be called on pagination change too
| onClick={() => setIsBulkEditModalOpen(true)} | ||
| > | ||
| {t("pages.common.monitors.bulkEdit.editButton", { | ||
| defaultValue: "Edit Notifications", |
There was a problem hiding this comment.
No need for defaultValue, please remove all these
| <Checkbox | ||
| checked={monitors.length > 0 && selectedMonitors.length === monitors.length} | ||
| indeterminate={ | ||
| selectedMonitors.length > 0 && selectedMonitors.length < monitors.length | ||
| } | ||
| onChange={(e) => { | ||
| if (e.target.checked) { | ||
| onSelectAll(monitors.map((m) => m.id)); | ||
| } else { | ||
| onSelectAll([]); | ||
| } | ||
| }} | ||
| onClick={(e) => e.stopPropagation()} | ||
| /> | ||
| ), | ||
| render: (row) => { | ||
| return ( | ||
| <Checkbox | ||
| checked={selectedMonitors.includes(row.id)} | ||
| onChange={() => onSelectMonitor(row.id)} | ||
| onClick={(e) => e.stopPropagation()} | ||
| /> | ||
| ); | ||
| }, | ||
| }, |
…ror alerts, and mobile cards
|
@ajhollid @gorkem-bwl Thank you so much for the detailed review and catching those quirks! I have just pushed an updated commit addressing all of your feedback. Here is a breakdown of the fixes:
|
| const handleBulkEditSuccess = () => { | ||
| setIsBulkEditModalOpen(false); | ||
| setSelectedMonitors([]); | ||
| refetch(); |
There was a problem hiding this comment.
This hasn't been addressed yet
|
Thanks for the thorough review @ajhollid! I've pushed a new commit that addresses all three issues: Floating Action Bar: It now properly hides behind a !isBulkEditModalOpen condition so it doesn't stay awkwardly visible when the modal mounts. Mobile Layout: I updated the underlying component so that an empty header label allows the row content (like our checkbox) to cleanly expand to size=12 and naturally left-align. I also added a missing "Select All" option explicitly for the mobile card view!Modal Error Handling: To address the poor UX of the modal staying open on an API failure, I updated the logic so it now always closes the modal upon API completion (whether it succeeds or errors). This way, the user relies on the global error toast for the failure feedback, but their underlying checkbox selection is safely preserved so they can easily click "Edit" and try again! (Just let me know if you actually preferred the modal to stay open on failure while just handling the error state completely differently—I can easily swap that back if I misunderstood that piece of feedback!) |
… overflow centering on mobile devices
|
Great catch on the mobile view overflow! The Floating Action Bar's slide animation was unintentionally stripping our CSS transform centering on small screens. I've switched the layout to use auto-margins and pushed the fix—it now centers perfectly on mobile. The PR should be fully good to go now! |
…rapper to permanently center floating action bars
|
Thanks for catching this @ajhollid! You're absolutely right - the FAB should be I see the issue now - the margin-based centering approach isn't working reliably Could you please verify that the latest commit fixes the alignment issue on your |
| @@ -1,5 +1,6 @@ | |||
| { | |||
| "common": { | |||
| "selected": "selected", | |||
There was a problem hiding this comment.
This is not the correct structure for a key. Since it is used in a button, let's put it in common.buttons
These strings need to be logically organized or this file becomes unmanageable very quickly.
| variant="body2" | ||
| color="text.secondary" | ||
| > | ||
| {t("common.selectAll", "Select All")} |
There was a problem hiding this comment.
This string does not exist in the translation file:
i18next::translator: missingKey en translation common.selectAll Select All
and if it did it is not in the logically correct location. It should belong to the common monitor strings object, probably as an option in common.monitors.bulkEdit
|
Thanks again @ajhollid! You were totally right—the translation file needed to be properly structured before it got unmanageable. I've successfully migrated the selected key into common.buttons.selected and added the missing selectAll string exactly where you requested in pages.common.monitors.bulkEdit. I also updated all the React components to properly fetch from this new nested structure. Everything should be tightly organized and good to go now! Thanks for taking the time to catch these. |
|
@ajhollid - Just wanted to follow up! I've implemented all your suggestions. Would appreciate another review when you get a moment. Thanks! |







Changes
This PR implements the frontend user interface for bulk-editing monitor notifications, building seamlessly on the backend work from my previous PR (#3376).
As requested by @gorkem-bwl in the issue thread, this introduces a clean, non-intrusive Floating Action Bar pattern that appears only when multiple monitors are selected in the table, rather than a bulky static "bulk edit" button.
Core components introduced:
add,remove,set) and query your available notification channels via useGet.selectedMonitorsarray into the Uptime/Monitors/index.tsx page to sync the bar and table.(Note: Currently applied to the Uptime Monitors page as an MVP to gather feedback on the design. If approved, I will follow up and apply this exact same logic to the Infrastructure and PageSpeed tables!)
Fixes #2320
npm run formatin server and client directories, which automatically formats your code.