Skip to content

fix(web): harden HIL cards, protect Settings/BYOK drafts, add destructive confirmations, and polish Connectors UX - #753

Open
oldwinter53 wants to merge 2 commits into
mainfrom
fix/ux-hil-settings-safety-connectors
Open

oldwinter53 wants to merge 2 commits into
mainfrom
fix/ux-hil-settings-safety-connectors

Conversation

@oldwinter53

Copy link
Copy Markdown

Summary

Fixes P0/P1 reliability, safety-guardrail, draft-preservation, and Settings/Connectors UX defects across the Web client:

1. [P0] Prevent silent draft loss in Profile Settings & Models BYOK (SET-03, LIVE-16)

  • Account Profile (account-profile-settings.tsx, account-profile-hero.tsx): Render a persistent Save changes button (disabled when pristine, enabled when dirty) alongside a Discard action, guard route navigation with UnsavedChangesBlocker (useBlocker + ModalDialog), and mark the hidden avatar <input type="file"> controls aria-hidden="true" with tabIndex={-1} so they do not leak into the accessibility tree or Tab order.
  • Models BYOK (byok-panel.tsx, local-models-page.tsx): Preserve unsaved BYOK form drafts (Base URL, Path, API Key, Model ID, format) when toggling between Local model and BYOK tabs, resetting cleanly on computer change or save, and warn via UnsavedChangesBlocker when navigating away with unsaved BYOK edits.

2. [P0] Add guardrails to unprotected destructive actions & replace window.confirm() (SET-04, SET-12, CORE-27, DS-03)

  • Added two-step inline confirmation (default focus on Cancel, data-voice-risk="never" on confirm) for Web Search → Remove key (web-search-connectors.tsx) and Chrome Browser Connection → Disconnect (browser-connection-dialog.tsx).
  • Added ModalDialog confirmation for Personal Insights → Delete insight (account-profile-settings.tsx) and Routines → Delete routine (reminders-panel.tsx).
  • Preserved pastedToken in browser-connection-dialog.tsx across failed connection attempts so users can retry without re-copying from Chrome; clear only after configure succeeds.
  • Replaced browser window.confirm() on logout with an in-app ModalDialog (logout-confirm-dialog.tsx, use-logout.ts) that works across every logout trigger.

3. [P1] Harden HIL approval, computer permission, and question cards (CORE-06, CORE-07)

  • Added a shared live expiry clock and countdown (decision-expiry.ts, decision-card.tsx, decision-computer-permission-view.tsx, decision-question-view.tsx) so pending cards flip to expired state automatically without waiting for a failed click, show a live countdown within 5 minutes of expiry, and stop permission polling on expiry.
  • Expanded runtime_permission command/diff details by default while pending to prevent blind approvals.
  • Added explicit non-owner indicators (Waiting for {name} to decide / Waiting for {name} to answer) instead of rendering an empty footer.
  • Hardened decision-question-view.tsx against rapid double-click skips/double-submissions (advanceTimerRef + advancing/submitting locks cleared on unmount/step change) and added keyboard support in Other… (non-IME Enter to advance/submit, Escape to collapse when empty).

4. [P1/P2] Connectors UX, Settings IA, shared SecretField, and FeaturedModelSpotlight (LIVE-10, LIVE-11, SET-13, SET-15, SET-16, SET-19)

  • Connectors (connected-apps-page.tsx): Added instant search (Search connectors…), refined Connected only to exclude unconnected key-based search backends while keeping configured keys and built-in keyless defaults, expanded card descriptions to line-clamp-2, and reworked the mobile header (375px) so Connected only sits beside the title while search spans full width and category tabs scroll horizontally with an edge fade cue.
  • Settings IA (settings-page.tsx, account-settings-page.tsx, settings-page-heading.tsx): Removed replace from Settings sidebar NavLinks so browser Back/Forward works across Settings subpages, unified stray "Apps" copy to "Connectors", linked Connectors from the Profile subtitle, and updated the Security subtitle to cover both sign-in password and server API keys.
  • Shared SecretField / SecretInput (components/ui/secret-field.tsx): Unified accessible Show/Mask toggles across Change Password (with an upfront "At least 8 characters." requirement hint), BYOK API Key, Chrome Browser token, Provider Key, and Web Search Key forms.
  • FeaturedModelSpotlight (featured-model-spotlight.tsx, local-models-page.tsx): Hidden when the catalog is empty or a host blocker is active, and added a per-model dismiss (×) button persisted in localStorage.
  • Synchronized apps/web/src/i18n/locales/zh-CN.json for all new and updated message keys.

Verification

  • make check-web-static (tsc --noEmit, eslint --max-warnings=0, react-doctor --blocking error --scope changed): passed
  • pnpm --filter @linger/web run build:assets: passed (initial JS budget within limit: 592.17/1000 kB min, 203.29/210 kB gzip, 176.91/180 kB Brotli)
  • pnpm exec prettier --check on all 46 modified/added files: passed
  • Unit tests (17 suites, 270 tests): all passed, including new tests for SecretField, BYOK draft persistence & spotlight dismissal, HIL expiry/non-owner/double-click guards, destructive confirmations, logout modal, Settings unsaved-change blocker, i18n catalog consistency (catalog.test.ts), and Voice Mode risk markers (voice-risk-markers.test.ts)
  • Visual verification via Playwright across desktop (1440×900) and mobile (375×812) viewports for Connectors (search, Connected only, mobile layout), Profile Settings draft guard, Security Settings + SecretField Change Password modal, and Room Chat HIL cards: zero horizontal overflow and zero console errors

Harden HIL approval and question cards with live expiry timers, default-expanded runtime permission diffs, non-owner decision indicators, and double-click/keyboard guards. Preserve unsaved Profile and BYOK drafts across navigation and tab switches, add confirmations to destructive actions, replace window.confirm on logout with an in-app modal, introduce a shared SecretField toggle component, hide/dismiss FeaturedModelSpotlight when blocked or empty, and polish Connectors search, Connected only filtering, and mobile layout.
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.

2 participants