refactor(ui/alerts): tighter inbox action bar, history uses global time range
Inbox: replace 4 parallel outlined buttons with 2 context-aware ones. When nothing is selected → "Acknowledge all firing" (primary) + "Mark all read" (secondary). When rows are selected → the same slots become "Acknowledge N" + "Mark N read" with counts inlined. Primary variant gives the foreground action proper visual weight; secondary is the supporting action. No more visually-identical disabled buttons cluttering the bar. History: drop the local DateRangePicker. The page now reads `timeRange` from `useGlobalFilters()` so the top-bar TimeRangeDropdown (1h / 3h / 6h / Today / 24h / 7d / custom) is the single source of truth, consistent with every other time-scoped page in the app.
This commit is contained in:
@@ -200,38 +200,47 @@ export default function InboxPage() {
|
||||
{allSelected ? 'Deselect all' : `Select all${rows.length ? ` (${rows.length})` : ''}`}
|
||||
</label>
|
||||
<span style={{ flex: 1 }} />
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => onBulkAck(selectedFiringIds)}
|
||||
disabled={selectedFiringIds.length === 0 || ack.isPending}
|
||||
>
|
||||
Acknowledge selected
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => onBulkAck(firingIds)}
|
||||
disabled={firingIds.length === 0 || ack.isPending}
|
||||
>
|
||||
Acknowledge all firing
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => onBulkRead(selectedIds)}
|
||||
disabled={selectedIds.length === 0 || bulkRead.isPending}
|
||||
>
|
||||
Mark selected read
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => onBulkRead(unreadIds)}
|
||||
disabled={unreadIds.length === 0 || bulkRead.isPending}
|
||||
>
|
||||
Mark all read
|
||||
</Button>
|
||||
{selectedIds.length > 0 ? (
|
||||
<>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
onClick={() => onBulkAck(selectedFiringIds)}
|
||||
disabled={selectedFiringIds.length === 0 || ack.isPending}
|
||||
>
|
||||
{selectedFiringIds.length > 0
|
||||
? `Acknowledge ${selectedFiringIds.length}`
|
||||
: 'Acknowledge selected'}
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => onBulkRead(selectedIds)}
|
||||
disabled={bulkRead.isPending}
|
||||
>
|
||||
Mark {selectedIds.length} read
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
onClick={() => onBulkAck(firingIds)}
|
||||
disabled={firingIds.length === 0 || ack.isPending}
|
||||
>
|
||||
Acknowledge all firing
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => onBulkRead(unreadIds)}
|
||||
disabled={unreadIds.length === 0 || bulkRead.isPending}
|
||||
>
|
||||
Mark all read
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{rows.length === 0 ? (
|
||||
|
||||
Reference in New Issue
Block a user