Skip to content

feat: add toggle button to show/hide Monaco editor (#206)#209

Open
Pranav-0440 wants to merge 3 commits intoeclipse-editdor:masterfrom
Pranav-0440:fix/toggle-to-show/hide-the-monaco-editor
Open

feat: add toggle button to show/hide Monaco editor (#206)#209
Pranav-0440 wants to merge 3 commits intoeclipse-editdor:masterfrom
Pranav-0440:fix/toggle-to-show/hide-the-monaco-editor

Conversation

@Pranav-0440
Copy link
Contributor

Summary

This PR implements a toggle button to show/hide the Monaco JSON editor as requested in #206.

Changes

  • Added a toggle button in the header (next to Settings)
  • Conditionally render the Monaco editor and resize bar
  • Automatically expand TDViewer to full width when editor is hidden
  • Removed the previous floating toggle button
  • Kept layout responsive and consistent with existing design

Behavior

  • Clicking "Hide Code" hides the Monaco editor and expands the left view
  • Clicking "Show Code" restores the editor and split layout
  • No impact on undo/redo, validation, or existing functionality

Screenshots

Editor Visible :

image

Editor Hidden :

image

Testing

  • Verified layout responsiveness
  • Verified no console errors
  • Verified undo/redo still works
  • Verified build succeeds (npm run build)

Signed-off-by: Pranav-0440 <pranavghorpade61@gmail.com>
Copilot AI review requested due to automatic review settings February 26, 2026 14:16
@netlify
Copy link

netlify bot commented Feb 26, 2026

Deploy Preview for editdor ready!

Name Link
🔨 Latest commit 4e74c9a
🔍 Latest deploy log https://app.netlify.com/projects/editdor/deploys/69a1df3e91c5f60008795d89
😎 Deploy Preview https://deploy-preview-209--editdor.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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a toggle button in the application header to show/hide the Monaco JSON editor, replacing the previous floating button implementation.

Changes:

  • Added a toggle button with Eye/EyeOff icons in the header next to Settings
  • Modified the layout to conditionally render the Monaco editor and resize bar based on visibility state
  • Changed the default editor visibility from hidden to visible

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/App/AppHeader.tsx Added Eye/EyeOff icons import, updated component props to accept toggle handler and visibility state, added toggle button in header
src/App.tsx Changed default editor visibility to true, removed floating toggle button and related imports, updated layout to conditionally render editor and resize bar, passed toggle props to AppHeader

Signed-off-by: Pranav-0440 <pranavghorpade61@gmail.com>
@Pranav-0440
Copy link
Contributor Author

Hi @TejInaco,
I’ve opened a PR for this issue. Please let me know if any changes are needed.
Thank you!

Copy link
Contributor

@egekorkan egekorkan left a comment

Choose a reason for hiding this comment

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

@TejInaco the changes look and work good. Let me know what you think

@TejInaco TejInaco marked this pull request as draft February 27, 2026 12:39
@TejInaco TejInaco marked this pull request as draft February 27, 2026 12:39
@TejInaco TejInaco requested review from TejInaco February 27, 2026 12:39
@TejInaco
Copy link
Contributor

Tested the changes: After you clicked on hide, and click again, and the Json Editor appears, the functionality of move the vertical bar, the one that splits the two views, disappears, it remains fixed and the user is no long able to move it in order to increase or decrease the views. @Pranav-0440 see if you can understand why.

Signed-off-by: Pranav-0440 <pranavghorpade61@gmail.com>
@Pranav-0440
Copy link
Contributor Author

Hi @TejInaco,

Thank you for testing and pointing this out.
You were right the resize functionality was breaking because the Bar and Section components were being conditionally unmounted when hiding the editor, which caused the @column-resizer/react container to lose its internal state.

I’ve updated the implementation to keep the resizer structure mounted and only toggle its visibility and width instead. The vertical resize functionality now works correctly after hiding and showing the editor.
Please let me know if everything looks good now.

@Pranav-0440 Pranav-0440 marked this pull request as ready for review February 28, 2026 17:11
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.

4 participants