Commit 32f30b8
fix(client): the context menu's click target is the menu that is drawn (UI/UX v3 N-4a) (#104)
* docs: N-4 design spec — the menus and dialogs leave the cell path
P4f の残件(context menu / SFTP ダイアログ / ssh・keybindings タブ)を
測定ベースへ移すための設計スペック。測定して分かったことを 3 点記録する。
- context menu の幅の式が 5 箇所に散在し、うち 2 箇所(hover / click 判定)
が 18 桁固定。実在する全メニューが 27〜40 桁で描かれるため、各行の右
33〜55% がクリックに反応しない。ja ではさらに広い。
- SFTP ダイアログの 5 文字列と context menu の `new_default` 8 項目が
fl! を通っておらず、全 8 locale にキーが無い。後者は同じメニュー内で
localised な項目と混在するため、半分だけ翻訳された表示になっている。
- 2 つの削除ダイアログはコピー同士で 4 点 drift しており、ボタンの装飾
(角括弧・先頭スペース)が 8 言語の翻訳データ側に焼き込まれている。
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
* fix(client): the context menu's click target is the menu that is drawn (UI/UX v3 N-4a)
コンテキストメニューの幾何を `renderer/menu_layout.rs` に集約する。
幅の式は 5 箇所に散在していた: 描画側(dialog.rs)、配置時の clamp 2 箇所、
そして hover / click の当たり判定 2 箇所。後者は `18.0 * cell_w` の固定値で、
直上のコメントは「描画幅と同じ値を使う(変えると描画とクリック判定がずれる)」
と書いていたが、その不変条件は成立していなかった。
実在するメニューはすべて 18 桁より広く描かれる(en で 27〜40 桁、ja で
29〜43 桁)ため、はみ出した部分はマウスに反応しない。各行の右 33〜55% —
ちょうどキーヒント列 — をクリックしても、メニューが閉じるだけで動作しな
かった。ブロックメニューでは行の 55% が死んでいた。
`menu_width` / `menu_height` / `row_y` / `item_at` を 5 箇所すべてが呼ぶ。
セパレータは `item_at` が明示的に None を返す(描画側が hover fill を
スキップする行を、hover 側が記録し続けていた)。
N-4a は測定方式を変えない: 幅は従来どおり `visual_width` で表示セルを数え
るため、描画結果は 1 ピクセルも変わらない。run path への移行は N-4b。
Spec: docs/plans/2026-08-30-n4-menus-and-dialogs.md §2 D1/D2, §5.1
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>1 parent ffa7d9c commit 32f30b8
5 files changed
Lines changed: 852 additions & 81 deletions
0 commit comments