vsj0702 commited on
Commit
36e1e5a
Β·
verified Β·
1 Parent(s): 2fbce83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -20
app.py CHANGED
@@ -3,7 +3,6 @@ from layout import init_session_state, apply_theme
3
  from code_editor import render_code_editor
4
  from chatbot import render_chatbot
5
 
6
- # ── Page Config ──────────────────────────────
7
  st.set_page_config(
8
  page_title="Pro Code Playground",
9
  page_icon="πŸ’»",
@@ -11,37 +10,23 @@ st.set_page_config(
11
  )
12
  init_session_state()
13
 
14
- # ── Header ───────────────────────────────────
15
  st.title("Pro Code Playground")
16
  st.markdown("Write, execute & export multi-language snippets, with built‑in AI assistance.")
17
 
18
- # ── Language & Theme Selection ───────────────
19
- lang_col, _, theme_col = st.columns([3, 6, 1])
20
-
21
- with lang_col:
22
- selected_lang = st.selectbox(
23
- "Language",
24
- ["Python", "C", "C++", "Java", "JavaScript", "C#"],
25
- index=0
26
- )
27
-
28
  with theme_col:
29
- is_dark = st.session_state.dark_mode
30
- toggle = st.button("πŸŒ™ Dark Mode" if not is_dark else "β˜€οΈ Light Mode")
31
- if toggle:
32
  st.session_state.dark_mode = not st.session_state.dark_mode
33
  st.rerun()
34
 
35
- # ── Theme Colors ─────────────────────────────
36
  colors, ace_theme = apply_theme()
37
 
38
- # ── Main Layout: Editor (2/3) + Chatbot (1/3) ─
39
  editor_col, assistant_col = st.columns((2, 1), gap="large")
40
 
41
  with editor_col:
42
  st.subheader("Editor")
43
- editor_key = f"editor_{selected_lang}"
44
- render_code_editor(selected_lang, ace_theme, editor_key)
45
 
46
  with assistant_col:
47
  st.subheader("Code Assistant")
@@ -51,7 +36,6 @@ with assistant_col:
51
  st.session_state.get("error_output", "")
52
  )
53
 
54
- # ── Footer ───────────────────────────────────
55
  st.markdown("""
56
  <div style='text-align:center; margin-top:1rem; opacity:0.6;'>
57
  Built with ❀️ & Streamlit by Vaibhav
 
3
  from code_editor import render_code_editor
4
  from chatbot import render_chatbot
5
 
 
6
  st.set_page_config(
7
  page_title="Pro Code Playground",
8
  page_icon="πŸ’»",
 
10
  )
11
  init_session_state()
12
 
 
13
  st.title("Pro Code Playground")
14
  st.markdown("Write, execute & export multi-language snippets, with built‑in AI assistance.")
15
 
16
+ # Theme toggle only
17
+ _, _, theme_col = st.columns([3, 6, 1])
 
 
 
 
 
 
 
 
18
  with theme_col:
19
+ if st.button("πŸŒ™ Dark Mode" if not st.session_state.dark_mode else "β˜€οΈ Light Mode"):
 
 
20
  st.session_state.dark_mode = not st.session_state.dark_mode
21
  st.rerun()
22
 
 
23
  colors, ace_theme = apply_theme()
24
 
 
25
  editor_col, assistant_col = st.columns((2, 1), gap="large")
26
 
27
  with editor_col:
28
  st.subheader("Editor")
29
+ render_code_editor(ace_theme)
 
30
 
31
  with assistant_col:
32
  st.subheader("Code Assistant")
 
36
  st.session_state.get("error_output", "")
37
  )
38
 
 
39
  st.markdown("""
40
  <div style='text-align:center; margin-top:1rem; opacity:0.6;'>
41
  Built with ❀️ & Streamlit by Vaibhav