Repository navigation
refactor(view): ハイライトと矢印キーの純粋部分を持ち帰る(#31 の上に積んでいます) - #32
Merged
Merged
Conversation
…aude Both were lifted out of this View in MulmoClaude and given tests; the logic here was still inline. The pure parts move out, with their tests. - src/vue/keyboardNav.ts: getArrowKeyOffset and isWithinSheetBounds. - src/vue/cellHighlights.ts: clearCellHighlights, applyCellHighlights, highlightCell, over a minimal DOM surface so a test needs no jsdom. - View.vue calls them; the watch body and the arrow-key switch go away. Behaviour-preserving, and shown to be: the old inline switch and bounds check were copied verbatim into a throwaway harness and run beside the helpers over generated keys, coordinates and sheet shapes (including negative indices, a sparse row and a zero-length row). Identical on every case. The harness is deleted; what survives it is the generated ground it covered, which the ported tests already assert directly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The view helpers arrived in tests/vue, which the engine-only glob did not reach — a test that is not run is not a test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
CODEX VERDICT: LGTM
FINDINGS COMPLETE: I read every hunk of the diff and this is every finding I have. |
Contributor
Author
Codex cross-review — round 1 (tier C): cleanTier C for one reason: this PR claims behaviour preservation, and that is proved by running old and new side by side, never by reading. Codex:
My own evaluation of the same head has no MUST-FIX, and nothing has been pushed since it was reviewed. Prompt sent (verbatim)Codex stdout (verbatim) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spreadsheet の第2段です(棚卸し: receptron/mulmoclaude#3287)。#31 の上に積んでいますので、base は
backport/engine-from-mulmoclaudeです。#31 が入れば、この PR の base は自動でmainに切り替わります。View.vueを丸ごと持ち帰るのは勧めません。MulmoClaude 側の View は全文が i18n で、こちらに i18n の仕組みがないため、訳を剥がす作業になってしまいます。代わりに、あちらで切り出された純粋な部分だけを戻します。src/vue/keyboardNav.ts:getArrowKeyOffsetとisWithinSheetBounds。src/vue/cellHighlights.ts:clearCellHighlights/applyCellHighlights/highlightCell。DOM の最小の面だけを型で受けるので、テストに jsdom が要りません。View.vueがこの2つを呼びます。ハイライトの watch の中身と、矢印キーのswitch+ 範囲チェックが消えます。tests/vue/に入り、test:engineの glob をtests/**/test_*.tsに広げました(走らないテストはテストではないので)。Items to Confirm / Review
View.vueにあったswitchと範囲チェックをそのまま写した対照を使い捨ての試験台に置き、切り出した関数と並べて走らせました。生成した入力は、矢印キー4種+それ以外の5種、座標-3 / -1 / 0 / 1 / 2 / 7、シート8種(null/undefined/{}/ 空 / 空行 / 通常 / 行長の違う配列 / 行が欠けた疎配列)で、矢印キー 324 通り・境界 288 通りのすべてで同一でした。試験台は消しました。残るのは、その生成条件を持ち込んだテストが直接押さえていることです(0 での止まり、非矢印キー、空文字、負の行・列、長さ超え、シート欠落、疎な行、長さ0の行)。if (miniEditorOpen.value && tableContainer.value)で囲んでいた部分を、clearCellHighlightsを先に呼んでからif (!miniEditorOpen.value) return;にしました。消す処理は元も先に無条件で走っていたので、順序は同じです。targetという名前が衝突したのでnextCellにしました。 ハンドラの先頭にconst target = event.target as HTMLElementがあるためです。View.vueの残りの差分(訳と、それに伴う構造)は対象外です。確認したこと
typecheck/lint(エラー0)/buildと、test/test:engine(980件)/test:fixtures/test:calculator/test:evaluator/test:functionsが通ります。User Prompt
🤖 Generated with Claude Code