agent-zero icon indicating copy to clipboard operation
agent-zero copied to clipboard

Sidebar Tasks list is clipped and mouse wheel does nothing once it exceeds ~40% height

Open bdunn77 opened this issue 2 weeks ago • 0 comments

Summary

In v2.16, the sidebar Tasks section becomes unusable once the list grows beyond roughly 40% of the sidebar height:

  • The list is clipped, with the remaining tasks unreachable.
  • Mouse-wheel scrolling does nothing over the task rows.
  • Clicking-dragging the scrollbar does work, which makes it look like scrolling is fine.
  • The scrollbar itself is a near-invisible ~10px dark-on-dark sliver.

All four are separate root causes stacked in the same component tree. Verified against pristine v2.16 (2b0b3a41) in a live browser.

Environment

  • Agent Zero v2.16, commit 2b0b3a41
  • Chromium, sidebar 249px wide
  • Sidebar Folders plugin enabled (folder_view: true, the default)
  • Reproduced with 16 scheduled tasks

Root causes

1. #extensions-section clips its content instead of scrolling

webui/components/sidebar/left-sidebar.html caps the section and hides the overflow:

#extensions-section {
  max-height: 40%;
  overflow: hidden;
}

The inner list keeps its full content height because it has no bounded parent to scroll within, so everything past the cap is discarded. Measured with Tasks expanded:

Element clientHeight scrollHeight overflow
#extensions-section 263px 895px hidden
.tasks-config-list 848px 848px nothing to scroll

scrollTop on the section stayed 0 no matter what was assigned.

2. The inner list is a wheel trap

plugins/_scheduler/webui/sidebar/tasks-list.html makes the list a scroll container that can never overflow, and tells it to consume overscroll:

.tasks-config-list {
  overflow-y: auto;
  overscroll-behavior: contain;
}

clientHeight === scrollHeight === 848, so a wheel event lands on a box with nothing to scroll and contain forbids chaining to the parent. The event is swallowed at row level and never reaches the real scroller.

That single line explains the reported inconsistency: dragging the parent's own scrollbar bypasses the rows entirely, so it works, while the wheel dies.

Evidence — identical real wheel event (300px) at the same coordinates over a task row:

before after
#extensions-section scrollTop 0 300

3. Global thin-scrollbar rule hides the handle

webui/index.css applies body * { scrollbar-width: thin; scrollbar-color: #555 transparent; }. On the dark sidebar this yields a 10px near-invisible handle. Note that in Chromium, any scrollbar-width other than auto causes ::-webkit-scrollbar rules to be ignored, so a fix must set scrollbar-width: auto explicitly.

4. Polling rebuilds the list every 2 seconds

Both task stores replace the array on every poll, defeating their own reference-preserving merge:

  • plugins/_scheduler/webui/sidebar/tasks-store.js — this.tasks = sorted;
  • plugins/_scheduler/webui/scheduler/scheduler-store.js — this.tasks = tasks.map(...), assigned unconditionally even though the objects themselves are merged with preserved identity.

fetchTasks is on a 2000 ms interval, and index.js feeds tasksStore.applyTasks(...) from snapshots. Every cycle wakes the bound effects and rebuilds the list, resetting scroll position mid-browse and causing flicker.

Reproduction

  1. Create enough scheduled tasks to exceed ~40% of the sidebar height (16 were enough at 900px viewport).
  2. Expand Tasks in the sidebar.
  3. Observe the last tasks cannot be reached: the wheel does nothing over the rows, while dragging the scrollbar does move the list.

Proposed fix

Six changes across five files, all local to the sidebar/task UI. Measured results after applying:

Check Before After
Section reachability by wheel clipped, scrollTop stuck at 0 scrolls, scrollTop 300
Rendered scrollbar 10px, near-invisible 15px, visible thumb
Scrollbar drag works still works
List rebuild on idle poll every 2s only on real change

Key parts:

/* left-sidebar.html */
#extensions-section {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: auto;      /* required or ::-webkit-scrollbar is ignored */
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
#extensions-section::-webkit-scrollbar { width: 12px; }
#extensions-section::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
  background-clip: content-box; border: 2px solid transparent; border-radius: 6px;
}
/* tasks-list.html - this list must not be a scroll container */
.tasks-config-list { flex: 0 0 auto; min-height: 0; overflow: visible; overscroll-behavior: auto; }
// tasks-store.js / scheduler-store.js - publish only on real change
const unchanged =
  current.length === sorted.length &&
  sorted.every((task, index) => current[index] === task);
if (!unchanged) this.tasks = sorted;

Full patch is available on request; it applies cleanly to v2.16 with git apply --check.

Notes

  • Kept max-height: 40% as-is so the layout intent is preserved; the section simply scrolls within it instead of clipping.
  • scrollbar-gutter: stable avoids the content shift when the scrollbar appears.
  • Happy to open a PR with the complete patch if that is the preferred route.

bdunn77 avatar Nov 19 '26 02:11 bdunn77