Ankushbl6 commited on
Commit
ca9da45
·
verified ·
1 Parent(s): e082ab0

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +8 -9
src/streamlit_app.py CHANGED
@@ -293,19 +293,18 @@ with col2:
293
  else:
294
  num_items = st.session_state.num_line_items[selected_name]
295
 
296
- line_col1, line_col2 = st.columns([2, 1])
 
297
  with line_col1:
298
  line_item_options = [f"Line {i+1}" for i in range(num_items)]
299
  selected_line_item = st.selectbox("Line", line_item_options, label_visibility="collapsed")
300
  line_item_num = int(selected_line_item.split()[1])
301
 
302
- with line_col2:
303
- add_col, rem_col = st.columns(2)
304
- with add_col:
305
- st.button("➕", key=f"addli_{selected_name}", on_click=add_line_item, help="Add line item")
306
- with rem_col:
307
- if st.session_state.num_line_items[selected_name] > 1:
308
- st.button("➖", key=f"remli_{selected_name}", on_click=remove_line_item, help="Remove line item")
309
 
310
  base_field = st.selectbox("Field", LINE_ITEM_FIELDS, label_visibility="collapsed")
311
  display_field_name = f"{selected_line_item}: {base_field}"
@@ -558,4 +557,4 @@ with col1:
558
  else:
559
  st.toast(f"✅ Rectangle saved (no text detected)")
560
  except Exception:
561
- st.toast(f"✅ Rectangle saved")
 
293
  else:
294
  num_items = st.session_state.num_line_items[selected_name]
295
 
296
+ # FLATTENED COLUMNS: no nested columns beyond one level inside col2
297
+ line_col1, add_col, rem_col = st.columns([2, 1, 1])
298
  with line_col1:
299
  line_item_options = [f"Line {i+1}" for i in range(num_items)]
300
  selected_line_item = st.selectbox("Line", line_item_options, label_visibility="collapsed")
301
  line_item_num = int(selected_line_item.split()[1])
302
 
303
+ with add_col:
304
+ st.button("➕", key=f"addli_{selected_name}", on_click=add_line_item, help="Add line item")
305
+ with rem_col:
306
+ if st.session_state.num_line_items[selected_name] > 1:
307
+ st.button("➖", key=f"remli_{selected_name}", on_click=remove_line_item, help="Remove line item")
 
 
308
 
309
  base_field = st.selectbox("Field", LINE_ITEM_FIELDS, label_visibility="collapsed")
310
  display_field_name = f"{selected_line_item}: {base_field}"
 
557
  else:
558
  st.toast(f"✅ Rectangle saved (no text detected)")
559
  except Exception:
560
+ st.toast(f"✅ Rectangle saved")