Marc-Alexandre Côté commited on
Commit
e110d82
1 Parent(s): 4930b0c

Moving action box around

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -59,7 +59,7 @@ with st.sidebar:
59
  if infos['score'] == 100:
60
  valid_actions = ["", "reset"]
61
 
62
- act = st.selectbox('Action:', options=valid_actions, index=0, on_change=step, key="action")
63
 
64
  for act, obs in history:
65
  if act:
@@ -68,7 +68,6 @@ for act, obs in history:
68
  if obs:
69
  st.info(obs.replace('\n\t', '\n- '))
70
 
71
-
72
  if infos['score'] == 100:
73
  with st.sidebar:
74
  st.balloons()
@@ -76,14 +75,16 @@ if infos['score'] == 100:
76
  st.success("Congratulations! You have completed the task.")
77
 
78
 
 
 
79
 
80
- # Auto scroll at the bottom of the page.
81
- components.html(
82
- f"""
83
- <p>{st.session_state.obs}</p>
84
- <script>
85
- window.parent.document.querySelector('section.main').scrollTo(0, window.parent.document.querySelector('section.main').scrollHeight);
86
- </script>
87
- """,
88
- height=0
89
- )
 
59
  if infos['score'] == 100:
60
  valid_actions = ["", "reset"]
61
 
62
+ #act = st.selectbox('Action:', options=valid_actions, index=0, on_change=step, key="action")
63
 
64
  for act, obs in history:
65
  if act:
 
68
  if obs:
69
  st.info(obs.replace('\n\t', '\n- '))
70
 
 
71
  if infos['score'] == 100:
72
  with st.sidebar:
73
  st.balloons()
 
75
  st.success("Congratulations! You have completed the task.")
76
 
77
 
78
+ act = st.selectbox('Action:', options=valid_actions, index=0, on_change=step, key="action")
79
+
80
 
81
+ # # Auto scroll at the bottom of the page.
82
+ # components.html(
83
+ # f"""
84
+ # <p>{st.session_state.obs}</p>
85
+ # <script>
86
+ # window.parent.document.querySelector('section.main').scrollTo(0, window.parent.document.querySelector('section.main').scrollHeight);
87
+ # </script>
88
+ # """,
89
+ # height=0
90
+ # )