Isolate server search from the delete password prompt

The delete confirmation adds a password field. Browsers and password managers
paired it with the only other text field on the page and filled the account
name into the server search box on the server list.

The search input now stays out of the DOM while a delete confirmation is open,
and the toolbar shows a suspended notice styled to match the field it replaces
so the row does not jump. A jsdom test drives the real action menu and dialog
instead of asserting page source strings.
This commit is contained in:
npc0-hue
2026-09-15 12:25:17 +08:00
parent a822e9250a
commit 4ea27bda6a
4 changed files with 176 additions and 13 deletions
+23 -13
View File
@@ -505,19 +505,29 @@ export function ServersPage({ session, operations, onNavigate }: PageComponentPr
<div className="server-toolbar" role="search" data-form-type="other">
<Search size={16} aria-hidden="true" />
<input
type="search"
name="server-list-filter"
autoComplete="new-password"
data-1p-ignore="true"
data-lpignore="true"
data-bwignore="true"
data-protonpass-ignore="true"
value={keyword}
placeholder="搜索服务器名称、ID 或插件"
aria-label="搜索服务器"
onChange={(event) => setKeyword(event.target.value)}
/>
{/* The delete prompt adds a password field, and browsers/password managers
pair it with the only other text field on the page, filling the account
name into the server search box. Keep the search field out of the DOM
while that prompt is open instead of relying on autofill hints. */}
{deleteConfirmation === null ? (
<input
type="search"
name="server-list-filter"
autoComplete="new-password"
data-1p-ignore="true"
data-lpignore="true"
data-bwignore="true"
data-protonpass-ignore="true"
value={keyword}
placeholder="搜索服务器名称、ID 或插件"
aria-label="搜索服务器"
onChange={(event) => setKeyword(event.target.value)}
/>
) : (
<span className="server-search-suspended" aria-hidden="true">
</span>
)}
{statusFilters.map((filter) => (
<button
key={filter.id}