Repository navigation
feat(automations): restore column sorting on the list - #18885
Conversation
The flat-table redesign in #16532 dropped the sort UI, orphaning AutomationListSortHeader, nextAutomationListSort and the whole AutomationListViewItem layer. Wire them back to the rendered list. Name and Last run become interactive header cells again; the other six columns stay plain text. Sorting now spans local and external rows as one list, so the panel renders per-row components from a single sorted collection instead of two independent sections. Two model fixes fall out of that: - View items key on the host-qualified row key, not the bare automation ID. The old builder predated automation-list-row-identity, so under All hosts two authorities returning the same ID collapsed in the sort tie-break. - sortAutomationListViewItems takes the locale as a parameter instead of reading getIntlLocale(). A hidden global read is invisible to a dependency array, and the list result is memoized. Keyboard traversal and focus recovery now read the sorted order, so arrow navigation matches what is on screen. The dead unified filter is removed in favor of the live row/entry filters the page already used.
📝 WalkthroughWalkthroughThe automation list now uses a unified local and external item model. It supports locale-aware sorting for Name and Last run columns. Local and external row rendering moved into dedicated components with selection, status, and action menus. Page state and panel wiring now pass sorted mixed items. Tests and test helpers now observe rendered items through the unified list model. Merge Risk: ⚪ Minimal · up to No concrete merge-blocking risk remains in the automation list changes. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the change, motivation, implementation, and validation in detail. However, it does not follow the required template because it omits the mandatory linked issue section, explicit visual-proof attachments or required UI proof format, testing checkboxes and platform details, and several checklist sections. Resolution Add the required template sections. Include a valid issue reference such as
✨ 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.
✅ No new issues found.
Reviewed changes
- Row extraction —
AutomationListLocalRowandAutomationListExternalRoware pulled out of the two…Rowslist components (verbatim; wrapping exports preserved), so the panel can render one sortedAutomationListViewItem[]. - Sort wiring —
AutomationListSortHeaderis restored,AutomationListTableHeaderexposes Name and Last run as sort buttons, andnextAutomationListSortdrives the React-locallistSortstate throughAutomationsPageListPanel. - Sort spans both row kinds —
buildAutomationListViewItemsflattens local rows and external entries into one list, and the panel dispatches peritem.kind. - Host-qualified tie-break — view items now key on
row.keyrather than the bare automation ID, so two authorities returning the same ID under All hosts no longer collapse in the tie-break (regression-tested). - Locale parameterization —
sortAutomationListViewItemstakeslocaleinstead of readinggetIntlLocale()internally, so the memoized sort re-collates on a language switch; the function is now pure and its test no longer needs an i18n mock. - Dead-path cleanup —
filterAutomationListViewItemsis removed; keyboard traversal and focus recovery now read the sorted render order.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/automations/AutomationListLocalRow.tsx (1)
294-333: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueShare the automation menu action definitions. Both row components currently expose equivalent actions, labels, enablement, and callbacks in their dropdown and context menus. This causes no current runtime or enforced-check failure, but future edits can make the menus diverge. Use one parameterized action definition with either
ContextMenuItemorDropdownMenuItemin both files.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 2911e9e4-fd08-4cd3-a461-d08db99e9b96
📒 Files selected for processing (25)
src/renderer/src/components/automations/AutomationListExternalRow.tsxsrc/renderer/src/components/automations/AutomationListExternalRows.tsxsrc/renderer/src/components/automations/AutomationListLocalRow.tsxsrc/renderer/src/components/automations/AutomationListLocalRows.tsxsrc/renderer/src/components/automations/AutomationListSortHeader.tsxsrc/renderer/src/components/automations/AutomationListTableHeader.test.tsxsrc/renderer/src/components/automations/AutomationListTableHeader.tsxsrc/renderer/src/components/automations/AutomationsListPanel.test.tsxsrc/renderer/src/components/automations/AutomationsListPanel.tsxsrc/renderer/src/components/automations/AutomationsPage.create-destination.test.tsxsrc/renderer/src/components/automations/AutomationsPage.cross-authority-actions.test.tsxsrc/renderer/src/components/automations/AutomationsPage.external-scope.test.tsxsrc/renderer/src/components/automations/AutomationsPage.notice-recovery.test.tsxsrc/renderer/src/components/automations/AutomationsPage.refresh-selection.test.tsxsrc/renderer/src/components/automations/AutomationsPage.run-visibility.test.tsxsrc/renderer/src/components/automations/AutomationsPage.test.tsxsrc/renderer/src/components/automations/AutomationsPageListPanel.tsxsrc/renderer/src/components/automations/automation-list-view-sort.test.tssrc/renderer/src/components/automations/automation-list-view.test.tssrc/renderer/src/components/automations/automation-list-view.tssrc/renderer/src/components/automations/automations-page-listed-items.tssrc/renderer/src/components/automations/automations-page-test-harness.tsxsrc/renderer/src/components/automations/use-automations-page-list-state.tssrc/renderer/src/components/automations/use-automations-page-local-state.tssrc/shared/pane-agent-identity-inventory.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.
The flat-table redesign in stablyai#16532 dropped the sort UI, orphaning AutomationListSortHeader, nextAutomationListSort and the whole AutomationListViewItem layer. Wire them back to the rendered list. Name and Last run become interactive header cells again; the other six columns stay plain text. Sorting now spans local and external rows as one list, so the panel renders per-row components from a single sorted collection instead of two independent sections. Two model fixes fall out of that: - View items key on the host-qualified row key, not the bare automation ID. The old builder predated automation-list-row-identity, so under All hosts two authorities returning the same ID collapsed in the sort tie-break. - sortAutomationListViewItems takes the locale as a parameter instead of reading getIntlLocale(). A hidden global read is invisible to a dependency array, and the list result is memoized. Keyboard traversal and focus recovery now read the sorted order, so arrow navigation matches what is on screen. The dead unified filter is removed in favor of the live row/entry filters the page already used.

Re-wires the automations list sort UI that #16532 dropped, making the collation work merged in #18823 reachable by users for the first time.
Why
#14158 added sorting to the automations page. #16532 ("Show all automations in flat table") rewrote the page and dropped the sort wiring, leaving
AutomationListSortHeader,nextAutomationListSort,sortAutomationListViewItemsand the wholeAutomationListViewItemlayer with no production caller. #18823 then optimized that sorter's collation setup — a real 10-26x win on a path no user could reach.AutomationListSortHeader.tsxis restored verbatim from 05dc845; its i18n keys were never removed (en.json:15976).What changed
Sorting spans both row kinds. Local and external automations render as one flat table under a single header, so a correct name sort has to interleave them. The panel now maps one sorted
AutomationListViewItem[]and dispatches per row, which required extractingAutomationListLocalRow/AutomationListExternalRowfrom the two…Rowslist components. Those wrappers keep their existing exports and behavior —AutomationListHostGroupsand existing tests are untouched.Header. Name and Last run are interactive again; the other six columns stay plain text. No
aria-sort— the layout is divs with no grid roles, so state rides the button's accessible name ("Name, sorted ascending"), matching the existing Jira and space-manager sort controls.Two model fixes this surfaced
buildAutomationListViewItemspredatedautomation-list-row-identity; under All hosts two authorities returning the same ID collapsed in the sort tie-break — exactly what that module exists to prevent. New regression test covers it.sortAutomationListViewItemstakeslocaleas a parameter instead of readinggetIntlLocale()internally. The list result is memoized, and a hidden global read is invisible to a dependency array — a language switch would not have re-sorted. This also makes the function pure; its test no longer needs an i18n mock.Keyboard traversal and focus recovery now read the sorted order, so arrow navigation matches what is on screen. The dead
filterAutomationListViewItems/ oldapplyAutomationListViewpath is dropped in favor of the live row/entry filters the page already used.Validation
pnpm tc:web,oxlint, andoxfmtclean. 798 tests pass across 102 files (src/renderer/src/components/automations/plus the pane-agent-identity ratchet), including 4 new header-interaction tests and the host-key tie-break regression.Verified in the running app via CDP on this branch (
Orca: nwparker/automations-sort-rewire): Name and Last run render as buttons with pointer cursors while the other six columns do not; clicking Name gives"Name, sorted ascending"with alucide-arrow-up, clicking again gives"Name, sorted descending"withlucide-arrow-down; clicking Last run moves the indicator there ("Last run, sorted descending") and resets Name to plain"Name".Gap, stated plainly: the dev profile had one local automation and no reachable external manager, so multi-row ordering and local/external interleaving were proven by unit tests, not on screen. The single-row screenshot shows the sorted-column indicator (
LAST RUN ↓) but cannot show ordering.No wire, persistence, host-execution, or provider surface is touched; sort state is React-local and not persisted.