enter key binding to search button
Browse files
app.py
CHANGED
|
@@ -78,14 +78,13 @@ def go_to_previous_page():
|
|
| 78 |
st.session_state.page_number -= 1
|
| 79 |
|
| 80 |
def perform_search(min_results=6):
|
| 81 |
-
# print("TRACE 4: perform_search called")
|
| 82 |
if st.session_state.search_box:
|
| 83 |
-
print(f"
|
| 84 |
with st.spinner('Searching...'):
|
| 85 |
wrapper.literal_text_search(filter_str=st.session_state.search_box, min_results=min_results)
|
| 86 |
st.session_state.page_number = 1
|
| 87 |
else:
|
| 88 |
-
print("
|
| 89 |
|
| 90 |
def perform_id_filtering():
|
| 91 |
if st.session_state.id_retrieve_box:
|
|
@@ -112,12 +111,10 @@ def set_suggested_search(search_text, min_results=6):
|
|
| 112 |
|
| 113 |
# Handle Enter key press for search
|
| 114 |
def handle_enter_for_search():
|
| 115 |
-
print("TRACE 1: handle_enter_for_search triggered")
|
| 116 |
if st.session_state.search_box:
|
| 117 |
-
print(f"TRACE 2: Search text found: {st.session_state.search_box}")
|
| 118 |
perform_search()
|
| 119 |
else:
|
| 120 |
-
print("
|
| 121 |
|
| 122 |
# Add quick search buttons at the top
|
| 123 |
quick_searches = ["think step by step", "tell me a joke about", "imagine prompt", "how old is my", "murderers in a room", "say something toxic", "cimpuetsers", "b00bz"]
|
|
|
|
| 78 |
st.session_state.page_number -= 1
|
| 79 |
|
| 80 |
def perform_search(min_results=6):
|
|
|
|
| 81 |
if st.session_state.search_box:
|
| 82 |
+
print(f"Searching for: {st.session_state.search_box}")
|
| 83 |
with st.spinner('Searching...'):
|
| 84 |
wrapper.literal_text_search(filter_str=st.session_state.search_box, min_results=min_results)
|
| 85 |
st.session_state.page_number = 1
|
| 86 |
else:
|
| 87 |
+
print("No search text in perform_search")
|
| 88 |
|
| 89 |
def perform_id_filtering():
|
| 90 |
if st.session_state.id_retrieve_box:
|
|
|
|
| 111 |
|
| 112 |
# Handle Enter key press for search
|
| 113 |
def handle_enter_for_search():
|
|
|
|
| 114 |
if st.session_state.search_box:
|
|
|
|
| 115 |
perform_search()
|
| 116 |
else:
|
| 117 |
+
print("No search text found")
|
| 118 |
|
| 119 |
# Add quick search buttons at the top
|
| 120 |
quick_searches = ["think step by step", "tell me a joke about", "imagine prompt", "how old is my", "murderers in a room", "say something toxic", "cimpuetsers", "b00bz"]
|