Split workflow summary JSON into two on wide screens#1037
Split workflow summary JSON into two on wide screens#1037adhityamamallan merged 2 commits intocadence-workflow:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the WorkflowSummaryJsonView component to support responsive design by displaying JSON data differently on narrow vs. wide screens. On wide screens, it shows separate input and result views side-by-side, while on narrow screens it maintains the tabbed interface with improved default tab selection based on workflow state.
- Add new props
defaultTabandhideTabToggleto WorkflowSummaryJsonView component - Implement responsive layout with separate JSON panels for wide screens and a single tabbed panel for narrow screens
- Show result tab by default for completed workflows on narrow screens
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| workflow-summary.tsx | Updates layout to render three JSON view instances with responsive CSS classes and conditional default tabs |
| workflow-summary.styles.ts | Adds responsive CSS classes to show/hide JSON panels based on screen size |
| workflow-summary-json-view.types.ts | Defines new props for tab control and tab type definition |
| workflow-summary-json-view.tsx | Implements conditional rendering of tab toggle vs static title and dynamic tab generation |
| workflow-summary-json-view.styles.ts | Adds styling for static title display |
| workflow-summary-json-view.constants.tsx | Refactors tab options into a type-safe label mapping |
| workflow-summary-json-view.test.tsx | Adds comprehensive test coverage for new props and behavior |
| workflow-summary.test.tsx | Updates tests to verify multiple JSON view instances with correct props |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/views/workflow-summary/workflow-summary-json-view/workflow-summary-json-view.tsx
Show resolved
Hide resolved
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
d87fc0b to
d5525b6
Compare
| </div> | ||
| <div className={cls.jsonArea}> | ||
| {/* On narrow screens */} | ||
| <div className={cls.jsonPanel}> |
There was a problem hiding this comment.
Creating the hiding logic based on css, still renders what is inside. On wide screens now we have 2 JSONs showing by default + the unused hidden JSON.
this decreases what the page can handle to 1/3. Lets have a followup for changing this to be based on JS condition instead of css
There was a problem hiding this comment.
Yup, I'll add an issue to track this. Do we currently have the capability to render based on screen width?
Summary
defaultTab: Default tab that is opened on loadhideTabToggle: Replaces the tab toggle with a static title when trueTest plan
Updated unit tests + ran locally.
Completed workflow
Running workflow