Skip to content

feat(frontends): stapp2 UI enhancements with modular stapp2_extensions#443

Open
SeveralMiles wants to merge 6 commits into
lsdefine:mainfrom
SeveralMiles:feature/stapp2
Open

feat(frontends): stapp2 UI enhancements with modular stapp2_extensions#443
SeveralMiles wants to merge 6 commits into
lsdefine:mainfrom
SeveralMiles:feature/stapp2

Conversation

@SeveralMiles
Copy link
Copy Markdown

Summary

  • Add Streamlit UI enhancements on top of upstream stapp2.py
  • Extract fork-specific logic into frontends/stapp2_extensions.py for easier review:
    • File upload + clipboard image paste
    • Attachment thumbnails and prompt building
    • Sidebar: force stop, desktop pet, reinject tools/history, autonomy (zh)
    • Compact uploader layout beside chat input
  • Keep stapp2.py closer to upstream; fold multi-turn **LLM Running (Turn N)** segments into expanders
  • Small launch.pyw robustness tweaks

Review guide

  1. stapp2_extensions.py — all new UI behavior (primary review)
  2. stapp2.py — integration hooks + turn expanders
  3. launch.pyw — launcher changes

Test plan

  • python -m streamlit run frontends/stapp2.py (or python launch.pyw)
  • Upload file + send message; attachments appear in prompt
  • Paste image into page; thumbnail shows and can be removed
  • Sidebar: LLM switch, force stop, reinject tools
  • Multi-turn responses: intermediate turns collapse in expanders

SeveralMiles and others added 6 commits May 20, 2026 14:57
- 保留文件上传/粘贴/缩略图删除功能
- 保留多轮推理中间步骤折叠功能
- 新增 stapp2_old.py 参考文件、start_streamlit.bat、test_files/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 将 ANTHROPIC_CSS 精简为仅 :root CSS 变量定义,移除暖棕背景/侧边栏/按钮覆盖,页面恢复 Streamlit 默认主题
- 恢复汉堡菜单可见(移除 #MainMenu display:none)
- 新增 st.title("🖥️ Cowork") 与 Origin stapp.py 保持一致
- 重写 render_sidebar():新增强行停止、重新注入工具、桌面宠物、自主行动区等按钮,LLM 选择框改为 collapsed 标签
- launch.pyw:切换至 stapp2.py,启动等待从 2s 升至 5s,idle_monitor 首次等待延长至 12s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- FILE_UPLOAD_CSS: replace broken .input-row-container rule with :has() selector
  to pin upload column at 54px and fill remainder with chat input,
  fixing the upload button stacking on top of input in the 600px webview window
- launch.pyw: initialize window=None at module level so idle_monitor guard
  short-circuits cleanly before webview.create_window() is called; add
  diagnostic prints + try/except around webview.start() to surface errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Move attachment upload, paste-to-upload, sidebar controls, and compact uploader layout into stapp2_extensions.py so stapp2.py stays closer to upstream and PR review is easier.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant