mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-24 18:50:15 +00:00
33a145a669
## Release v0.50.240 Batch release of 13 PRs that passed full triage + code review + test suite (3199 tests, 0 failures). --- ### Added - **Compact tool activity mode** (`simplified_tool_calling`, default on) — groups tool calls and thinking traces into a single collapsed "Activity" disclosure card per assistant turn. Also adds a new **Calm Console** theme with earth/slate palette and serif prose. @Michaelyklam — #1282 - **PDF first-page preview** — `MEDIA:` `.pdf` files render a canvas thumbnail via PDF.js CDN (4 MB cap). **HTML sandbox iframe** — `.html`/`.htm` files render inline in a sandboxed `<iframe srcdoc>` (256 KB cap). 10 i18n keys × 7 locales. @bergeouss — #1280, closes #480 #482 - **Inline Excalidraw diagram preview** — `.excalidraw` files render as pure SVG (no external deps; rectangles, ellipses, diamonds, text, lines, arrows, freehand; 512 KB cap). @bergeouss — #1279, closes #479 - **Inline CSV table rendering** — fenced `csv` blocks and `MEDIA:` CSV files render as scrollable HTML tables with auto-separator detection. @bergeouss — #1277, closes #485 - **Inline SVG, audio, and video rendering** — SVG as `<img>`, audio as `<audio controls>`, video as `<video controls>`. @bergeouss — #1276, closes #481 - **Batch session select mode** — multi-select sessions for bulk Archive/Delete/Move. 11 i18n keys × 7 locales. @bergeouss — #1275, closes #568 - **Collapsible skill category headers** — click to collapse/expand without re-render; state persists across filter cycles. @bergeouss — #1281 - **`providers.only_configured` setting** — opt-in flag to restrict the model picker to explicitly configured providers. @KingBoyAndGirl — #1268 - **OpenCode Go model catalog** — adds Kimi K2.6, DeepSeek V4 Pro/Flash, MiMo V2.5/Pro, Qwen3.6/3.5 Plus. @nesquena-hermes — #1284, closes #1269 ### Fixed - **Profile `TERMINAL_CWD` TypeError** — `_build_agent_thread_env()` helper merges env before `_set_thread_env()` call. @hi-friday — #1266 - **Service worker subpath cache bypass** — regex now matches `/api/*` under any mount prefix. @Michaelyklam — #1278 - **SSE client disconnect leaks** — `TimeoutError`/`OSError` treated as clean disconnects; server backlog 64, threads daemonized; session list renders before saved-session restore. @KayZz69 — #1267 - **i18n locale corrections** — Korean MCP strings (23), Chinese MCP strings (23), zh-Hant missing keys (41), de missing keys (229). @bergeouss — #1274, closes #1273 --- ### Test results ``` 3199 passed, 2 skipped, 3 xpassed in 72.79s ``` ### PRs on hold (not included) #1265 (draft), #1271 (superseded by #1266), #1272 (skipped XSS tests), #1232 (partial test run), #1222 (review questions open), #1134 (live-server tests), #1132 (superseded by #1134), #1108 (negative UX review), #1084 (empty description)
153 lines
5.6 KiB
Python
153 lines
5.6 KiB
Python
"""Test: session batch select mode functions exist in sessions.js (#568)"""
|
|
import re
|
|
|
|
|
|
def test_batch_select_state_variables():
|
|
"""Verify batch select state variables are declared."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
assert '_sessionSelectMode' in src, "Missing _sessionSelectMode variable"
|
|
assert '_selectedSessions' in src, "Missing _selectedSessions variable"
|
|
assert 'new Set()' in src, "Selected sessions should use Set"
|
|
|
|
|
|
def test_batch_select_functions_exist():
|
|
"""Verify all batch select functions are defined."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
required_funcs = [
|
|
'toggleSessionSelectMode',
|
|
'exitSessionSelectMode',
|
|
'toggleSessionSelect',
|
|
'selectAllSessions',
|
|
'deselectAllSessions',
|
|
'_updateBatchActionBar',
|
|
'_renderBatchActionBar',
|
|
'_showBatchProjectPicker',
|
|
]
|
|
for fn in required_funcs:
|
|
assert f'function {fn}(' in src, f"Missing function: {fn}"
|
|
|
|
|
|
def test_batch_select_checkbox_rendering():
|
|
"""Verify checkbox is rendered when in select mode."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
assert 'session-select-cb' in src, "Missing session-select-cb class"
|
|
assert 'session-select-cb-wrapper' in src, "Missing session-select-cb-wrapper class"
|
|
assert "cb.type='checkbox'" in src, "Checkbox should be type checkbox"
|
|
|
|
|
|
def test_batch_select_intercepts_navigation():
|
|
"""Verify select mode intercepts session navigation."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
assert "_sessionSelectMode" in src
|
|
# Should have early return when in select mode
|
|
assert 'toggleSessionSelect(s.session_id)' in src, \
|
|
"Pointerup handler should call toggleSessionSelect in select mode"
|
|
|
|
|
|
def test_batch_select_escape_handler():
|
|
"""Verify Escape key exits select mode."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
assert "e.key==='Escape'&&_sessionSelectMode" in src, \
|
|
"Should have Escape key handler for select mode"
|
|
|
|
|
|
def test_batch_select_toggle_button():
|
|
"""Verify select mode toggle button is rendered."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
assert 'session-select-toggle' in src, "Missing session-select-toggle class"
|
|
assert 'toggleSessionSelectMode' in src, "Missing toggleSessionSelectMode call"
|
|
|
|
|
|
def test_batch_select_bar_element():
|
|
"""Verify batch action bar DOM element is created."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
assert 'batchActionBar' in src, "Missing batchActionBar element"
|
|
assert 'batch-action-bar' in src, "Missing batch-action-bar CSS class"
|
|
assert 'batch-action-btn' in src, "Missing batch-action-btn class"
|
|
|
|
|
|
def test_batch_select_i18n_keys():
|
|
"""Verify all batch select i18n keys exist in all locales."""
|
|
with open('static/i18n.js') as f:
|
|
src = f.read()
|
|
required_keys = [
|
|
'session_select_mode',
|
|
'session_select_mode_desc',
|
|
'session_select_all',
|
|
'session_deselect_all',
|
|
'session_selected_count',
|
|
'session_batch_archive',
|
|
'session_batch_delete',
|
|
'session_batch_move',
|
|
'session_batch_delete_confirm',
|
|
'session_batch_archive_confirm',
|
|
'session_no_selection',
|
|
]
|
|
locales = ['en', 'ru', 'es', 'de', 'zh', 'zh-Hant', 'ko']
|
|
for key in required_keys:
|
|
for locale in locales:
|
|
# Check if the key exists in the locale block
|
|
if locale == 'zh-Hant':
|
|
pattern = rf"'{locale}'\s*:.*?{key}"
|
|
else:
|
|
pattern = rf"{locale}\s*:.*?{key}"
|
|
# Simpler check: just verify the key string with colon exists
|
|
assert f"{key}:" in src, f"Missing i18n key '{key}' in i18n.js"
|
|
# Count occurrences - each key should appear in all 7 locales
|
|
for key in required_keys:
|
|
count = src.count(f"{key}:")
|
|
assert count == 7, f"Key '{key}' found {count} times, expected 7 (one per locale)"
|
|
|
|
|
|
def test_batch_select_css_exists():
|
|
"""Verify batch select CSS classes are defined."""
|
|
with open('static/style.css') as f:
|
|
src = f.read()
|
|
required_classes = [
|
|
'session-select-toggle',
|
|
'session-select-bar',
|
|
'batch-exit-btn',
|
|
'batch-select-all-btn',
|
|
'session-select-cb-wrapper',
|
|
'session-select-cb',
|
|
'session-item.selected',
|
|
'batch-action-bar',
|
|
'batch-count',
|
|
'batch-action-btn',
|
|
'batch-action-btn-danger',
|
|
]
|
|
for cls in required_classes:
|
|
assert cls in src, f"Missing CSS class: .{cls}"
|
|
|
|
|
|
def test_batch_select_mode_flags():
|
|
"""Verify select mode properly toggles state."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
# toggleSessionSelectMode should flip the flag
|
|
assert '_sessionSelectMode=!_sessionSelectMode' in src, \
|
|
"toggleSessionSelectMode should flip _sessionSelectMode"
|
|
# exitSessionSelectMode should clear state
|
|
assert '_sessionSelectMode=false' in src, \
|
|
"exitSessionSelectMode should set _sessionSelectMode=false"
|
|
assert '_selectedSessions.clear()' in src, \
|
|
"Exit should clear selected sessions"
|
|
|
|
|
|
def test_batch_delete_uses_confirm_dialog():
|
|
"""Verify batch delete shows confirmation dialog."""
|
|
with open('static/sessions.js') as f:
|
|
src = f.read()
|
|
# The delete handler should call showConfirmDialog with batch message
|
|
assert "session_batch_delete_confirm" in src, \
|
|
"Batch delete should use session_batch_delete_confirm i18n key"
|
|
assert "showConfirmDialog" in src, \
|
|
"Should use showConfirmDialog for batch operations"
|