Skip to content

Add filter and sorting to automations page - #14158

Merged
AmethystLiang merged 2 commits into
mainfrom
add-filter-and-sorting-to-automations-page
Aug 13, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
add-filter-and-sorting-to-automations-page

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

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

  • Filter UI: AutomationListFilterMenu with enabled/paused/last-run outcome filters and active filter pills
  • Sort UI: AutomationListSortHeader with visual direction indicators; Name sorts A→Z, Last Run defaults newest-first
  • Last-run display: AutomationListLastRunCell + automation-list-last-run.ts utilities to capture and format run status (Failed/Succeeded/Never) with relative time
  • View model: Core logic in automation-list-view.ts for filtering, sorting, and unified item presentation across local + external automations
  • Toolbar refactor: Extracted search/filter/refresh/create into AutomationListToolbar component
  • Table header: New AutomationListTableHeader with sortable columns
  • Grid layout: Updated column widths in automations-table-layout.ts to fit Last Run column

Why

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 formatting

  • Unit tests for automation-list-view.ts: filtering, sorting, cross-type behavior (local + external)

  • Integration test in AutomationListLocalRows.test.tsx verifies last-run cell display

  • Skeleton loader updated for new column

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

- 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
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cc3a88b2-c090-4ae8-b6bf-b45317f50417

📥 Commits

Reviewing files that changed from the base of the PR and between 63572c2 and aa8cdf2.

📒 Files selected for processing (8)
  • src/renderer/src/components/automations/AutomationListFilterMenu.tsx
  • src/renderer/src/components/automations/AutomationListLocalRows.test.tsx
  • src/renderer/src/components/automations/AutomationListLocalRows.tsx
  • src/renderer/src/components/automations/AutomationListSortHeader.tsx
  • src/renderer/src/components/automations/AutomationsListPanel.tsx
  • src/renderer/src/components/automations/automation-list-last-run.ts
  • src/renderer/src/components/automations/automation-list-view.ts
  • src/renderer/src/i18n/locales/en.json
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/automations/AutomationListFilterMenu.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/renderer/src/components/automations/AutomationsListPanel.tsx
  • src/renderer/src/components/automations/AutomationListLocalRows.tsx
  • src/renderer/src/components/automations/automation-list-last-run.ts
  • src/renderer/src/components/automations/automation-list-view.ts

📝 Walkthrough

Walkthrough

The 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 aa8cd

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and tests, but it omits several required template sections, including Linked Issue and Visual Proof. Add the required template sections, link the issue, provide visual proof or N/A with a reason, complete testing checkboxes, and include the review and checklist sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding filtering and sorting to the automations page.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🧹 Nitpick comments (2)
src/renderer/src/components/automations/automation-list-view.ts (1)

156-165: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Sort names with the application locale.

localeCompare receives undefined, so it uses the system locale instead of the active application language. Pass getIntlLocale() from src/renderer/src/i18n/i18n.ts so name ordering matches the language the user sees. This module stays framework-independent because getIntlLocale() is a plain function.

Based on learnings: when UI code passes the active application language to an Intl API, use getIntlLocale() from src/renderer/src/i18n/i18n.ts instead 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 win

Expose sort state without aria-pressed, and use one interpolated string.

Two points:

  1. aria-pressed marks a toggle button. This control cycles a sort direction, so the pressed state does not describe it. Prefer aria-sort on a role="columnheader" wrapper, or keep the state in the accessible name only.
  2. The label is built by concatenating two translated fragments. Word order and punctuation differ per language. Use one key with interpolation, as the removeFilter key in AutomationListFilterMenu.tsx already 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

📥 Commits

Reviewing files that changed from the base of the PR and between bc2e300 and 63572c2.

📒 Files selected for processing (18)
  • src/renderer/src/components/automations/AutomationListExternalRows.tsx
  • src/renderer/src/components/automations/AutomationListFilterMenu.tsx
  • src/renderer/src/components/automations/AutomationListLastRunCell.tsx
  • src/renderer/src/components/automations/AutomationListLocalRows.test.tsx
  • src/renderer/src/components/automations/AutomationListLocalRows.tsx
  • src/renderer/src/components/automations/AutomationListSortHeader.tsx
  • src/renderer/src/components/automations/AutomationListTableHeader.tsx
  • src/renderer/src/components/automations/AutomationListToolbar.tsx
  • src/renderer/src/components/automations/AutomationsListPanel.tsx
  • src/renderer/src/components/automations/AutomationsPage.tsx
  • src/renderer/src/components/automations/AutomationsPageSkeleton.tsx
  • src/renderer/src/components/automations/automation-list-last-run.test.ts
  • src/renderer/src/components/automations/automation-list-last-run.ts
  • src/renderer/src/components/automations/automation-list-view.test.ts
  • src/renderer/src/components/automations/automation-list-view.ts
  • src/renderer/src/components/automations/automations-table-layout.ts
  • src/renderer/src/components/automations/use-automation-list-view.ts
  • src/renderer/src/i18n/locales/en.json

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai Fixing. Will be in the next commit

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@AmethystLiang Thanks. I will verify the fix after the next commit is available.

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
@AmethystLiang
AmethystLiang merged commit 05dc845 into main Aug 13, 2026
44 checks passed
@AmethystLiang
AmethystLiang deleted the add-filter-and-sorting-to-automations-page branch August 13, 2026 03:40
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* 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
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.

1 participant