Skip to content

Conversation

claude[bot]
Copy link
Contributor

@claude claude bot commented Sep 11, 2025

Summary

This PR fixes the reset button behavior for preprocessor scripts in the Monaco editor. Previously, when clicking the reset button while on the preprocessor tab, it would reset to the main function signature instead of the appropriate preprocessor function signature.

Changes

  • Added selectedTab prop to EditorBar component to track whether main or preprocessor tab is active
  • Modified clearContent function to check if we're on the preprocessor tab and use the correct signature
  • Added getPreprocessorCode helper function that returns the appropriate preprocessor template for TypeScript/Deno/Bun and Python
  • Updated ScriptEditor to pass the selectedTab prop to EditorBar
  • Updated WorkspaceScriptPicker and PickHubScript type definitions to support 'preprocessor' kind

Test Plan

  1. Open a script editor with preprocessor support (TypeScript or Python)
  2. Switch to the preprocessor tab
  3. Click the reset button in the topbar
  4. Verify that the code resets to the preprocessor function signature (not the main function)
  5. Switch back to the main tab
  6. Click the reset button again
  7. Verify that the code resets to the main function signature

Fixes #6594

🤖 Generated with Claude Code

…ature

- Added selectedTab prop to EditorBar component to track active tab
- Modified clearContent function to use preprocessor signature when on preprocessor tab
- Added getPreprocessorCode helper function to return appropriate preprocessor template
- Updated ScriptEditor to pass selectedTab to EditorBar
- Updated WorkspaceScriptPicker and PickHubScript type definitions to support preprocessor kind

Fixes #6594

Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
Copy link

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: e60ffcb
Status: ✅  Deploy successful!
Preview URL: https://b5641471.windmill.pages.dev
Branch Preview URL: https://claude-issue-6594-20250911-2.windmill.pages.dev

View logs

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.

improve reset button for preprocessors
0 participants