Repository: marimo-team/marimo

Issue:
Find and replace does not allow for replace with empty string
### Describe the bug

Find and replace - does not allow for replace with empty string

### Environment
  "marimo": "0.10.15",

### Code to reproduce

_No response_

Hints from issue comments:

Solution patch:
diff --git a/frontend/src/components/find-replace/find-replace.tsx b/frontend/src/components/find-replace/find-replace.tsx
index 63e892ef..9fbd0c7f 100644
--- a/frontend/src/components/find-replace/find-replace.tsx
+++ b/frontend/src/components/find-replace/find-replace.tsx
@@ -56,6 +56,12 @@ export const FindReplace: React.FC = () => {
     return openFindReplacePanel();
   });
 
+  const resetMatches = () => {
+    const matches = getMatches();
+    // False count means an invalid regex
+    setMatches(matches === false ? undefined : matches);
+  };
+
   useEffect(() => {
     if (state.isOpen && findInputRef.current) {
       findInputRef.current.focus(); // Focus the input
@@ -75,9 +81,7 @@ export const FindReplace: React.FC = () => {
       return;
     }
 
-    const matches = getMatches();
-    // False count means an invalid regex
-    setMatches(matches === false ? undefined : matches);
+    resetMatches();
     setGlobalSearchQuery();
   }, [
     // Re-search when any of these change
@@ -205,8 +209,10 @@ export const FindReplace: React.FC = () => {
                 size="xs"
                 variant="outline"
                 className="h-6 text-xs"
-                onClick={() => replaceNext()}
-                disabled={state.findText === "" || state.replaceText === ""}
+                onClick={() => {
+                  replaceNext() && resetMatches();
+                }}
+                disabled={state.findText === ""}
               >
                 Replace Next
               </Button>
@@ -220,6 +226,7 @@ export const FindReplace: React.FC = () => {
                   if (!undo) {
                     return;
                   }
+                  resetMatches();
 
                   // Show toast with undo button
                   const { dismiss } = toast({
@@ -235,7 +242,7 @@ export const FindReplace: React.FC = () => {
                     ),
                   });
                 }}
-                disabled={state.findText === "" || state.replaceText === ""}
+                disabled={state.findText === ""}
               >
                 Replace All
               </Button>
diff --git a/marimo/_cli/envinfo.py b/marimo/_cli/envinfo.py
index dda87c5b..d471bff8 100644
--- a/marimo/_cli/envinfo.py
+++ b/marimo/_cli/envinfo.py
@@ -5,7 +5,8 @@ import platform
 import sys
 from typing import Any, Union, cast
 
-from marimo import __version__
+from marimo import __version__, _loggers
+from marimo._config.manager import get_default_config_manager
 from marimo._utils.health import (
     get_chrome_version,
     get_node_version,
@@ -13,6 +14,8 @@ from marimo._utils.health import (
     get_required_modules_list,
 )
 
+LOGGER = _loggers.marimo_logger()
+
 
 def is_win11() -> bool:
     """
@@ -26,7 +29,19 @@ def is_win11() -> bool:
     return False
 
 
-def get_system_info() -> dict[str, Union[str, dict[str, str]]]:
+def get_experimental_flags() -> dict[str, bool]:
+    try:
+        config = get_default_config_manager(current_path=None).get_config()
+        if "experimental" in config:
+            return config["experimental"]
+        else:
+            return {}
+    except Exception:
+        LOGGER.error("Failed to get experimental flags")
+        return {}
+
+
+def get_system_info() -> dict[str, Union[str, dict[str, Any]]]:
     os_version = platform.release()
     if platform.system() == "Windows" and is_win11():
         os_version = "11"
@@ -49,10 +64,11 @@ def get_system_info() -> dict[str, Union[str, dict[str, str]]]:
 
     requirements = get_required_modules_list()
     optional_deps = get_optional_modules_list()
-
+    experimental = get_experimental_flags()
     return {
         **info,
         "Binaries": binaries,
         "Dependencies": requirements,
         "Optional Dependencies": optional_deps,
+        "Experimental Flags": experimental,
     }


Test patch:
diff --git a/tests/_cli/test_envinfo.py b/tests/_cli/test_envinfo.py
index da1816a8..66651ebd 100644
--- a/tests/_cli/test_envinfo.py
+++ b/tests/_cli/test_envinfo.py
@@ -1,4 +1,6 @@
 # Copyright 2024 Marimo. All rights reserved.
+from __future__ import annotations
+
 from marimo._cli.envinfo import (
     get_system_info,
 )
@@ -34,3 +36,4 @@ def test_get_system_info() -> None:
     assert "Python Version" in system_info
     assert "Binaries" in system_info
     assert "Dependencies" in system_info
+    assert "Experimental Flags" in system_info