Skip to content

feat(agent): add 'Continue in Chat' dropdown to scheduled task results#969

Open
CENK TEKİN (cenktekin) wants to merge 5 commits into
browseros-ai:devfrom
cenktekin:feat/949-continue-in-chat
Open

feat(agent): add 'Continue in Chat' dropdown to scheduled task results#969
CENK TEKİN (cenktekin) wants to merge 5 commits into
browseros-ai:devfrom
cenktekin:feat/949-continue-in-chat

Conversation

@cenktekin
Copy link
Copy Markdown

@cenktekin CENK TEKİN (cenktekin) commented May 8, 2026

Summary

  • Add "Continue in Chat" dropdown button to scheduled task result dialog
  • Users can continue the conversation with task output in Chat or Assistant mode
  • Fixes pre-existing import path bug in ScheduleResults.tsx

Changes

RunResultDialog.tsx

  • Added DropdownMenu with two options: Chat and Assistant
  • Chat navigates to /home/chat?q=<result>&mode=chat
  • Assistant navigates to /home/chat?q=<result>&mode=agent
  • Button only appears when run.result exists (same as Copy button)
  • Uses existing shadcn DropdownMenu components
  • Tracks usage via SCHEDULED_TASK_CONTINUE_IN_CHAT_EVENT analytics event

ScheduleResults.tsx

  • Fixed import path: ../app/scheduled-tasks/types../../app/scheduled-tasks/types
  • This was a pre-existing bug that blocked the build

analyticsEvents.ts

  • Added SCHEDULED_TASK_CONTINUE_IN_CHAT_EVENT constant

Motivation

When a scheduled task completes, users currently have no way to immediately act on the output. They must manually copy, open a new chat, and paste. This feature closes the loop — run → review → act → repeat — without leaving the browser.

Mock UX

┌─────────────────────────────────┐
│  Scheduled Task: "Morning News" │
│  Completed at 09:00             │
│                                 │
│  [Latest headlines...]          │
│                                 │
│  [Copy]  [Continue in Chat ▼]  [Close]  │
│                   ├─ Chat       │
│                   └─ Assistant  │
└─────────────────────────────────┘
Ekran Görüntüsü_20260508_123946

Closes #949

…expand

- Add ScheduledTaskResultGroup component for accordion-style grouping
- Group results by job name with expand/collapse behavior
- Only one group expanded at a time (accordion pattern)
- Update ScheduleResults (newtab) for consistency
- Each group shows: task name, latest timestamp, result count

Fixes browseros-ai#950
- Ensure running task groups are always visible in newtab preview
- Add fallback job name when jobs not yet loaded (prevents empty state flash)
- Extract groupRunsByJob helper to reduce code duplication
- Remove unused imports

Addresses review comments on PR browseros-ai#961
Add a dropdown button to the RunResultDialog that allows users to continue
the conversation with the task output in either Chat or Assistant mode.

- DropdownMenu with Chat (mode=chat) and Assistant (mode=agent) options
- Navigates to /home/chat with encoded result as query parameter
- Tracks usage via SCHEDULED_TASK_CONTINUE_IN_CHAT_EVENT analytics event
- Fixes pre-existing import path bug in ScheduleResults.tsx

Closes browseros-ai#949
Copilot AI review requested due to automatic review settings May 8, 2026 09:42
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

PR author is not in the allowed authors list.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “Continue in Chat” action from scheduled task run results so users can jump directly into a Chat/Assistant conversation seeded with the task output, and refactors scheduled task result lists to be grouped by job.

Changes:

  • Add “Continue in Chat” dropdown (Chat / Assistant) to the run result dialog and track usage via a new analytics event.
  • Refactor scheduled task results UIs to display runs grouped by scheduled job (collapsible groups).
  • Fix scheduled task types import path in ScheduleResults.tsx (pre-existing build issue per PR description).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/browseros-agent/apps/agent/lib/constants/analyticsEvents.ts Adds SCHEDULED_TASK_CONTINUE_IN_CHAT_EVENT constant for analytics tracking.
packages/browseros-agent/apps/agent/components/ai-elements/run-result-dialog.tsx Adds “Continue in Chat” dropdown and navigation logic from run results.
packages/browseros-agent/apps/agent/entrypoints/newtab/index/ScheduleResults.tsx Fixes import path and changes results UI to grouped/collapsible job sections.
packages/browseros-agent/apps/agent/entrypoints/app/scheduled-tasks/types.ts Introduces shared JobGroup / JobRunWithDetails types and groupRunsByJob helper.
packages/browseros-agent/apps/agent/entrypoints/app/scheduled-tasks/ScheduledTaskResults.tsx Updates scheduled task results page to render grouped runs via a new component.
packages/browseros-agent/apps/agent/entrypoints/app/scheduled-tasks/ScheduledTaskResultGroup.tsx New collapsible group component for displaying runs per scheduled job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/browseros-agent/apps/agent/components/ai-elements/run-result-dialog.tsx Outdated
CENK TEKİN (cenktekin) and others added 2 commits May 8, 2026 12:49
Address Copilot review: avoid passing full task output via URL query
params which can exceed browser limits and expose sensitive data.

- Store result in sessionStorage with run-specific key
- Pass key reference via URL (not the full result)
- NewTabChat reads from sessionStorage when source=scheduled-task
- Clean up sessionStorage after reading

Co-authored-by: Copilot <copilot@github.com>
- Add missing ScheduledJobRun import in ScheduledTaskResultGroup.tsx
- Optimize groupRunsByJob: O(n²) → O(n) by precomputing jobs Map

Co-authored-by: Copilot <copilot@github.com>
@cenktekin
Copy link
Copy Markdown
Author

All review comments addressed in 6d3b8669:

  • ScheduledJobRun import — Added missing type import in ScheduledTaskResultGroup.tsx
  • O(n²) → O(n) — Precomputed a Map of jobs by id in groupRunsByJob() for O(1) lookups
  • URL security — Moved task result transfer from URL query to sessionStorage; URL now only contains a reference key

Ready to merge when you are ✅

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.

[Feat] "Continue in Chat" button for scheduled task results

2 participants