* feat(gateway): full settings page polish with all tiers
- Backend: add ActiveConfigSnapshot to expose resolved LLM backend,
model, and enabled channels via /api/gateway/status
- Add missing Agent settings (daily cost cap, actions/hour, local tools)
- Add Sandbox, Routines, Safety, Skills, and Search setting groups
- Settings import/export (JSON download + file upload)
- Active env defaults shown as placeholders in Inference settings
- Styled confirmation modals replace window.confirm() for remove actions
- Global restart banner persists across settings subtab switches
- Client-side validation with min/max constraints on number inputs
- Accessibility: aria-label on inputs, role=status on save indicators
- Settings search filters rows across current subtab
- Smooth CSS transitions for conditional field visibility (showWhen)
- Tunnel settings in Channels subtab
- Mobile responsive settings layout at 768px breakpoint
- i18n keys for toolbar, search, and import/export in en + zh-CN
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(gateway): polish settings page and remove registered tools debug section
Remove the "Registered Tools" table from the extensions tab (debug info
not useful to end users), clean up associated CSS/i18n/JS. Additional
settings page UI polish: extension card state styling, layout refinements.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(gateway): address PR review feedback [skip-regression-check]
- Use refreshCurrentSettingsTab() in SSE event handlers to reduce duplication
- Remove unused formatGroupName/formatSettingLabel helpers
- Use i18n keys for MCP Configure/Reconfigure buttons
- Add data-i18n-placeholder to settings search input
- Remove data-i18n from confirm modal button (set dynamically by showConfirmModal)
- Fix cargo fmt in main.rs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(e2e): update tests for unified settings tab layout [skip-regression-check]
- Update TABS list: replace extensions/skills with settings
- Add settings_subtab/settings_subpanel selectors to helpers
- Update test_connection, test_skills, test_extensions, test_wasm_lifecycle
to navigate via Settings > subtab instead of top-level tabs
- Move MCP card tests to use go_to_mcp() helper (MCP is now a separate subtab)
- Remove tools table tests and mock_ext_apis tools= parameter
- Fix CSP violation: replace inline onclick on confirm modal cancel button
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(gateway): address second round of PR review feedback [skip-regression-check]
- Use I18n.t() for MCP empty state, export/import toasts, confirm modal
- Fix CLI channel card using wrong channel key ('repl' -> 'cli')
- Fix settings search counting hidden rows as visible
- Add aria-label i18n for settings search input
- Add common.loadFailed i18n key (en + zh-CN)
- Update E2E tests: WASM channel tests use Channels subtab,
remove tests use custom confirm modal instead of window.confirm
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(e2e): fix WASM channel card selector and skills remove confirm [skip-regression-check]
- WASM channel tests: filter by display name to avoid matching built-in
channel cards in the Channels subtab
- Skills remove test: click confirm modal button instead of using
window.confirm (skill removal now uses custom confirm modal)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(gateway): address third round of PR review feedback [skip-regression-check]
- approval_needed SSE: refresh any active settings subtab, not just
Extensions — approvals can surface from Channels/MCP setup flows too
- renderCardsSkeleton: remove nested .extensions-list wrapper that
caused skeleton cards to render constrained inside grid cells
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(e2e): fix auth_completed reload test race condition [skip-regression-check]
Use expect_response to deterministically wait for the /api/extensions
reload triggered by handleAuthCompleted → refreshCurrentSettingsTab,
instead of a fixed 600ms sleep that was too short under CI load.
Also remove stale /api/extensions/tools route handler.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(e2e): debug auth_completed reload test with function counter [skip-regression-check]
Inject a counter wrapper around refreshCurrentSettingsTab to verify it's
actually called, and wait for the async fetch to complete before
asserting the reload count.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(gateway): localize all settings labels, descriptions, and channel cards [skip-regression-check]
Move 120+ hardcoded strings in settings definitions (INFERENCE_SETTINGS,
AGENT_SETTINGS, NETWORKING_SETTINGS) and channel card labels to i18n
keys. Render functions now resolve labels via I18n.t() so the settings
page translates when switching locales.
Covers: group titles, setting labels/descriptions, built-in channel
names/descriptions, and the "No settings found" empty state.
Both en.js and zh-CN.js updated with all new cfg.* and channels.* keys.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(gateway): localize remaining hardcoded UI strings [skip-regression-check]
- Fix export error toast using wrong i18n key (importFailed → exportFailed)
- Replace "Failed to load settings:" with I18n.t('common.loadFailed')
- Localize renderBuiltinChannelCard: "Built-in", "Active", "Inactive"
- Localize settings placeholders: "env: ", "env default", "use env default"
- Localize "✓ Saved" indicator
- Add new i18n keys to both en.js and zh-CN.js
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(gateway): confirm modal a11y, Esc/click-outside, search guard [skip-regression-check]
- Add role="dialog", aria-modal="true", aria-labelledby to confirm modal
- Focus confirm button when modal opens
- Close modal on Escape key or overlay click
- Skip settings search on non-settings panels (Extensions/MCP/Skills/Channels)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(gateway): boolean tri-state, search reset on subtab switch, stale model suggestions [skip-regression-check]
Address PR review feedback:
- Boolean settings now use a tri-state select (env default / On / Off)
instead of a checkbox, matching the pattern used by other select settings
and allowing users to revert to the env default
- Clear search input when switching settings subtabs so stale filters
don't carry over to the new panel
- Always assign model suggestions (even empty array) so stale IDs from a
previous successful /v1/models fetch don't persist when the endpoint
later returns empty
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(gateway): auth_completed handler, bedrock_cross_region select, integer-only number inputs [skip-regression-check]
Address PR review feedback:
- auth_completed SSE listener now delegates to handleAuthCompleted(data)
instead of inlining logic with a bare closeConfigureModal() call, so
only the matching extension's modal is dismissed
- bedrock_cross_region changed from free text to select with the four
valid values (us/eu/apac/global), matching backend validation
- Number settings now use step=1 and parseInt() instead of parseFloat(),
preventing fractional values that the backend (u32/u64) would reject
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
90 lines
3.3 KiB
Python
90 lines
3.3 KiB
Python
"""Scenario 3: Skills search, install, and remove lifecycle."""
|
|
|
|
import pytest
|
|
from helpers import SEL
|
|
|
|
|
|
async def go_to_skills(page):
|
|
"""Navigate to Settings > Skills subtab."""
|
|
await page.locator(SEL["tab_button"].format(tab="settings")).click()
|
|
await page.locator(SEL["settings_subtab"].format(subtab="skills")).click()
|
|
await page.locator(SEL["settings_subpanel"].format(subtab="skills")).wait_for(
|
|
state="visible", timeout=5000
|
|
)
|
|
|
|
|
|
async def test_skills_tab_visible(page):
|
|
"""Skills subtab shows the search interface."""
|
|
await go_to_skills(page)
|
|
|
|
search_input = page.locator(SEL["skill_search_input"])
|
|
assert await search_input.is_visible(), "Skills search input not visible"
|
|
|
|
|
|
async def test_skills_search(page):
|
|
"""Search ClawHub for skills and verify results appear."""
|
|
await go_to_skills(page)
|
|
|
|
search_input = page.locator(SEL["skill_search_input"])
|
|
await search_input.fill("markdown")
|
|
await search_input.press("Enter")
|
|
|
|
# Wait for results (ClawHub may be slow)
|
|
try:
|
|
results = page.locator(SEL["skill_search_result"])
|
|
await results.first.wait_for(state="visible", timeout=20000)
|
|
except Exception:
|
|
pytest.skip("ClawHub registry unreachable or returned no results")
|
|
|
|
count = await results.count()
|
|
assert count >= 1, "Expected at least 1 search result"
|
|
|
|
|
|
async def test_skills_install_and_remove(page):
|
|
"""Install a skill from search results, then remove it."""
|
|
await go_to_skills(page)
|
|
|
|
# Search
|
|
search_input = page.locator(SEL["skill_search_input"])
|
|
await search_input.fill("markdown")
|
|
await search_input.press("Enter")
|
|
|
|
try:
|
|
results = page.locator(SEL["skill_search_result"])
|
|
await results.first.wait_for(state="visible", timeout=20000)
|
|
except Exception:
|
|
pytest.skip("ClawHub registry unreachable or returned no results")
|
|
|
|
# Auto-accept confirm dialogs
|
|
await page.evaluate("window.confirm = () => true")
|
|
|
|
# Install first result
|
|
install_btn = results.first.locator("button", has_text="Install")
|
|
if await install_btn.count() == 0:
|
|
pytest.skip("No installable skills found in results")
|
|
await install_btn.click()
|
|
|
|
# Wait for install to complete -- the UI calls loadSkills() after install,
|
|
# which populates #skills-list with .ext-card elements
|
|
installed = page.locator(SEL["skill_installed"])
|
|
try:
|
|
await installed.first.wait_for(state="visible", timeout=15000)
|
|
except Exception:
|
|
pytest.skip("Skill install did not update the installed list in time")
|
|
|
|
installed_count = await installed.count()
|
|
assert installed_count >= 1, "Skill should appear in installed list after install"
|
|
|
|
# Remove the skill via confirm modal
|
|
remove_btn = installed.first.locator("button", has_text="Remove")
|
|
if await remove_btn.count() > 0:
|
|
await remove_btn.click()
|
|
# Confirm in the modal
|
|
confirm_btn = page.locator(SEL["confirm_modal_btn"])
|
|
await confirm_btn.wait_for(state="visible", timeout=5000)
|
|
await confirm_btn.click()
|
|
# Wait for the card to disappear or list to shrink
|
|
await page.wait_for_timeout(3000)
|
|
new_count = await page.locator(SEL["skill_installed"]).count()
|
|
assert new_count < installed_count, "Skill should be removed from installed list"
|