Repository navigation
fix(automations): preserve template filter scroll across empty results - #18936
Conversation
|
PR Artifact Cleanup Queued The |
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Scope. Agent Canvas UI fix for the Templates filter rail — squarely owned by this repository per the ownership table. No Agent Server/Cloud API calls added, no wire contracts touched, no persisted state affected. Linked issue #18858 is open with bug, priority:medium, and ready-for-dev labels, and this PR addresses its acceptance criteria directly.
Behavioral review. The empty-state branch previously rendered the filter rail inside a separate section tree, remounting TemplateFilterChips (and its HorizontalScrollFade scroller) whenever results emptied or refilled — the reported scroll reset. The fix renders the empty state inside the existing grid wrapper so the rail stays mounted; the "return null when nothing narrows the surface" branch is preserved exactly as on main, and the Clear-filters handler and EMPTY_TEMPLATE_FILTERS semantics are unchanged. The only consumer passing filters is the Templates page (automations-list.tsx in classic mode passes only query and is unaffected); the rail variant and other surfaces never render filter chips. This is a small, localized correction, not a deep redesign.
Tests. The new regression clicks the real filter chips and asserts DOM node identity (toBe(filterRail)) across both transitions — it reaches the changed behavior and would fail on the base tree, which unmounts the rail. I ran the focused suites in the workspace: recommended-automations.test.tsx (53), automations-dashboard.test.tsx (23), plus the adjacent automations-list/route/home-launcher suites (86) — all 162 pass, and no tracked files were modified.
Checks and evidence. On head 9b7882bd443ca675df11f8d7c56dc024baa803a4, test-and-build (ubuntu), test-and-build (windows), Validate PR description, check-pr-artifacts, and PR-title checks are green (the single earlier description-validation failure was the missing human note and resolved on the updated body). Before/after GIFs and full-res PNGs for both viewports are pinned to the head SHA in .pr/template-filter-scroll/, which satisfies the functional-change evidence rule for a temporal scroll behavior.
Minor non-blocking note. Rail scroll retention while an intermediate value keeps results non-empty depends on React reconciliation of a stable subtree; the author reports it verified at two viewports, and no workspace evidence contradicts it — nothing here blocks the merge.
No material correctness, security, compatibility, architecture, or evidence findings.
✅ APPROVED
…filter-scroll # Conflicts: # src/components/features/automations/recommended-automations-section.tsx
|
Thank you! |
|
🚀 Released in v1.35.0. |
HUMAN:
The full Linux suite passed (9,519 tests), as did targeted tests, lint/typecheck, and both builds. Real desktop and phone workflows were checked with Playwright, with screenshots and recordings visually inspected.
AGENT:
Why
Filtering Templates to no results, or back to matching results, remounts the filter rail and resets its horizontal scroll. The empty-state branch renders the rail under a different ancestor tree, hiding filters near the right end.
Summary
Issue Number
Fixes #18858
How to Test
Verified twice per viewport before and after the fix at 1440×1000 and 390×844, using production builds, the repository's Playwright driver, and real local Agent Server 1.58.1 / automation 1.25.1. No app/page errors were reported. Baseline scroll positions reset from 407/835 px to zero; the fixed positions remain unchanged in both directions.
Checks run:
env -u DO_NOT_TRACK -u VITE_DO_NOT_TRACK npm test -- --maxWorkers=4).npm run lint, changed-test Prettier,npm run build:app(npm run build's implementation),npm run build:lib, andgit diff --checkpass. Lint reports 508 existing warnings and zero errors.Video/Screenshots
The recordings show the real filter transitions and Clear filters. Screenshots and sampled recording frames were visually inspected.
Full-resolution PNGs are linked from the verification notes.
Type
Notes
Acknowledges the report and earlier work in #18861, which was closed unmerged. This PR includes a fresh current-main reproduction and regression coverage. Temporary reviewer media is confined to
.pr/template-filter-scroll/.