feat(settings): data-safe editors, deep-linked search, Data/About/Cost pages

- EditorModal loads once per path (a parent re-render no longer reloads the
  file over the user's typing), refuses Save after a failed load, opens a
  truncated (>256 KB) file read-only, and asks before overwriting a file
  that changed on disk or could not be re-read.
- Settings/Hooks editors unset only keys from the snapshot taken at Edit,
  warn when the file changed underneath, keep a renamed key's value, and
  refuse a new key named like a redacted one (env) or a read-only hook
  event, which used to replace the secret/hooks.
- Project scope shows its resolved folder and is disabled inside the
  plugin cache. Account-profile, pricing-row and pet deletes confirm;
  two-click actions disarm after 3 s; unsaved drafts ask before closing.
- Search indexes every Claude Code / Codex sub-tab, opens it via ?tab= and
  scrolls to + highlights the row; the active config tab is in the URL.
- General splits into General / Data / About; Pricing moves to a Cost
  group with one shared load; config tabs group as Content / Extensions /
  Config with arrow-key roving; Promise.allSettled per tab.
- Data: browser-preferences export/import (allowlisted keys), per-section
  reset, housekeeping dry-run first, clear-all behind a typed phrase.
  Server: purge days must be a whole number >= 1 (INVALID_PURGE_DAYS) and
  dry_run returns exactly what the real run would delete.
- Alerts can be edited; webhooks/alerts/remote-source failures toast;
  copies go through copyText; modals get dialog roles and useDialog.
- Sagi: Ctrl/Cmd+B only when shown and not typing, default spot clear of
  row controls, arrow keys move it, reduced motion honoured; the dead
  /run launch link goes to the workspace.
This commit is contained in:
2026-10-05 13:22:08 +07:00
parent 03f1673fce
commit 6715fbd971
68 changed files with 4817 additions and 1374 deletions
+22 -20
View File
@@ -294,7 +294,7 @@ export function ImportHistory() {
className="w-full flex items-center justify-between px-4 py-3 bg-surface-2 hover:bg-surface-3 transition-colors"
>
<span className="flex items-center gap-2 text-xs font-semibold text-fg-secondary uppercase tracking-wider">
<ListChecks className="w-3.5 h-3.5 text-blue-500" />
<ListChecks className="w-3.5 h-3.5 text-accent" />
{t("import.instructions")}
</span>
<span className="text-[11px] text-fg-muted">{instructionsOpen ? "▾" : "▸"}</span>
@@ -455,8 +455,8 @@ export function ImportHistory() {
{mode === "upload" && (
<div className="space-y-3">
<div
onClick={() => fileInputRef.current?.click()}
<label
htmlFor="import-upload-files"
onDragOver={(e) => {
e.preventDefault();
setDragging(true);
@@ -467,9 +467,9 @@ export function ImportHistory() {
setDragging(false);
onSelectFiles(e.dataTransfer.files);
}}
className={`border-2 border-dashed rounded-lg px-4 py-8 text-center cursor-pointer transition-colors ${
className={`block border-2 border-dashed rounded-lg px-4 py-8 text-center cursor-pointer transition-colors focus-within:ring-2 focus-within:ring-accent/50 ${
dragging
? "border-blue-500 bg-blue-600/5"
? "border-accent bg-accent/5"
: "border-border hover:border-border-light bg-surface-1"
}`}
>
@@ -477,14 +477,15 @@ export function ImportHistory() {
<p className="text-sm text-fg-secondary">{t("import.dropzoneHint")}</p>
<p className="text-[11px] text-fg-muted mt-1">{t("import.dropzoneSub")}</p>
<input
id="import-upload-files"
ref={fileInputRef}
type="file"
multiple
accept=".jsonl,.json,.zip,.tar,.tgz,.gz,application/gzip,application/zip,application/x-tar,application/octet-stream"
onChange={(e) => onSelectFiles(e.target.files)}
className="hidden"
className="sr-only"
/>
</div>
</label>
{files.length > 0 && (
<div className="flex flex-wrap items-center justify-between gap-2 text-xs bg-surface-3 rounded-md px-3 py-2">
<span className="text-fg-secondary">
@@ -522,8 +523,8 @@ export function ImportHistory() {
{mode === "backup" && (
<div className="space-y-3">
<div
onClick={() => backupInputRef.current?.click()}
<label
htmlFor="import-backup-file"
onDragOver={(e) => {
e.preventDefault();
setDragging(true);
@@ -535,9 +536,9 @@ export function ImportHistory() {
const f = e.dataTransfer.files?.[0];
if (f) setBackupFile(f);
}}
className={`border-2 border-dashed rounded-lg px-4 py-8 text-center cursor-pointer transition-colors ${
className={`block border-2 border-dashed rounded-lg px-4 py-8 text-center cursor-pointer transition-colors focus-within:ring-2 focus-within:ring-accent/50 ${
dragging
? "border-blue-500 bg-blue-600/5"
? "border-accent bg-accent/5"
: "border-border hover:border-border-light bg-surface-1"
}`}
>
@@ -545,13 +546,14 @@ export function ImportHistory() {
<p className="text-sm text-fg-secondary">{t("import.backupHint")}</p>
<p className="text-[11px] text-fg-muted mt-1">{t("import.backupSub")}</p>
<input
id="import-backup-file"
ref={backupInputRef}
type="file"
accept=".json,application/json"
onChange={(e) => setBackupFile(e.target.files?.[0] || null)}
className="hidden"
className="sr-only"
/>
</div>
</label>
{backupFile && (
<div className="flex flex-wrap items-center justify-between gap-2 text-xs bg-surface-3 rounded-md px-3 py-2">
<span className="text-fg-secondary min-w-0">
@@ -591,7 +593,7 @@ export function ImportHistory() {
{/* In-flight progress */}
{running && progressText && (
<div className="flex items-center gap-2 text-xs text-fg-secondary bg-surface-2 border border-border rounded-md px-3 py-2">
<Loader2 className="w-3.5 h-3.5 animate-spin text-blue-500 flex-shrink-0" />
<Loader2 className="w-3.5 h-3.5 animate-spin text-accent flex-shrink-0" />
<span className="truncate">{progressText}</span>
{progress?.current && (
<code className="font-mono text-[11px] text-fg-muted truncate">
@@ -625,7 +627,7 @@ export function ImportHistory() {
<ResultStat
label={t("import.result.backfilled", { count: result.backfilled ?? 0 })}
value={result.backfilled ?? 0}
color="text-blue-700 dark:text-blue-400"
color="text-accent"
/>
<ResultStat
label={t("import.result.skipped", { count: result.skipped })}
@@ -672,7 +674,7 @@ export function ImportHistory() {
<ResultStat
label={t("import.backupResult.events", { count: backupResult.events })}
value={backupResult.events}
color="text-violet-700 dark:text-violet-300"
color="text-fg-primary"
/>
<ResultStat
label={t("import.backupResult.pricing", { count: backupResult.model_pricing })}
@@ -728,16 +730,16 @@ function ModeButton({
}) {
return (
<button
type="button"
aria-pressed={active}
onClick={onClick}
className={`text-left p-3 rounded-lg border transition-colors ${
active
? "border-blue-600/40 bg-blue-600/10"
: "border-border bg-surface-2 hover:bg-surface-3"
active ? "border-accent/40 bg-accent/10" : "border-border bg-surface-2 hover:bg-surface-3"
}`}
>
<div
className={`flex items-center gap-1.5 text-xs font-medium mb-1 ${
active ? "text-blue-700 dark:text-blue-400" : "text-fg-secondary"
active ? "text-accent" : "text-fg-secondary"
}`}
>
{icon}