Skip to content

feat(ui): improve scheduled task controls - #378

Merged
jromualdez-scale merged 2 commits into
mainfrom
jerome/schedule-modal-improvements
Jul 27, 2026
Merged

feat(ui): improve scheduled task controls#378
jromualdez-scale merged 2 commits into
mainfrom
jerome/schedule-modal-improvements

Conversation

@jromualdez-scale

@jromualdez-scale jromualdez-scale commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add client-side search to the scheduled tasks agent picker
  • close and reset the picker on selection, outside click, or Escape
  • add a visible label to the prompt field in the edit schedule modal

Test plan

  • Run npm run typecheck
  • Lint the updated schedule components
  • Run npm run test:run -- hooks/use-agents.test.tsx
  • Verify the searchable picker and prompt label locally

Made with Cursor

Greptile Summary

This PR improves the scheduled-tasks UI in two ways: it replaces the Radix Select with a custom searchable dropdown for the scope picker, and it adds an explicit "Prompt" label to the edit-schedule textarea.

  • Custom agent picker — adds client-side filtering, Escape / outside-click dismissal, and focus-return to the trigger; removes the Radix Select dependency from this component.
  • Prompt label — wraps the textarea in a <label> element with a visible "Prompt" span, matching the existing ScheduleNameInput pattern and improving accessibility.
  • Known gap — the trigger button's onClick handler does not call setQuery('') when closing, so a stale search term persists if the user toggles the dropdown closed via the button rather than via Escape, outside-click, or item selection.

Confidence Score: 4/5

Safe to merge after fixing the stale-query issue on trigger-button close.

The custom dropdown correctly resets the search query on every close path (Escape, outside-click, item selection) except one: clicking the trigger button a second time only toggles isOpen without calling setQuery. A user who closes via the button and reopens sees a filtered list based on their previous search term with no explanation. The fix is a one-liner. Everything else is correct.

Files Needing Attention: agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx — the trigger button onClick handler needs to clear the search query when closing.

Important Files Changed

Filename Overview
agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx Replaces Radix Select with a custom searchable dropdown; correctly handles outside-click, Escape, and item-selection close paths, but omits query reset when the trigger button toggles the dropdown closed.
agentex-ui/components/scheduled-tasks/schedule-modals.tsx Wraps the prompt textarea in a labeled <label> element, matching the existing ScheduleNameInput pattern; straightforward and safe change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([User clicks trigger button]) --> B{isOpen?}
    B -- false --> C[setIsOpen true\nautoFocus search input]
    B -- true --> D[setIsOpen false\n query NOT cleared]
    C --> E[Dropdown renders]
    E --> F{User action}
    F -- Types in search --> G[filteredAgents updates]
    F -- Selects item --> H[selectAgent or selectScope\nsetIsOpen false\nsetQuery empty\ntriggerRef.focus]
    F -- Presses Escape --> I[closeOnEscape handler\nsetIsOpen false\nsetQuery empty\ntriggerRef.focus]
    F -- Clicks outside --> J[closeOnOutsideClick handler\nsetIsOpen false\nsetQuery empty]
    F -- Clicks trigger again --> D
    D --> K([Dropdown closes, stale query remains])
Loading

Reviews (2): Last reviewed commit: "fix(ui): handle schedule picker loading ..." | Re-trigger Greptile

Make agent selection searchable and label the edit prompt field so schedule configuration is easier to navigate.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jromualdez-scale
jromualdez-scale marked this pull request as ready for review July 27, 2026 13:11
@jromualdez-scale
jromualdez-scale requested a review from a team as a code owner July 27, 2026 13:11
Comment thread agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx Outdated
Comment thread agentex-ui/components/scheduled-tasks/scheduled-tasks-page.tsx
Avoid an empty-result message before searching and restore trigger focus after keyboard dismissal or selection.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jromualdez-scale
jromualdez-scale merged commit b5a1d17 into main Jul 27, 2026
15 checks passed
@jromualdez-scale
jromualdez-scale deleted the jerome/schedule-modal-improvements branch July 27, 2026 14:08
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.

2 participants