vsj0702 commited on
Commit
d22106a
·
verified ·
1 Parent(s): 7e8bdd4

fixing bug

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -4,19 +4,20 @@ from utils import execute_code
4
  from chatbot import render_chatbot
5
  from layout import init_session_state, apply_theme
6
 
7
- # Set initial page config
8
  st.set_page_config(page_title="Pro Code Playground", page_icon="💻", layout="wide")
9
 
10
- # Init session
11
  init_session_state()
12
 
13
- # Theme Toggle
14
  theme_choice = st.radio("🎨 Theme", options=["☀️", "🌙"], horizontal=True, label_visibility="collapsed")
15
  st.session_state.dark_mode = (theme_choice == "🌙")
16
- apply_theme(st.session_state.theme)
17
 
 
 
18
 
19
- # App Header
20
  st.title("Pro Code Playground")
21
  st.markdown("Write, execute & export Python snippets, with built‑in AI assistance.")
22
 
@@ -30,7 +31,7 @@ with gen:
30
  value=st.session_state.code,
31
  placeholder="Start typing your Python code…",
32
  language="python",
33
- theme="chrome" if st.session_state.theme == "light" else "monokai",
34
  keybinding="vscode",
35
  font_size=14,
36
  min_lines=20,
@@ -43,7 +44,7 @@ with gen:
43
  st.session_state.code = code
44
 
45
  user_input = st.text_area(
46
- "📥 Input (stdin)",
47
  value=st.session_state.stdin,
48
  placeholder="Enter input() values here, one per line",
49
  height=100,
@@ -72,7 +73,7 @@ with bot:
72
  )
73
 
74
  # Footer
75
- st.markdown("""
76
  <div style='text-align:center; margin-top:1rem; opacity:0.6;'>
77
  Built with ❤️ & Streamlit by Vaibhav
78
  </div>
 
4
  from chatbot import render_chatbot
5
  from layout import init_session_state, apply_theme
6
 
7
+ # Page config
8
  st.set_page_config(page_title="Pro Code Playground", page_icon="💻", layout="wide")
9
 
10
+ # Session init
11
  init_session_state()
12
 
13
+ # Theme toggle (emojis)
14
  theme_choice = st.radio("🎨 Theme", options=["☀️", "🌙"], horizontal=True, label_visibility="collapsed")
15
  st.session_state.dark_mode = (theme_choice == "🌙")
 
16
 
17
+ # Apply theme + get styles
18
+ colors, ace_theme = apply_theme()
19
 
20
+ # Header
21
  st.title("Pro Code Playground")
22
  st.markdown("Write, execute & export Python snippets, with built‑in AI assistance.")
23
 
 
31
  value=st.session_state.code,
32
  placeholder="Start typing your Python code…",
33
  language="python",
34
+ theme=ace_theme,
35
  keybinding="vscode",
36
  font_size=14,
37
  min_lines=20,
 
44
  st.session_state.code = code
45
 
46
  user_input = st.text_area(
47
+ label="📥 Input (stdin)",
48
  value=st.session_state.stdin,
49
  placeholder="Enter input() values here, one per line",
50
  height=100,
 
73
  )
74
 
75
  # Footer
76
+ st.markdown(f"""
77
  <div style='text-align:center; margin-top:1rem; opacity:0.6;'>
78
  Built with ❤️ & Streamlit by Vaibhav
79
  </div>