zaid646 commited on
Commit
0fa978f
·
1 Parent(s): 05ca0fc

Show full prompt text on sample buttons; add .huggingface/metadata; add HF badge to README

Browse files
Files changed (3) hide show
  1. .huggingface/metadata +7 -0
  2. README.md +1 -9
  3. app.py +12 -6
.huggingface/metadata ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ title: Agentic Coding Sandbox
2
+ emoji: ⚡
3
+ colorFrom: indigo
4
+ colorTo: purple
5
+ sdk: docker
6
+ pinned: false
7
+ app_file: app.py
README.md CHANGED
@@ -1,12 +1,4 @@
1
- ---
2
- title: Agentic Coding Sandbox
3
- emoji: ⚡
4
- colorFrom: indigo
5
- colorTo: purple
6
- sdk: docker
7
- pinned: false
8
- app_file: app.py
9
- ---
10
 
11
  # Agentic Coding Sandbox
12
 
 
1
+ [![Hugging Face Space](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Live%20Demo-blue)](https://zaid646-agentic-coding-sandbox.hf.space)
 
 
 
 
 
 
 
 
2
 
3
  # Agentic Coding Sandbox
4
 
app.py CHANGED
@@ -96,11 +96,17 @@ PRESET_PROMPTS = [
96
  "Plot a sine wave and a cosine wave on the same chart using matplotlib, add a legend, and save it to /tmp/waves.png.",
97
  ]
98
 
99
- cols = st.columns(len(PRESET_PROMPTS))
100
- for i, (col, p) in enumerate(zip(cols, PRESET_PROMPTS)):
101
- with col:
102
- if st.button(f"Prompt {i + 1}", use_container_width=True, type="secondary"):
 
 
 
 
 
 
 
 
103
  st.session_state.prompt_input = p
104
  st.rerun()
105
- if st.session_state.get("prompt_input") == p:
106
- st.caption("selected")
 
96
  "Plot a sine wave and a cosine wave on the same chart using matplotlib, add a legend, and save it to /tmp/waves.png.",
97
  ]
98
 
99
+ for i, p in enumerate(PRESET_PROMPTS):
100
+ is_selected = st.session_state.get("prompt_input") == p
101
+ border = "1px solid #6366f1" if is_selected else "1px solid #e2e8f0"
102
+ st.markdown(
103
+ f"<div style='border:{border};border-radius:8px;padding:12px 16px;margin-bottom:8px;display:flex;align-items:center;justify-content:space-between;'>"
104
+ f"<span style='font-size:14px;flex:1;margin-right:12px;'>{p}</span>"
105
+ f"</div>",
106
+ unsafe_allow_html=True,
107
+ )
108
+ use_col1, use_col2, _ = st.columns([1, 1, 4])
109
+ with use_col1:
110
+ if st.button("Use this prompt", key=f"use_prompt_{i}", use_container_width=True):
111
  st.session_state.prompt_input = p
112
  st.rerun()