Skip to content

Conversation

@bmartel
Copy link
Contributor

@bmartel bmartel commented May 22, 2025

This pull request introduces significant updates to the Label Studio Playground, simplifying the user interface and improving the overall functionality by replacing the in-page editor with an iframe-based implementation. Key changes include removing the old editor logic, introducing a new iframe-based playground, and enhancing the codebase with better modularity and readability.

UI Simplifications and Enhancements:

  • Replaced the in-page editor and preview interface with a single iframe (label-studio-playground) that dynamically loads the configuration and preview from an external URL. This simplifies the user experience and reduces the complexity of the page. (docs/source/playground/index.ejs, [1] [2] [3]

  • Removed the old editor logic, including the CodeMirror editor, validation, and iframe generation logic, as they are no longer needed with the new iframe-based approach. (docs/source/playground/index.ejs, docs/source/playground/index.ejsL722-L957)

Codebase Improvements:

  • Refactored JavaScript code in code-blocks-enhancements.js to improve readability and modularity. Renamed functions for better clarity (e.g., insert_render_editor to editorIframe) and replaced inline styles with template literals for consistency. (docs/themes/v2/source/js/code-blocks-enhancements.js, [1] [2] [3]

  • Updated the CSS for the iframe to ensure responsive design, setting the width and height to a percentage of the viewport. (docs/themes/v2/source/css/styles.css, docs/themes/v2/source/css/styles.cssL2320-R2325)

Playground App Updates:

  • Added new atoms to manage the iframe's display mode (preview or all) and updated the PlaygroundApp component to reflect these changes. This enables better control over the app's behavior based on query parameters. (web/apps/playground/src/atoms/configAtoms.ts, [1]; web/apps/playground/src/components/PlaygroundApp/PlaygroundApp.tsx, [2]

These changes collectively modernize the Label Studio Playground, making it more user-friendly and maintainable.

@bmartel bmartel requested a review from a team as a code owner May 22, 2025 21:37
@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for heartex-docs ready!

Name Link
🔨 Latest commit 4e4524b
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/68307832a3e02400082fe582
😎 Deploy Preview https://deploy-preview-7605--heartex-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the feat label May 22, 2025
@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 4e4524b
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/68307832e5e1b8000864f1a8
😎 Deploy Preview https://deploy-preview-7605--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 4e4524b
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/683078320742c60008242d40
😎 Deploy Preview https://deploy-preview-7605--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for label-studio-docs-new-theme ready!

Name Link
🔨 Latest commit 4e4524b
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/6830783249f479000889eebb
😎 Deploy Preview https://deploy-preview-7605--label-studio-docs-new-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bmartel bmartel merged commit 62af44c into develop May 23, 2025
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants