E5K7 commited on
Commit
8a2e574
Β·
1 Parent(s): 35c8868

🧹 UI: Remove sidebar completely for cleaner interface

Browse files

- Options and configuration moved entirely to environment variables (.env)
- Set default model to glm-5
- Simplified frontend layout

Files changed (3) hide show
  1. .env.example +2 -2
  2. app.py +2 -79
  3. backend/config.py +1 -1
.env.example CHANGED
@@ -8,8 +8,8 @@ GLM_API_KEY=your_glm_api_key_here
8
  # Generate at: https://github.com/settings/tokens
9
  GITHUB_TOKEN=your_github_token_here
10
 
11
- # GLM Model (options: glm-5-plus, glm-4-plus, glm-4)
12
- GLM_MODEL=glm-5-plus
13
 
14
  # GLM API Base URL
15
  GLM_BASE_URL=https://open.bigmodel.cn/api/paas/v4
 
8
  # Generate at: https://github.com/settings/tokens
9
  GITHUB_TOKEN=your_github_token_here
10
 
11
+ # GLM Model (options: glm-5, glm-5.1, glm-5-plus)
12
+ GLM_MODEL=glm-5
13
 
14
  # GLM API Base URL
15
  GLM_BASE_URL=https://open.bigmodel.cn/api/paas/v4
app.py CHANGED
@@ -27,7 +27,7 @@ st.set_page_config(
27
  page_title="FixFlow β€” Autonomous Bug Resolution Agent",
28
  page_icon="πŸ”§",
29
  layout="wide",
30
- initial_sidebar_state="expanded",
31
  )
32
 
33
 
@@ -391,7 +391,7 @@ def init_session():
391
  "glm_api_key": GLM_API_KEY,
392
  "github_token": GITHUB_TOKEN,
393
  "model": GLM_MODEL,
394
- "run_confidence": False,
395
  }
396
  for k, v in defaults.items():
397
  if k not in st.session_state:
@@ -400,84 +400,7 @@ def init_session():
400
  init_session()
401
 
402
 
403
- # ── Sidebar ───────────────────────────────────────────────────────────────────
404
- with st.sidebar:
405
- st.markdown('<div class="sidebar-logo">πŸ”§ FixFlow</div>', unsafe_allow_html=True)
406
- st.markdown('<div style="color: #6b7280; font-size: 0.8rem; margin-bottom: 1.5rem;">Autonomous Bug Resolution Agent</div>', unsafe_allow_html=True)
407
 
408
- st.markdown('<div class="sidebar-section-title">πŸ”‘ API Configuration</div>', unsafe_allow_html=True)
409
-
410
- glm_key = st.text_input(
411
- "GLM API Key (Z.ai)",
412
- value=st.session_state.glm_api_key,
413
- type="password",
414
- placeholder="Enter your Z.ai GLM API key...",
415
- help="Get your key at https://open.bigmodel.cn/",
416
- key="glm_key_input",
417
- )
418
- if glm_key:
419
- st.session_state.glm_api_key = glm_key
420
-
421
- github_token = st.text_input(
422
- "GitHub Token (optional)",
423
- value=st.session_state.github_token,
424
- type="password",
425
- placeholder="ghp_... (for private repos / higher limits)",
426
- help="Needed for private repos. Also increases rate limit from 60 to 5000 req/hr.",
427
- key="github_token_input",
428
- )
429
- if github_token:
430
- st.session_state.github_token = github_token
431
-
432
- st.markdown('<div class="sidebar-section-title">βš™οΈ Model Settings</div>', unsafe_allow_html=True)
433
-
434
- model_choice = st.selectbox(
435
- "GLM Model",
436
- options=["glm-5", "glm-5.1", "glm-5-plus", "glm-4-plus", "glm-4"],
437
- index=0,
438
- key="model_select",
439
- )
440
- st.session_state.model = model_choice
441
-
442
- st.markdown('<div class="sidebar-section-title">πŸ§ͺ Options</div>', unsafe_allow_html=True)
443
-
444
- run_confidence = st.checkbox(
445
- "Run confidence self-evaluation",
446
- value=st.session_state.run_confidence,
447
- help="Ask GLM to rate confidence in its own analysis (adds ~10-15s)",
448
- key="confidence_check",
449
- )
450
- st.session_state.run_confidence = run_confidence
451
-
452
- # Rate limit info
453
- if st.session_state.github_token:
454
- st.markdown('<div class="sidebar-section-title">πŸ“Š GitHub Status</div>', unsafe_allow_html=True)
455
- try:
456
- gh_temp = GitHubClient(token=st.session_state.github_token)
457
- rl = gh_temp.get_rate_limit_info()
458
- if rl:
459
- remaining = rl.get("core_remaining", "?")
460
- limit = rl.get("core_limit", "?")
461
- pct = int(remaining / limit * 100) if isinstance(remaining, int) and isinstance(limit, int) else 0
462
- color = "#10b981" if pct > 50 else "#f59e0b" if pct > 20 else "#ef4444"
463
- st.markdown(
464
- f'<div style="font-size:0.8rem; color: {color};">API: {remaining}/{limit} requests remaining</div>',
465
- unsafe_allow_html=True
466
- )
467
- except Exception:
468
- pass
469
-
470
- st.markdown("---")
471
- st.markdown(
472
- '<div style="font-size: 0.72rem; color: #4b5563; line-height: 1.6;">'
473
- 'πŸ”’ Your API keys are never stored or transmitted beyond direct API calls.<br><br>'
474
- '⚑ Powered by <b style="color: #a78bfa;">GLM 5.1 by Z.ai</b>'
475
- '</div>',
476
- unsafe_allow_html=True
477
- )
478
-
479
-
480
- # ── Main Content ──────────────────────────────────────────────────────────────
481
 
482
  # Header
483
  st.markdown("""
 
27
  page_title="FixFlow β€” Autonomous Bug Resolution Agent",
28
  page_icon="πŸ”§",
29
  layout="wide",
30
+ initial_sidebar_state="collapsed",
31
  )
32
 
33
 
 
391
  "glm_api_key": GLM_API_KEY,
392
  "github_token": GITHUB_TOKEN,
393
  "model": GLM_MODEL,
394
+ "run_confidence": True,
395
  }
396
  for k, v in defaults.items():
397
  if k not in st.session_state:
 
400
  init_session()
401
 
402
 
 
 
 
 
403
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
 
405
  # Header
406
  st.markdown("""
backend/config.py CHANGED
@@ -10,7 +10,7 @@ load_dotenv()
10
  # ── LLM Config ──────────────────────────────────────────────────────────────
11
  GLM_API_KEY: str = os.getenv("GLM_API_KEY", "")
12
  GLM_BASE_URL: str = os.getenv("GLM_BASE_URL", "https://open.bigmodel.cn/api/paas/v4")
13
- GLM_MODEL: str = os.getenv("GLM_MODEL", "glm-5-plus")
14
 
15
  # ── GitHub Config ────────────────────────────────────────────────────────────
16
  GITHUB_TOKEN: str = os.getenv("GITHUB_TOKEN", "")
 
10
  # ── LLM Config ──────────────────────────────────────────────────────────────
11
  GLM_API_KEY: str = os.getenv("GLM_API_KEY", "")
12
  GLM_BASE_URL: str = os.getenv("GLM_BASE_URL", "https://open.bigmodel.cn/api/paas/v4")
13
+ GLM_MODEL: str = os.getenv("GLM_MODEL", "glm-5")
14
 
15
  # ── GitHub Config ────────────────────────────────────────────────────────────
16
  GITHUB_TOKEN: str = os.getenv("GITHUB_TOKEN", "")