From 74dd613b1d06e485a0ff88b11b15961ad5d9a40b Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Sat, 4 Apr 2026 14:29:24 -0700 Subject: [PATCH] fix: two issues found in post-merge review of PRs #82 #83 (#84) - routes.py /api/git-info: get_session raises KeyError on miss, does not return None -- wrap in try/except KeyError to correctly return 404 (PR #82, api/routes.py line 222) - style.css ctx-bar used undefined --teal CSS variable -- replaced with --blue which is defined in :root and fits the existing color palette (PR #83, static/style.css) Co-authored-by: Nathan Esquenazi --- api/routes.py | 5 +++-- static/style.css | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/routes.py b/api/routes.py index 115cb34..87737f8 100644 --- a/api/routes.py +++ b/api/routes.py @@ -219,8 +219,9 @@ def handle_get(handler, parsed): sid = qs.get('session_id', [''])[0] if not sid: return bad(handler, 'session_id required') - s = get_session(sid) - if not s: + try: + s = get_session(sid) + except KeyError: return bad(handler, 'Session not found', 404) from api.workspace import git_info_for_workspace info = git_info_for_workspace(Path(s.workspace)) diff --git a/static/style.css b/static/style.css index f6d0afb..d75e51b 100644 --- a/static/style.css +++ b/static/style.css @@ -192,7 +192,7 @@ /* Context usage indicator */ .ctx-indicator{display:flex;align-items:center;gap:6px;padding:2px 4px;flex-shrink:1;min-width:0;} .ctx-bar-wrap{width:70px;height:5px;border-radius:3px;background:rgba(255,255,255,.08);overflow:hidden;flex-shrink:0;} - .ctx-bar{display:block;height:100%;border-radius:3px;transition:width .4s ease,background .4s ease;min-width:2px;background:var(--teal);} + .ctx-bar{display:block;height:100%;border-radius:3px;transition:width .4s ease,background .4s ease;min-width:2px;background:var(--blue);} .ctx-bar.ctx-mid{background:#e6a817;} .ctx-bar.ctx-high{background:#e05252;} .ctx-label{font-size:9px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums;}