Repository navigation
Commit 2e6fe9e
fix(settings): refine claude and typesafe key setup dialogs (#3391)
## Overview
**Category:** improvement
**User Impact:** Claude and TypeSafe key setup provides focused inputs
and direct key-creation links; Claude preserves unsaved drafts when its
storage check fails.
**Problem:** Initial Claude key entry occupies the Settings pane and
repeats its label. Key setup needs concise instructions, consistent
spacing, normal Back/Forward behavior and recovery that preserves
unsaved drafts.
**Solution:** Open initial Claude key entry from Set in Connect Claude,
matching TypeSafe. Keep one sentence on the Claude page, console links
in both popups and storage reassurance below the fields. Preserve inline
replacement and shared credential controls. Keep Claude drafts
recoverable through failed storage checks.
## Changes
<details>
<summary>File changes</summary>
**src/bundled/claude-code/ClaudeSettings.tsx**
Open Set in Connect Claude and preserve its draft through passive
traversal and failed credential reads. Keep the input focused but
read-only during verification, with error and Retry inside the dialog;
retire setup on explicit dismissal or confirmed saved credentials.
**src/bundled/claude-code/auth.tsx**
Use the shared key form with storage guidance beneath it, retain its
state outside the popup lifetime and forward the caller's read-only
verification gate.
**src/features/settings/ApiKeyForm.tsx**
Add an optional read-only mode that retains keyboard focus. Existing
callers keep their default input behavior.
**src/bundled/claude-code/index.ts**
Register the connect route with the existing Settings navigation owner;
history holds only a presentation marker.
**src/bundled/claude-code/tabs.tsx**
Use compact spacing in existing key-entry dialogs.
**src/app/DecisionsSettings.tsx**
Provide TypeSafe's direct console link and focus editable inputs while
leaving readonly saved-key actions closed.
**src/bundled/claude-code/ClaudeSettings.test.tsx**
Cover links, storage guidance, pending-save traversal, draft dismissal,
focus and read-error recovery with the restored draft preserved through
Retry.
**src/bundled/claude-code/index.test.ts**
Exercise the registered card's open, Back/Forward and dismissal wiring
through the real navigation controller.
**src/app/DecisionsSettings.test.tsx**
Use one real-component journey for TypeSafe's editable and unreadable
focus states, dismissal and successful provider selection.
**src/bundled/claude-code/tabs.test.tsx**
Align setup copy expectations with the separate storage guidance.
**src/bundled/typesafe/README.md**
Document the key-creation link.
**docs/buzz-help.md**
Describe both setup dialogs and Claude's history/draft behavior.
</details>
## Reproduction steps
1. Open Settings → Claude without a saved key and choose Set. Connect
Claude focuses its input and links to Anthropic's API-key settings.
2. Enter a draft, go Back and Forward within the Claude page, and
confirm the draft returns. Explicitly close and reopen to confirm it is
cleared. A dismissed visit must not reopen through Forward.
3. With Builderlab selected in Settings → Decisions API, choose TypeSafe
without a key. Its dialog focuses the input and links to the TypeSafe
keys page. Closing retains Builderlab; successful setup completes the
switch.
4. With an unreadable saved TypeSafe key, open setup and confirm the
saved-key menu stays closed until requested. Replace keeps autofocus on
its editable input.
5. During a pending credential recheck, confirm Claude's key input keeps
focus but cannot be edited. If secure-storage access fails, the dialog
should retain its draft, show the error and offer Retry. After a
successful missing-key check, editing resumes with the same draft;
finding an existing key closes setup. The subtitle stays neutral while
status is unknown.
## Validation
- Head `9193df13ad23ecac396523bbc0c5e50f63db0634`: typecheck and all
**43 affected tests pass** (18 Claude Settings, 10 TypeSafe, 15
Decisions Settings). Mandatory type/related-unit-test, design, Rust
clippy and push checks pass; hosted CI provides broader integration
coverage.
- The existing routed test cases now hold the read with a deferred
promise, verify autofocus and blocked typing, then cover confirmed saved
credentials or a failed read followed by Retry with the same draft. No
new test cases or browser journeys were added.
- Test-runner-only mutations confirm the recovery case fails if read
errors dismiss setup, and both pending-read cases fail if the input lock
is removed. Production source was never edited for these probes.
- Relative to integrated main `ae2a0899a39288920bae2425c7d4f25174e48bd9`
(#3365), the PR adds **282 test lines and 301 non-test lines** (48.4%
tests). Changed lines total **326 test / 390 non-test** across twelve
files.
- The current read-error recovery state has component-test evidence. A
native walkthrough and new capture remain pending: the previously
running debug build and frontend server exited during inspection. No
credentials were changed, and no substitute capture was created.
- Earlier native captures below document the normal layout, links and
input focus, before this recovery change. External link navigation,
native replacement/writes, narrow-width, enlarged-text and light-theme
checks remain pending.
## Screenshots
Actual native app captures, cropped to Settings content. Claude captures
are from `05eeebc49`; TypeSafe is from `4ddfd2434`. They document the
layout and copy; current traversal and unreadable-key behavior are
covered by the tests below.
| Claude settings |
| --- |
| 
|
| Connect Claude | Connect TypeSafe |
| --- | --- |
| 
| 
|
---------
Signed-off-by: Taylor Ho <[email protected]>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>1 parent 6223ae5 commit 2e6fe9e
12 files changed
Lines changed: 583 additions & 133 deletions
File tree
- docs
- src
- app
- bundled
- claude-code
- typesafe
- features/settings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1233 | 1233 | | |
1234 | 1234 | | |
1235 | 1235 | | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
1240 | 1246 | | |
1241 | 1247 | | |
1242 | 1248 | | |
| |||
1441 | 1447 | | |
1442 | 1448 | | |
1443 | 1449 | | |
1444 | | - | |
| 1450 | + | |
| 1451 | + | |
1445 | 1452 | | |
1446 | 1453 | | |
1447 | 1454 | | |
| |||
1660 | 1667 | | |
1661 | 1668 | | |
1662 | 1669 | | |
1663 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
| |||
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
| 22 | + | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
| |||
371 | 379 | | |
372 | 380 | | |
373 | 381 | | |
374 | | - | |
| 382 | + | |
375 | 383 | | |
376 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
377 | 393 | | |
378 | 394 | | |
379 | 395 | | |
380 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
381 | 407 | | |
382 | 408 | | |
383 | 409 | | |
384 | 410 | | |
385 | 411 | | |
386 | | - | |
387 | | - | |
388 | 412 | | |
389 | 413 | | |
390 | 414 | | |
391 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
392 | 420 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
398 | 427 | | |
399 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
400 | 432 | | |
401 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
402 | 440 | | |
403 | 441 | | |
404 | 442 | | |
405 | 443 | | |
406 | 444 | | |
407 | 445 | | |
408 | 446 | | |
409 | | - | |
| 447 | + | |
| 448 | + | |
410 | 449 | | |
411 | 450 | | |
412 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
358 | 360 | | |
359 | 361 | | |
360 | 362 | | |
361 | | - | |
362 | | - | |
363 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
364 | 386 | | |
365 | 387 | | |
366 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
367 | 397 | | |
368 | 398 | | |
369 | 399 | | |
370 | 400 | | |
371 | 401 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
389 | 421 | | |
390 | 422 | | |
391 | 423 | | |
| |||
0 commit comments