feat: FIT-953: Improve the JSON Viewer#9245
Conversation
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/git merge
|
|
/git merge
|
|
/git merge
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9245 +/- ##
===========================================
- Coverage 65.86% 56.39% -9.48%
===========================================
Files 842 573 -269
Lines 65625 41336 -24289
Branches 11391 11433 +42
===========================================
- Hits 43225 23311 -19914
+ Misses 22396 18021 -4375
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/git merge
|
This pull request introduces a new, feature-flagged interactive JSON viewer for viewing task source data in the Data Manager, replacing the older inline implementation with a more modular and extensible approach. It adds a new
TaskSourceViewercomponent with support for toggling between a code view and an interactive JSON viewer, improves styling and copy-to-clipboard functionality, and updates modal integration. Several supporting UI exports and feature flags are also added.Recording
https://www.loom.com/share/d153d666f4ba407b881def51d990f3a1
Task Source Viewer Refactor and Interactive JSON Viewer Integration:
Introduced a new
TaskSourceViewercomponent that loads and displays task source data, allowing users to switch between a formatted code view and an interactive JSON viewer, controlled by theFF_INTERACTIVE_JSON_VIEWERfeature flag. The component supports localStorage persistence of view mode and external rendering of the view toggle (e.g., in a modal header). (TaskSourceViewer.tsx,CodeView.tsx,ViewToggle.tsx,index.ts,feature-flags.js, [1] [2] [3] [4] [5]Replaced the old inline
TaskSourceViewimplementation in the table modal with the newTaskSourceViewer, updating modal integration to allow rendering the view toggle in the modal header and adjusting modal width. (Table.jsx, web/libs/datamanager/src/components/Common/Table/Table.jsxL175-R190)Styling and UI Improvements:
Added new SCSS modules for
TaskSourceViewerandCodeViewto improve layout, code block appearance, and copy button styling. (TaskSourceViewer.module.scss,CodeView.module.scss, [1] [2]Updated global scrollbar color for consistency in dark mode. (
global.scss, web/libs/editor/src/assets/styles/global.scssR207-R210)UI Library and Icon Updates:
Exported the new
JsonViewercomponent and related types from the UI library, along withTabscomponents needed for the view toggle. (ui/src/index.ts,ui/src/lib/json-viewer/index.ts, [1] [2]Added a new icon export
IconBookOpenTextto the UI icon set. (ui/src/assets/icons/index.ts, web/libs/ui/src/assets/icons/index.tsR38)Code Cleanup:
Removed the old
TaskSourceViewcomponent and unused imports from the table component. (Table.jsx, [1] [2]Added the new
TaskSourceViewerimport to the table component. (Table.jsx, web/libs/datamanager/src/components/Common/Table/Table.jsxR19)