Skip to content

fix(automations): preserve template filter scroll across empty results - #18936

Merged
neubig merged 3 commits into
OpenHands:mainfrom
tanishqbaweja:fix/18858-template-filter-scroll
Oct 30, 2026
Merged

neubig merged 3 commits into
OpenHands:mainfrom
tanishqbaweja:fix/18858-template-filter-scroll

Conversation

@tanishqbaweja

@tanishqbaweja tanishqbaweja commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Render the empty message within the existing wrapper so the filter rail stays mounted across both transitions.
  • Add a regression that clicks the real filter controls and checks that the same filter DOM node survives entering and leaving empty results.

Issue Number

Fixes #18858

How to Test

  1. Open Automate → Templates, scroll the filter rail right, and select Tavily.
  2. Scroll to the right end and select Event. The empty message appears without the rail jumping left.
  3. Deselect Event. The matching card returns and the rail keeps its position.
  4. Enter a search with no matches, then use Clear filters. The search and selections clear and the catalog returns.

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:

  • New regression fails on baseline production code; both targeted test files pass with the fix (76 tests).
  • Full Linux suite: 856 files, 9,519 tests passed, seven existing todos (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, and git diff --check pass. Lint reports 508 existing warnings and zero errors.
  • The native Windows suite has 34 failures; all 34 reproduce in the same 13 files on unchanged main. Details and environment limitations are in the verification notes.

Video/Screenshots

The recordings show the real filter transitions and Clear filters. Screenshots and sampled recording frames were visually inspected.

Viewport Before After
Desktop Desktop before Desktop after
Phone Phone before Phone after

Full-resolution PNGs are linked from the verification notes.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

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/.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Artifact Cleanup Queued

The .pr/ directory reached main after merge. A cleanup PR has been opened or updated: #19111

@github-actions github-actions Bot added the type: fix A bug fix label Oct 25, 2026
@tanishqbaweja
tanishqbaweja marked this pull request as ready for review October 25, 2026 12:54

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@all-hands-bot
all-hands-bot requested a review from neubig October 30, 2026 10:01
…filter-scroll

# Conflicts:
#	src/components/features/automations/recommended-automations-section.tsx
@neubig

neubig commented Oct 30, 2026

Copy link
Copy Markdown
Member

Thank you!

@neubig
neubig merged commit 4ce9c4b into OpenHands:main Oct 30, 2026
14 checks passed
@openhands-release-bot openhands-release-bot Bot added the released: v1.35.0 Shipped in v1.35.0 label Nov 3, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in v1.35.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released: v1.35.0 Shipped in v1.35.0 type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Templates filter chip rail scrolls back to the start when the results empty or return, hiding the active chips

3 participants