Repository navigation
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
Open
oldwinter53 wants to merge 2 commits into
oldwinter53 wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-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 withUnsavedChangesBlocker(useBlocker+ModalDialog), and mark the hidden avatar<input type="file">controlsaria-hidden="true"withtabIndex={-1}so they do not leak into the accessibility tree or Tab order.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 viaUnsavedChangesBlockerwhen 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)data-voice-risk="never"on confirm) for Web Search → Remove key (web-search-connectors.tsx) and Chrome Browser Connection → Disconnect (browser-connection-dialog.tsx).ModalDialogconfirmation for Personal Insights → Delete insight (account-profile-settings.tsx) and Routines → Delete routine (reminders-panel.tsx).pastedTokeninbrowser-connection-dialog.tsxacross failed connection attempts so users can retry without re-copying from Chrome; clear only afterconfiguresucceeds.window.confirm()on logout with an in-appModalDialog(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)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.runtime_permissioncommand/diff details by default while pending to prevent blind approvals.Waiting for {name} to decide/Waiting for {name} to answer) instead of rendering an empty footer.decision-question-view.tsxagainst rapid double-click skips/double-submissions (advanceTimerRef+ advancing/submitting locks cleared on unmount/step change) and added keyboard support inOther…(non-IMEEnterto advance/submit,Escapeto collapse when empty).4. [P1/P2] Connectors UX, Settings IA, shared
SecretField, andFeaturedModelSpotlight(LIVE-10,LIVE-11,SET-13,SET-15,SET-16,SET-19)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 toline-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-page.tsx,account-settings-page.tsx,settings-page-heading.tsx): Removedreplacefrom Settings sidebarNavLinks 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.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.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 inlocalStorage.apps/web/src/i18n/locales/zh-CN.jsonfor all new and updated message keys.Verification
make check-web-static(tsc --noEmit,eslint --max-warnings=0,react-doctor --blocking error --scope changed): passedpnpm --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 --checkon all 46 modified/added files: passed17suites,270tests): all passed, including new tests forSecretField, 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)1440×900) and mobile (375×812) viewports for Connectors (search, Connected only, mobile layout), Profile Settings draft guard, Security Settings +SecretFieldChange Password modal, and Room Chat HIL cards: zero horizontal overflow and zero console errors