Spaces:
Sleeping
Sleeping
[FIX] app.py: initialize all methods as disabled, let tab2 sync re-activate them
Browse files
app.py
CHANGED
|
@@ -110,18 +110,15 @@ if "auto_disabled_methods" not in st.session_state:
|
|
| 110 |
st.session_state.auto_disabled_methods = set()
|
| 111 |
for m in method_order:
|
| 112 |
if m not in st.session_state.constraints:
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
]
|
| 117 |
-
all_hidden = bool(primary) and all(r in hidden_resource_names for r in primary)
|
| 118 |
st.session_state.constraints[m] = {
|
| 119 |
-
"active":
|
| 120 |
"cap_type": "percent",
|
| 121 |
"cap_value": 100,
|
| 122 |
}
|
| 123 |
-
|
| 124 |
-
st.session_state.auto_disabled_methods.add(m)
|
| 125 |
_expected_methods = set(cost_sliders.keys())
|
| 126 |
_current_methods = set(st.session_state.get("costs", {}).keys())
|
| 127 |
if "costs" not in st.session_state or st.session_state.costs == {} or _expected_methods != _current_methods:
|
|
|
|
| 110 |
st.session_state.auto_disabled_methods = set()
|
| 111 |
for m in method_order:
|
| 112 |
if m not in st.session_state.constraints:
|
| 113 |
+
# All methods start disabled; tab2 pre-render sync auto-activates each
|
| 114 |
+
# method once all its required resources are available (standard > 0 and
|
| 115 |
+
# hidden resources covered by a custom batch).
|
|
|
|
|
|
|
| 116 |
st.session_state.constraints[m] = {
|
| 117 |
+
"active": False,
|
| 118 |
"cap_type": "percent",
|
| 119 |
"cap_value": 100,
|
| 120 |
}
|
| 121 |
+
st.session_state.auto_disabled_methods.add(m)
|
|
|
|
| 122 |
_expected_methods = set(cost_sliders.keys())
|
| 123 |
_current_methods = set(st.session_state.get("costs", {}).keys())
|
| 124 |
if "costs" not in st.session_state or st.session_state.costs == {} or _expected_methods != _current_methods:
|