Skip to content

fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data - #1719

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/dashboard
Oct 22, 2025
Merged

fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data#1719
waleedlatif1 merged 4 commits into
stagingfrom
fix/dashboard

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • add additional context for paginated logs in dashboard, add empty state when selected cell has no data
  • add ability to cmd-click for discontinuous segment selection, shift-click for continuous selections

Type of Change

  • Bug fix

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Oct 22, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedOct 22, 2025 8:59pm

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Greptile Overview

Summary

Enhanced the dashboard logs view with multi-segment selection capabilities and improved user experience. Refactored duplicated log mapping logic into reusable utility functions to improve maintainability.

Key Changes:

  • Multi-segment selection: Added support for cmd-click (discontinuous) and shift-click (continuous range) segment selection, allowing users to select segments across multiple workflows
  • Empty state handling: Added informative message when selected time segments contain no execution logs
  • Code consolidation: Extracted duplicated log mapping logic (~70+ lines repeated 3x) into shared utility functions (mapToExecutionLog, mapToExecutionLogAlt, parseDuration, extractOutput)
  • Import path consistency: Consolidated formatDate function into main utils file and updated all imports to use absolute path aliases
  • Multi-workflow view: Implemented aggregated view (__multi__) when segments from multiple workflows are selected

Impact:
The refactoring significantly reduces code duplication while adding powerful multi-selection capabilities that improve the user's ability to analyze logs across different workflows and time segments.

Confidence Score: 4/5

  • This PR is generally safe to merge with low risk, though the complex selection logic should be tested thoroughly
  • The refactoring improves code quality by eliminating significant duplication. The multi-selection feature adds complexity but follows React patterns appropriately. The main concern is the intricate state management with selectedSegments as a Record and the special __multi__ mode, which introduces edge cases that should be well-tested. The empty state fix is straightforward and correct.
  • Pay close attention to apps/sim/app/workspace/[workspaceId]/logs/dashboard.tsx for the complex selection state logic and edge cases in multi-workflow aggregation

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/workspace/[workspaceId]/logs/utils.ts5/5Refactored duplicated log mapping logic into reusable utility functions (parseDuration, extractOutput, mapToExecutionLog, mapToExecutionLogAlt) and consolidated formatDate from separate file
apps/sim/app/workspace/[workspaceId]/logs/dashboard.tsx4/5Enhanced multi-segment selection with cmd-click/shift-click support, added multi-workflow view (__multi__), refactored state from single array to Record keyed by workflow ID, replaced inline mapping with utility functions
apps/sim/app/workspace/[workspaceId]/logs/components/dashboard/workflow-details.tsx5/5Added empty state message when no logs found in time segment, improved loading indicator logic to only show when logs exist, updated chart label from "Workflow Duration" to "Duration", updated import paths

Sequence Diagram

sequenceDiagram
participant User
participant Dashboard
participant WorkflowsList
participant WorkflowDetails
participant API
participant Utils
User->>Dashboard: Click segment (with cmd/shift)
Dashboard->>Dashboard: handleSegmentClick(mode: toggle/range/single)
alt Toggle Mode (cmd-click)
Dashboard->>Dashboard: Add/remove segment from selectedSegments[workflowId]
Dashboard->>Dashboard: Check if multiple workflows selected
alt Multiple workflows
Dashboard->>Dashboard: Set expandedWorkflowId = '__multi__'
else Single workflow
Dashboard->>Dashboard: Set expandedWorkflowId to workflow
end
else Range Mode (shift-click)
Dashboard->>Dashboard: Expand selection using lastAnchorIndices[workflowId]
Dashboard->>Dashboard: Update selectedSegments[workflowId]
else Single Mode (regular click)
Dashboard->>Dashboard: Clear all selections
Dashboard->>Dashboard: Set selectedSegments = {[workflowId]: [index]}
end
Dashboard->>API: Fetch workflow details if not loaded
API-->>Dashboard: Return logs data
Dashboard->>Utils: mapToExecutionLog(rawLog)
Utils-->>Dashboard: ExecutionLog[]
Dashboard->>WorkflowsList: Pass selectedSegments
WorkflowsList->>WorkflowsList: Render segments with selections
alt Multi-workflow mode
Dashboard->>Dashboard: Aggregate logs from all selected workflows
Dashboard->>Dashboard: Build combined charts
Dashboard->>WorkflowDetails: Render multi-workflow view
else Single workflow mode
Dashboard->>Dashboard: Filter logs by selected segments
Dashboard->>WorkflowDetails: Render single workflow view
alt No logs in selection
WorkflowDetails->>User: Show "No executions found in this time segment"
else Has logs
WorkflowDetails->>User: Display logs table
end
end
Loading

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
waleedlatif1 merged commit ec034f3 into stagingOct 22, 2025
9 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/dashboard branch October 22, 2025 21:07
waleedlatif1 added a commit that referenced this pull request Oct 23, 2025
* fix(debug-mode): remove duplicate debug mode flag (#1714)
* feat(i18n): update translations (#1709)
* improvement(condition): added variable and envvar highlighting for condition input (#1718)
* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data (#1719)
* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data
* apps/sim
* renaming
* remove relative import
* feat(tools): added webflow OAuth + tools (#1720)
* feat(tools): added webflow OAuth + tools
* remove itemId from delete item
* remove siteId
* added webhook triggers + oauth scopes + site/collection selector
* update sample payload for webflow triggers
* cleanup
* fix discord color
* feat(i18n): update translations (#1721)
* improvement(schedule): fix UI bug with schedule modal (#1722)
Sign up for freeto 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

@waleedlatif1