Skip to content

Close 書き出し on Esc and show each profile's own env on the モデル screen (D-57) - #39

Merged
eddybean merged 2 commits into
mainfrom
fix/dialog-esc-profile-fields
Nov 28, 2026
Merged

eddybean merged 2 commits into
mainfrom
fix/dialog-esc-profile-fields

Conversation

@eddybean

Copy link
Copy Markdown
Owner

React 19 の動作確認(#38)中に見つけた既存バグ2件の修正です。どちらも React 18.3 の main で同じ手順で再現します。

修正

  • 書き出しダイアログが Esc で閉じない:アプリ側の Esc ハンドラが先に行の選択を解除 → 選択を読む書き出しダイアログが keydown の配信中に再描画 → Dialog が毎回新しい onClose でリスナーを付け直し、配信中に付いたリスナーは呼ばれない。Dialog はリスナーを1つだけ持ち、ref 経由で最新の onClose を呼ぶようにした。
  • モデル画面で env・追加の引数の欄が前のプロファイルの値のまま:非制御(defaultValue、blur で保存)の欄なのにフォームが再マウントされていなかった。そのまま欄を離れると、別プロファイル(例: Irodori)に Drama-3 の Vulkan 環境変数が保存されていた。フォームに key={prof.id} を付けた。

確認

  • src/app/Dialog.test.tsx、src/features/models/ModelManager.test.tsx を追加。どちらも修正前は失敗、修正後は成功。
  • npm run check 全通過。
  • 実アプリ(WebView2 DevTools 経由で実キー・マウス入力):Esc で書き出し・設定とも閉じる。Drama-3 ⇄ Irodori の切替でそれぞれの env が表示される。

D-57 は #38 の D-56 を参照しています(#38 を先にマージする想定)。

🤖 Generated with Claude Code

eddybean and others added 2 commits November 28, 2026 18:05
…D-57)

Dialog re-added its keydown listener on every render, so when the app's
Esc handler re-rendered the export dialog mid-dispatch the new listener
missed the key. It now keeps one listener and calls the latest onClose.

The モデル form's env and extra-args fields are uncontrolled, so picking
another profile kept the first one's text, and leaving the field saved
it into the other profile. The form is now keyed by the profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	docs/deviations.md
@eddybean
eddybean merged commit bbf9471 into main Nov 28, 2026
8 checks passed
@eddybean
eddybean deleted the fix/dialog-esc-profile-fields branch November 28, 2026 09:13
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.

1 participant