Repository navigation
Add filter and sorting to automations page - #14158
Conversation
- Filter by status (enabled/paused) or last-run outcome (failed/succeeded/never) - Sort by name or last run with toggleable direction - Display last-run status with relative time in new table column
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe automation list now displays normalized last-run status and relative time for local and external automations. It adds status and last-run filters, sortable name and last-run columns, unified local and external item handling, and selection updates when filtering or sorting hides the current item. The toolbar, table headers, empty state, loading skeleton, and English localization now support the expanded list behavior. Vitest coverage covers run snapshots, filtering, sorting, formatting, and row rendering. Mergeability Score: ⚪ Minimal · up to This change adds localized filtering, sorting, and last-run status display to the automations page; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
src/renderer/src/components/automations/automation-list-view.ts (1)
156-165: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winSort names with the application locale.
localeComparereceivesundefined, so it uses the system locale instead of the active application language. PassgetIntlLocale()fromsrc/renderer/src/i18n/i18n.tsso name ordering matches the language the user sees. This module stays framework-independent becausegetIntlLocale()is a plain function.Based on learnings: when UI code passes the active application language to an Intl API, use
getIntlLocale()fromsrc/renderer/src/i18n/i18n.tsinstead of passing the language identifier directly.♻️ Proposed change
+import { getIntlLocale } from '`@/i18n/i18n`'next.sort((left, right) => { const compared = sort.field === 'name' - ? left.name.localeCompare(right.name, undefined, { sensitivity: 'base' }) + ? left.name.localeCompare(right.name, getIntlLocale(), { sensitivity: 'base' }) : (left.lastRunAt ?? 0) - (right.lastRunAt ?? 0)Source: Learnings
src/renderer/src/components/automations/AutomationListSortHeader.tsx (1)
20-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExpose sort state without
aria-pressed, and use one interpolated string.Two points:
aria-pressedmarks a toggle button. This control cycles a sort direction, so the pressed state does not describe it. Preferaria-sorton arole="columnheader"wrapper, or keep the state in the accessible name only.- The label is built by concatenating two translated fragments. Word order and punctuation differ per language. Use one key with interpolation, as the
removeFilterkey inAutomationListFilterMenu.tsxalready does.♻️ Proposed change for the composed label
- const directionLabel = - direction === 'asc' - ? translate('auto.components.automations.AutomationListSortHeader.ascending', 'ascending') - : direction === 'desc' - ? translate('auto.components.automations.AutomationListSortHeader.descending', 'descending') - : null + const sortedLabel = + direction === 'asc' + ? translate( + 'auto.components.automations.AutomationListSortHeader.sortedAscending', + '{{value0}}, sorted ascending', + { value0: label } + ) + : direction === 'desc' + ? translate( + 'auto.components.automations.AutomationListSortHeader.sortedDescending', + '{{value0}}, sorted descending', + { value0: label } + ) + : null- aria-label={directionLabel ? `${label}, ${directionLabel}` : label} - aria-pressed={active} + aria-label={sortedLabel ?? label}
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8c062a26-db05-4f7f-95b2-5203327396e0
📒 Files selected for processing (18)
src/renderer/src/components/automations/AutomationListExternalRows.tsxsrc/renderer/src/components/automations/AutomationListFilterMenu.tsxsrc/renderer/src/components/automations/AutomationListLastRunCell.tsxsrc/renderer/src/components/automations/AutomationListLocalRows.test.tsxsrc/renderer/src/components/automations/AutomationListLocalRows.tsxsrc/renderer/src/components/automations/AutomationListSortHeader.tsxsrc/renderer/src/components/automations/AutomationListTableHeader.tsxsrc/renderer/src/components/automations/AutomationListToolbar.tsxsrc/renderer/src/components/automations/AutomationsListPanel.tsxsrc/renderer/src/components/automations/AutomationsPage.tsxsrc/renderer/src/components/automations/AutomationsPageSkeleton.tsxsrc/renderer/src/components/automations/automation-list-last-run.test.tssrc/renderer/src/components/automations/automation-list-last-run.tssrc/renderer/src/components/automations/automation-list-view.test.tssrc/renderer/src/components/automations/automation-list-view.tssrc/renderer/src/components/automations/automations-table-layout.tssrc/renderer/src/components/automations/use-automation-list-view.tssrc/renderer/src/i18n/locales/en.json
|
@coderabbitai Fixing. Will be in the next commit |
|
Tip For best results, initiate chat on the files or code changes.
You are interacting with an AI system. |
- Move run indexing to parent component for performance (avoid O(rows × runs) on re-render) - Add internationalized labels for sort direction that include the column name - Internationalize automation status labels and use locale-aware string sorting
* Add filter and sort to automations list - Filter by status (enabled/paused) or last-run outcome (failed/succeeded/never) - Sort by name or last run with toggleable direction - Display last-run status with relative time in new table column * Add filter and sorting to automations list - Move run indexing to parent component for performance (avoid O(rows × runs) on re-render) - Add internationalized labels for sort direction that include the column name - Internationalize automation status labels and use locale-aware string sorting
Problem
The automations list lacked filtering and sorting capabilities, making it hard to find specific automations or quickly assess their run history.
Solution
Added a filter menu (status + last-run filters), sortable table columns (Name, Last Run), and a view model to manage filtering/sorting state across local and external automations.
What Changed
AutomationListFilterMenuwith enabled/paused/last-run outcome filters and active filter pillsAutomationListSortHeaderwith visual direction indicators; Name sorts A→Z, Last Run defaults newest-firstAutomationListLastRunCell+automation-list-last-run.tsutilities to capture and format run status (Failed/Succeeded/Never) with relative timeautomation-list-view.tsfor filtering, sorting, and unified item presentation across local + external automationsAutomationListToolbarcomponentAutomationListTableHeaderwith sortable columnsautomations-table-layout.tsto fit Last Run columnWhy
Enables users to filter by automation state and last-run outcome, sort for discovery, and see status + timing at a glance.
Testing
Unit tests for
automation-list-last-run.ts: status classification, snapshot building, relative time formattingUnit tests for
automation-list-view.ts: filtering, sorting, cross-type behavior (local + external)Integration test in
AutomationListLocalRows.test.tsxverifies last-run cell displaySkeleton loader updated for new column
I manually tested these changes locally
Automated tests added/updated, or explained why not below