Skip to content

feat: consolidate flows UI into collapsible sidebar with tabs#74

Open
tekram wants to merge 8 commits intogrp06:mainfrom
tekram:feat/flows-sidebar-consolidation
Open

feat: consolidate flows UI into collapsible sidebar with tabs#74
tekram wants to merge 8 commits intogrp06:mainfrom
tekram:feat/flows-sidebar-consolidation

Conversation

@tekram
Copy link

@tekram tekram commented Feb 23, 2026

Summary

Redesigned the Studio UI to consolidate all automation/monitoring features (Cron Jobs, Sessions, Captures) into a unified collapsible sidebar, plus added comprehensive session tracking with analytics and export capabilities.

Supersedes #73 with a better UX approach.

Screenshots

Flows Sidebar - Cron Jobs Tab

Cron Jobs Tab

Full cron job management with schedule builder, Telegram notifications, and reports viewer.

Sessions Tab

Sessions Tab

Real-time Claude Code activity tracking with enhanced session management:

  • Color-coded interruption reasons (crash, timeout, manual, superseded, dismissed)
  • Duration badges and last activity timestamps
  • Action buttons (Mark Done ✓, Dismiss ✗) on hover
  • Stats and export functionality

Captures Tab

Captures Tab

Telegram captures with quick-add input, checkboxes, and delete actions.

Sidebar Collapsed

Collapsed

Toggle button on the right edge when sidebar is closed.

Changes

Gateway Consolidation (Commit 1)

  • Migrated cron management from file-based API to Gateway WebSocket RPC
  • Added updateCronJob() function for cron.update RPC
  • Removed /api/cron route (replaced by gateway client)
  • Result: Studio and gateway dashboard now stay in sync

UI Redesign (Commit 2)

  • Created FlowsSidebar component with 3 tabs:
    • Cron Jobs: Full management UI (add/edit/delete/run/reports)
    • Sessions: Real-time Claude Code activity tracking
    • Captures: Telegram TODOs with quick-add
  • Removed 3 page routes: /cron, /sessions, /todos
  • Removed 3 widget banner components
  • Result: Everything accessible from main page without navigation

Advanced Session Tracking (Commits 3-4)

  • 6 interruption reason types with color-coded icons (manual, crash, superseded, timeout, dismissed, unknown)
  • Auto-timeout detection: Sessions inactive for 4+ hours automatically marked as interrupted
  • Duration tracking: All sessions show elapsed time with human-readable badges
  • Session actions: Mark Done and Dismiss buttons on hover
  • Analytics dashboard: /api/sessions/stats with comprehensive statistics
  • Export functionality: Download sessions as JSON or CSV
  • Enhanced logging: Support for --reason flag in session logging
  • Auto-refresh: Sessions tab refreshes on selection

New API Endpoints

  • POST /api/sessions - Session actions (dismiss, markDone, addNote)
  • GET /api/sessions/stats - Session analytics (total, by status, by project, interruption reasons)
  • GET /api/sessions/export - Export sessions (JSON or CSV format)

Benefits

  • Better workflow: No context switching between agents and automation
  • Cleaner UI: No banner widgets taking vertical space
  • Consistent pattern: Sidebar design like VS Code/Cursor
  • Synchronized data: Gateway and Studio always show same cron jobs
  • Rich session context: Understand why sessions were interrupted
  • Actionable insights: Analytics to track patterns and productivity
  • Data portability: Export for retrospectives or external analysis
  • Room to grow: Easy to add more tabs in future

Testing

  • TypeScript compiles cleanly
  • Next.js build passes
  • All functionality migrated from old widgets/pages
  • Gateway connection status reflected in Cron tab
  • Reports viewer works within sidebar
  • Sessions auto-refresh on tab selection
  • TODOs quick-add and checkboxes functional
  • Session actions (dismiss, mark done) working
  • Stats endpoint returns valid analytics
  • Export downloads correct files

Documentation

  • Added CLAUDE.md with repository-specific guidance for future development
  • Added PLAN-advanced-session-tracking.md with implementation details
  • Documented fork/upstream contribution workflow

Breaking Changes

None - only internal UI reorganization and additive features. All existing API routes preserved.

Files Changed

Total: 10 files changed, 1,690 insertions (+), 51 deletions (-)

Modified:

  • src/types/sessions.ts - Extended session types
  • src/app/api/sessions/route.ts - Enhanced with POST endpoint
  • src/components/FlowsSidebar.tsx - Minor update
  • src/components/FlowsSidebar/SessionsTab.tsx - Major enhancements

Created:

  • src/lib/sessions/formatting.ts - Display utilities
  • src/lib/sessions/actions.ts - API client
  • src/app/api/sessions/stats/route.ts - Analytics endpoint
  • src/app/api/sessions/export/route.ts - Export endpoint
  • CLAUDE.md - Repository guide
  • PLAN-advanced-session-tracking.md - Implementation plan

Commits

  • d99f708: refactor: consolidate cron management to use Gateway WebSocket RPC
  • a325799: feat: consolidate flows UI into collapsible sidebar with tabs
  • 941a667: docs: add screenshots for flows sidebar PR
  • 026a509: feat: add advanced session tracking with analytics and export
  • a7b9c8f: docs: add fork context and contribution workflow to CLAUDE.md

🤖 Generated with Claude Code

tekram and others added 6 commits February 22, 2026 16:21
- Cron management page (/cron): create/edit/delete/toggle scheduled jobs,
  reports viewer per job, configurable Telegram delivery
- TODO assignments: assign project-tagged items to Claude Code from Studio
- Sessions page (/sessions): view active/paused/completed Claude sessions
- Captures/TODOs page (/todos): manage items from CAPTURES.md with assign button
- Dashboard widgets: CronWidget, SessionsWidget, TodosWidget on main page
- API routes: /api/cron, /api/cron/reports, /api/assign, /api/sessions, /api/todos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ction

- Cron: "Run Now" button on job cards, spawns job immediately
- Sessions: rewrite parser to track each START as separate instance
  (fixes collapsed/missing sessions bug)
- Sessions: auto-detect stale sessions (4+ hours with no update)
- Sessions: add status legend explaining each state
- Sessions: fix React keys for duplicate project names

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Stale check now uses lastActivityTime instead of startTime, so
  resumed sessions reset the 4-hour clock
- Hide interrupted and completed sessions older than 24 hours from
  the dashboard (still in sessions.log for history)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, Studio's cron page wrote directly to jobs.json, bypassing the
gateway. This caused sync issues - jobs added in Studio wouldn't appear
in the gateway dashboard and vice versa.

Changes:
- Add updateCronJob() function to types.ts for cron.update RPC
- Add outputDir field to CronJobSummary type (returned by gateway)
- Remove file-based /api/cron route (replaced by gateway RPC)
- Cron page now uses GatewayClient for all operations

Result: One source of truth. Jobs stay synchronized between Studio and
gateway dashboard. Both UIs now work together seamlessly.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Redesigned the Studio UI to provide a unified automation/monitoring interface
without requiring page navigation. All flows features are now accessible from
the main agent view via a collapsible right sidebar.

Before:
- Three banner widgets (Sessions, TODOs, Cron) took vertical space
- Separate pages required navigation (/cron, /sessions, /todos)
- Context switching between agent work and automation management

After:
- Single collapsible sidebar (480px) on the right edge
- Three tabs: Cron Jobs, Sessions, Captures
- All functionality accessible without leaving agent interface
- Toggle button for show/hide (starts open by default)

New Components:
- FlowsSidebar: Main container with tab navigation
- CronTab: Full cron job management (migrated from /cron page)
- SessionsTab: Real-time Claude Code session tracking
- TodosTab: Captures from Telegram with quick-add and checkboxes

Deleted:
- Page routes: /cron, /sessions, /todos
- Widget components: SessionsWidget, TodosWidget, CronWidget

Benefits:
- Reduced UI clutter (no banner widgets)
- Better workflow (no navigation required)
- Consistent layout (sidebar pattern like VS Code/Cursor)
- Room for future expansion (more tabs as needed)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 941a66749c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


function isSafePath(filePath: string): boolean {
const resolved = path.resolve(filePath);
return ALLOWED_BASES.some(base => resolved.startsWith(path.resolve(base)));

Choose a reason for hiding this comment

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

P1 Badge Enforce base-path boundary in report directory checks

isSafePath currently allows any path whose resolved string starts with the allowed base, which also matches sibling paths like .../workspace-backup and lets /api/cron/reports read files outside the intended workspace tree when dir is user-controlled. This should validate a real path boundary (resolved === base or resolved.startsWith(base + path.sep)) rather than a raw prefix match.

Useful? React with 👍 / 👎.

}

return (
<div className="fixed top-14 right-0 bottom-0 w-[480px] bg-background border-l border-border z-[170] flex flex-col shadow-xl">

Choose a reason for hiding this comment

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

P1 Badge Keep flows sidebar below global blocking overlays

The sidebar uses z-[170], which is above the existing full-screen lock modals in src/app/page.tsx (z-[100] for create/restart blocks), so users can still interact with cron/todos while the app is supposed to be frozen. This bypasses the mutation safety lock and can trigger side effects during critical restart/create windows.

Useful? React with 👍 / 👎.

tekram and others added 2 commits February 23, 2026 14:20
Implements comprehensive session management system with rich context,
categorization, and analytics capabilities.

Backend enhancements:
- Add InterruptReason type with 6 categories (manual, crash, superseded, timeout, dismissed, unknown)
- Auto-convert stale (4h+ inactive) sessions to exited with timeout reason
- Calculate duration for all ended sessions
- Add POST /api/sessions endpoint for dismiss/markDone/addNote actions
- Add /api/sessions/stats endpoint with comprehensive analytics
- Add /api/sessions/export endpoint (JSON/CSV formats)

UI enhancements:
- Rich session cards with color-coded reason icons and labels
- Duration badges and last activity timestamps
- Action buttons (Mark Done, Dismiss) on hover
- Show/hide dismissed sessions toggle
- Stats button to view analytics dashboard
- Export dropdown for JSON/CSV download
- Auto-refresh on tab selection

Documentation:
- Add CLAUDE.md with repository-specific guidance
- Add PLAN-advanced-session-tracking.md with implementation details

Files:
- Modified: src/types/sessions.ts, src/app/api/sessions/route.ts,
  src/components/FlowsSidebar.tsx, src/components/FlowsSidebar/SessionsTab.tsx
- Created: src/lib/sessions/formatting.ts, src/lib/sessions/actions.ts,
  src/app/api/sessions/stats/route.ts, src/app/api/sessions/export/route.ts,
  CLAUDE.md, PLAN-advanced-session-tracking.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Notes that this is a personal fork (tekram/openclaw-studio) maintained
alongside contributing to the upstream open-source project (grp06/openclaw-studio).

Documents development approach and workflow for balancing fork-specific
customizations with upstream contributions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant