Skip to content

コミット前のパーツを参照・実行できるようにし, パーツ名の変更で参照が切れないようにする - #822

Merged
narumincho merged 1 commit into
mainfrom
working-parts-and-rename
Oct 31, 2026
Merged

narumincho merged 1 commit into
mainfrom
working-parts-and-rename

Conversation

@narumincho

Copy link
Copy Markdown
Owner

Requested by ナルミンチョ · project thread

#821 で洗い出した「UI でできない操作」のうち 2 つを直します。

コミット前のパーツを参照・実行できるようにする

  • コミット済みのパーツに作業中の変更を重ねた「作業中のパーツ」(src/working_parts.ts) を作り, useDefiny() の workingParts / workingPartsByIdHash / workingPartNames で渡す
  • 式エディタの選択肢・パーツ参照の表示・期待する型の問い合わせ・パーツ詳細の型検査・実行パネルはこれを使う。パーツ ID はモジュール名とパーツ名から決まるので, コミット前でも ID が分かる
  • 期待する型の問い合わせのセッションは, 型環境に効く変更 (名前・型・型パーツの宣言・削除) のときだけ作り直す

パーツ名の変更で参照が切れないようにする

  • パーツ詳細で名前を変えたら, このパーツ自身と参照している他のパーツ (コミット済み・新しいパーツ) の型・式・定義の式を新しい名前の ID に付け替える (src/rename_part.ts)
  • 以前は参照側が part_not_found の型エラーになり, コミットできなかった

確認

  • 単体テスト (working_parts.test.ts, rename_part.test.ts) と E2E を追加。ローカルで E2E 42 件すべて通過
  • E2E: コミット前の double を quad から 2 回呼び, コミットせずに実行パネルで quad(x: 3) → 12。double を twice に変えると quad の参照も twice になり, 型エラーなくコミットできる

docs: docs/ui.md に「作業中のパーツ」「パーツの名前の変更」を追加, docs/run-panel.md を更新。#821 の一覧からの削除は #821 のマージ後に行います。


Generated by Claude Code

- 作業中のパーツ (コミット済みのパーツに作業中の変更を重ねたもの, src/working_parts.ts) を式エディタの選択肢・型の問い合わせ・実行パネルで使う
- パーツ名を変えたら参照しているパーツの型・式・定義の式を新しい名前の ID に付け替える (src/rename_part.ts)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHYnFuQUdypvyuGYZvKNxN
@narumincho narumincho self-assigned this Oct 31, 2026
@narumincho
narumincho merged commit 34f7ef0 into main Oct 31, 2026
1 check passed
@narumincho
narumincho deleted the working-parts-and-rename branch October 31, 2026 23:22
narumincho pushed a commit that referenced this pull request Oct 31, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHYnFuQUdypvyuGYZvKNxN
narumincho pushed a commit that referenced this pull request Oct 31, 2026
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.

2 participants